MatrixMiniR4 1.1.9
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
MMLower Class Reference

Handling the Lower MCU (STM32) communication. More...

#include <MMLower.h>

Classes

struct  AllInfo_t
 
struct  Motors_Param_t
 

Public Types

enum class  COMM_STATE { WAIT_LEAD , WAIT_NOT_LEAD , WAIT_CMD , ERROR }
 
enum class  COMM_CMD {
  NONE = 0x00 , SET_DC_MOTOR_DIR = 0x01 , SET_ENCODER_DIR , SET_SERVO_DIR ,
  SET_DC_MOTOR_SPEED_RANGE , SET_SERVO_PULSE_RANGE , SET_SERVO_ANGLE_RANGE , SET_BUTTON_INIT ,
  SET_ENCODER_ECHO_MODE , SET_IMU_ECHO_MODE , SET_IMU_INIT , SET_POWER_PARAM ,
  SET_ENCODER_PPR_MAXSPEED , SET_ALL_ENCODER_PPR , SET_IMU_Calib_Data , SET_DC_MOTOR_POWER = 0x11 ,
  SET_DC_MOTOR_SPEED , SET_DC_MOTOR_ROTATE , SET_ALL_DC_MOTOR_SPEED , SET_SERVO_ANGLE ,
  SET_ALL_SERVO_ANGLE , SET_MOVE_DISTANCE , SET_ENCODER_RESET_COUNTER , SET_STATE_LED ,
  SET_IMU_TO_ZERO , SET_PID_PARAM , SET_DC_BRAKE , SET_ALL_DC_BRAKE ,
  SET_ALL_DC_MOTOR_POWER , GET_BUTTON_STATE = 0x21 , GET_BUTTONS_STATE , GET_ENCODER_COUNTER ,
  GET_ALL_ENCODER_COUNTER , GET_IMU_EULER , GET_IMU_GYRO , GET_IMU_ACC ,
  GET_POWER_INFO , GET_ROTATE_STATE , GET_SPEED_ALL_DC_MOTOR , GET_IMU_ACC_NOcal ,
  GET_ENCODER_DEGREES , AUTO_SEND_BUTTON_STATE = 0x31 , AUTO_SEND_ENCODER_COUNTER , AUTO_SEND_IMU_EULER ,
  AUTO_SEND_IMU_GYRO , AUTO_SEND_IMU_ACC , SET_DC_BRAKE_TYPE = 0x41 , SET_DC_ALL_BRAKE_TYPE ,
  SET_DC_TWO_MOTOR_PARAM , SET_DC_TWO_MoveSync_PID , SET_DC_TWO_MoveGyro_PID , SET_DC_TWO_TurnGyro_PID ,
  SET_DC_TWO_MOTOR_Reset_count , SET_DC_TWO_MOTOR_PPR , SET_DC_MOTOR_TYPE , SET_Drive_Move = 0x51 ,
  SET_Drive_MoveDegs , SET_Drive_MoveTime , SET_Drive_MoveSync , SET_Drive_MoveSyncDegs ,
  SET_Drive_MoveSyncDegsACC , SET_Drive_MoveSyncTime , SET_Drive_Gyro , SET_Drive_GyroDegs ,
  SET_Drive_GyroTime , SET_Drive_Turn , SET_Drive_Brake , GET_Task_Done_Status ,
  GET_Drive_Degress , GET_Drive_Counter , ECHO_TEST = 0xFF , F_VERSION = 0xFE ,
  F_BUILD_DAY = 0xFD , F_DESCRIPTOR = 0xFC , READ_MODEL_INDEX = 0xFB , READ_ALL_INFO = 0xFA ,
  RUN_AUTO_QC = 0xF9
}
 
enum class  BTN_STATE {
  NOKEY , F_EDGE , REPEAT , PRESSED ,
  R_EDGE
}
 
enum class  DIR { REVERSE , FORWARD }
 
enum class  BUTTON_ECHO_MODE { PASSIVE , ACTIVE , MAX }
 
enum class  ENCODER_ECHO_MODE { PASSIVE , ACTIVE , MAX }
 
enum class  IMU_ECHO_MODE { PASSIVE , TIMING , ACTIVE , MAX }
 
enum class  IMU_ACC_FSR { _2G , _4G , _8G , _16G }
 
enum class  IMU_GYRO_FSR { _250DPS , _500DPS , _1000DPS , _2000DPS }
 
enum class  IMU_ODR {
  _10_SPS , _20_SPS , _25_SPS , _50_SPS ,
  _100_SPS , _125_SPS , _250_SPS , _500_SPS ,
  _1000_SPS , _2000_SPS , _4000_SPS , _8000_SPS
}
 
enum class  IMU_FIFO { ENABLE , DISABLE }
 
enum class  MOVE_TYPE { DIFF , OMNI }
 
enum class  MOVE_ACTION {
  STOP , FORWARD , BACKWARD , LEFT ,
  RIGHT
}
 
enum class  RESULT {
  OK , ERROR , ERROR_SOFTSERIAL_BEGIN , ERROR_INIT ,
  ERROR_WAIT_TIMEOUT , ERROR_READ_TIMEOUT , ERROR_SERVO_MIN_PULSE , ERROR_SERVO_MAX_PULSE ,
  ERROR_SERVO_MIN_ANGLE , ERROR_SERVO_MAX_ANGLE , ERROR_MODE , ERROR_INTERVAL ,
  ERROR_IMU_ACC_FSR , ERROR_IMU_GYRO_FSR , ERROR_IMU_ODR , ERROR_MOTOR_SPEED ,
  ERROR_MOTOR_POWER , ERROR_MOTOR1_SPEED , ERROR_MOTOR2_SPEED , ERROR_MOTOR3_SPEED ,
  ERROR_MOTOR4_SPEED , ERROR_SERVO_ANGLE , ERROR_SERVO1_ANGLE , ERROR_SERVO2_ANGLE ,
  ERROR_SERVO3_ANGLE , ERROR_SERVO4_ANGLE , ERROR_MOVE_ACTION , ERROR_MOVE_SPEED ,
  ERROR_MOVE_ENCODER , ERROR_QC_IMU , ERROR_POWER_VOLT_RANGE
}
 
enum class  Drive_RESULT {
  OK = 0x00 , ERROR , ERROR_SOFTSERIAL_BEGIN , ERROR_INIT ,
  ERROR_WAIT_TIMEOUT , ERROR_READ_TIMEOUT , ERROR_Drive_Define = 0x07 , ERROR_Drive_Param ,
  ERROR_Drive_IMU_idle , ERROR_MOTOR_SPEED = 0x0F , ERROR_MOTOR_POWER = 0x10
}
 
typedef void(* BtnChgCallback) (uint8_t num, BTN_STATE newState)
 

Public Member Functions

 MMLower (uint8_t rx, uint8_t tx, uint32_t baudrate)
 
RESULT Init (uint32_t timeout_ms=1000)
 
RESULT SetDCMotorDir (uint8_t num, DIR dir)
 
RESULT SetEncoderDir (uint8_t num, DIR dir)
 
RESULT SetServoDir (uint8_t num, DIR dir)
 
RESULT SetDCMotorSpeedRange (uint8_t num, uint16_t min, uint16_t max)
 
RESULT SetServoPulseRange (uint8_t num, uint16_t min, uint16_t max)
 
RESULT SetServoAngleRange (uint8_t num, uint16_t min, uint16_t max)
 
RESULT SetIMUEchoMode (IMU_ECHO_MODE mode, uint16_t echoIntervalMs)
 
RESULT SetIMUInit (IMU_ACC_FSR accFSR, IMU_GYRO_FSR gyroFSR, IMU_ODR odr, IMU_FIFO fifo)
 
RESULT SetPowerParam (float fullVolt, float cutOffVolt, float alarmVolt)
 
RESULT SetStateLED (uint8_t brightness, uint32_t colorRGB)
 
RESULT SetIMUToZero (void)
 
RESULT SetIMU_Calib_data (float *bufdata)
 
RESULT SetEncode_PPR_MaxRPM (uint8_t num, uint16_t ppr, uint16_t Maxspeed)
 
RESULT SetALL_Encode_PPR (uint16_t *ppr)
 
RESULT SetDCMotorPower (uint8_t num, int16_t power)
 
RESULT SetDCMotorSpeed (uint8_t num, int16_t speed)
 
RESULT SetDCMotorRotate (uint8_t num, int16_t maxSpeed, uint16_t degree)
 
RESULT SetAllDCMotorSpeed (Motors_Param_t param)
 
RESULT SetServoAngle (uint8_t num, uint16_t angle)
 
RESULT SetAllServoAngle (uint16_t angle1, uint16_t angle2, uint16_t angle3, uint16_t angle4)
 
RESULT SetMoveDistance (MOVE_TYPE type, MOVE_ACTION action, uint16_t speed, uint16_t enCounter)
 
RESULT SetEncoderResetCounter (uint8_t num)
 
RESULT SetPIDParam (uint8_t num, uint8_t pidNum, float kp, float ki, float kd)
 
RESULT SetDCBrake (uint8_t num)
 
RESULT SetALLDCBrake (void)
 
RESULT SetDC_Type_Brake (uint8_t num, uint8_t type)
 
RESULT SetALLDC_Type_Brake (uint8_t *type)
 
RESULT SetAllDCMotorPower (Motors_Param_t param)
 
RESULT GetButtonState (uint8_t num, bool &btnState)
 
RESULT GetButtonsState (bool *btnsState)
 
RESULT GetEncoderCounter (uint8_t num, int32_t &enCounter)
 
RESULT GetAllEncoderCounter (int32_t *enCounter)
 
RESULT GetIMUEuler (double &roll, double &pitch, double &yaw)
 
RESULT GetIMUGyro (double &x, double &y, double &z)
 
RESULT GetIMUAcc (double &x, double &y, double &z)
 
RESULT GetPowerInfo (float &curVolt, float &curVoltPerc)
 
RESULT GetRotateState (uint8_t num, bool &isEnd)
 
RESULT GetALLEncoderSpeed (int32_t *enSpeed)
 
RESULT Get_IMU_nancalib_acc (float *accdata)
 
RESULT GetEncoderDegrees (uint8_t num, int32_t &enDeges)
 
RESULT EchoTest (void)
 
RESULT GetFWVersion (String &version)
 
RESULT GetFWBuildDay (String &date)
 
RESULT GetFWDescriptor (String &descriptor)
 
RESULT GetModelIndex (uint8_t &index)
 
RESULT GetAllInfo (AllInfo_t &info)
 
RESULT RunAutoQC (void)
 
Drive_RESULT Set_Drive2Motor_PARAM (uint8_t m1_num, uint8_t m2_num, DIR m1_dir, DIR m2_dir, uint8_t num)
 
RESULT Set_Drive_MoveSync_PID (float Kp, float Ki, float Kd, uint8_t num)
 
RESULT Set_Drive_MoveGyro_PID (float Kp, float Ki, float Kd, uint8_t num)
 
RESULT Set_Drive_MoveTurn_PID (float Kp, float Ki, float Kd, uint8_t num)
 
Drive_RESULT Set_Drive_Reset_Count (uint8_t num, bool reset)
 
Drive_RESULT Set_Drive_Encode_PPR (uint8_t num, uint16_t *ppr)
 
Drive_RESULT Set_Drive_Motor_Type (uint8_t num, uint8_t type)
 
Drive_RESULT Set_Drive_Move_Func (int16_t power_left, int16_t power_right, uint8_t num)
 
Drive_RESULT Set_Drive_Move_Degs (int16_t power_left, int16_t power_right, uint16_t Degree_c, bool brake, bool async, uint8_t num)
 
Drive_RESULT Set_Drive_Move_Time (int16_t power_left, int16_t power_right, uint32_t Time_mS, bool brake, bool async, uint8_t num)
 
Drive_RESULT Set_Drive_MoveSync_Func (int16_t power_left, int16_t power_right, uint8_t num)
 
Drive_RESULT Set_Drive_MoveSync_Degs (int16_t power_left, int16_t power_right, uint16_t Degree_c, bool brake, bool async, uint8_t num)
 
Drive_RESULT Set_Drive_MoveSync_Time (int16_t power_left, int16_t power_right, uint32_t Time_mS, bool brake, bool async, uint8_t num)
 
Drive_RESULT Set_Drive_MoveGyro_Func (int16_t power, int16_t Target_dri, uint8_t num)
 
Drive_RESULT Set_Drive_MoveGyro_Degs (int16_t power, int16_t Target_dri, uint16_t Degree_c, bool brake, bool async, uint8_t num)
 
Drive_RESULT Set_Drive_MoveGyro_Time (int16_t power, int16_t Target_dri, uint32_t Time_mS, bool brake, bool async, uint8_t num)
 
Drive_RESULT Set_Drive_TurnGyro (int16_t power, int16_t Target_dri, uint8_t mode, bool brake, bool async, uint8_t num)
 
Drive_RESULT Set_Drive_Brake (bool brake, uint8_t num)
 
Drive_RESULT Get_Drive_isTaskDone (uint8_t num, bool *isEnd)
 
Drive_RESULT Get_Drive_EncoderCounter (uint8_t num, int32_t &enCounter)
 
Drive_RESULT Get_Drive_Degrees (uint8_t num, int32_t &Degs)
 
void loop (void)
 
void onBtnChg (BtnChgCallback callback)
 

Public Attributes

int32_t enCounter [MatrixR4_ENCODER_NUM]
 
double imuGyroX
 
double imuGyroY
 
double imuGyroZ
 
double imuAccX
 
double imuAccY
 
double imuAccZ
 

Detailed Description

Handling the Lower MCU (STM32) communication.

Definition at line 51 of file MMLower.h.

Member Typedef Documentation

◆ BtnChgCallback

typedef void(* MMLower::BtnChgCallback) (uint8_t num, BTN_STATE newState)

Definition at line 347 of file MMLower.h.

Member Enumeration Documentation

◆ BTN_STATE

enum class MMLower::BTN_STATE
strong
Enumerator
NOKEY 
F_EDGE 
REPEAT 
PRESSED 
R_EDGE 

Definition at line 162 of file MMLower.h.

◆ BUTTON_ECHO_MODE

enum class MMLower::BUTTON_ECHO_MODE
strong
Enumerator
PASSIVE 
ACTIVE 
MAX 

Definition at line 177 of file MMLower.h.

◆ COMM_CMD

enum class MMLower::COMM_CMD
strong
Enumerator
NONE 
SET_DC_MOTOR_DIR 
SET_ENCODER_DIR 
SET_SERVO_DIR 
SET_DC_MOTOR_SPEED_RANGE 
SET_SERVO_PULSE_RANGE 
SET_SERVO_ANGLE_RANGE 
SET_BUTTON_INIT 
SET_ENCODER_ECHO_MODE 
SET_IMU_ECHO_MODE 
SET_IMU_INIT 
SET_POWER_PARAM 
SET_ENCODER_PPR_MAXSPEED 
SET_ALL_ENCODER_PPR 
SET_IMU_Calib_Data 
SET_DC_MOTOR_POWER 
SET_DC_MOTOR_SPEED 
SET_DC_MOTOR_ROTATE 
SET_ALL_DC_MOTOR_SPEED 
SET_SERVO_ANGLE 
SET_ALL_SERVO_ANGLE 
SET_MOVE_DISTANCE 
SET_ENCODER_RESET_COUNTER 
SET_STATE_LED 
SET_IMU_TO_ZERO 
SET_PID_PARAM 
SET_DC_BRAKE 
SET_ALL_DC_BRAKE 
SET_ALL_DC_MOTOR_POWER 
GET_BUTTON_STATE 
GET_BUTTONS_STATE 
GET_ENCODER_COUNTER 
GET_ALL_ENCODER_COUNTER 
GET_IMU_EULER 
GET_IMU_GYRO 
GET_IMU_ACC 
GET_POWER_INFO 
GET_ROTATE_STATE 
GET_SPEED_ALL_DC_MOTOR 
GET_IMU_ACC_NOcal 
GET_ENCODER_DEGREES 
AUTO_SEND_BUTTON_STATE 
AUTO_SEND_ENCODER_COUNTER 
AUTO_SEND_IMU_EULER 
AUTO_SEND_IMU_GYRO 
AUTO_SEND_IMU_ACC 
SET_DC_BRAKE_TYPE 
SET_DC_ALL_BRAKE_TYPE 
SET_DC_TWO_MOTOR_PARAM 
SET_DC_TWO_MoveSync_PID 
SET_DC_TWO_MoveGyro_PID 
SET_DC_TWO_TurnGyro_PID 
SET_DC_TWO_MOTOR_Reset_count 
SET_DC_TWO_MOTOR_PPR 
SET_DC_MOTOR_TYPE 
SET_Drive_Move 
SET_Drive_MoveDegs 
SET_Drive_MoveTime 
SET_Drive_MoveSync 
SET_Drive_MoveSyncDegs 
SET_Drive_MoveSyncDegsACC 
SET_Drive_MoveSyncTime 
SET_Drive_Gyro 
SET_Drive_GyroDegs 
SET_Drive_GyroTime 
SET_Drive_Turn 
SET_Drive_Brake 
GET_Task_Done_Status 
GET_Drive_Degress 
GET_Drive_Counter 
ECHO_TEST 
F_VERSION 
F_BUILD_DAY 
F_DESCRIPTOR 
READ_MODEL_INDEX 
READ_ALL_INFO 
RUN_AUTO_QC 

Definition at line 64 of file MMLower.h.

◆ COMM_STATE

enum class MMLower::COMM_STATE
strong
Enumerator
WAIT_LEAD 
WAIT_NOT_LEAD 
WAIT_CMD 
ERROR 

Definition at line 56 of file MMLower.h.

◆ DIR

enum class MMLower::DIR
strong
Enumerator
REVERSE 
FORWARD 

Definition at line 171 of file MMLower.h.

◆ Drive_RESULT

enum class MMLower::Drive_RESULT
strong
Enumerator
OK 
ERROR 
ERROR_SOFTSERIAL_BEGIN 
ERROR_INIT 
ERROR_WAIT_TIMEOUT 
ERROR_READ_TIMEOUT 
ERROR_Drive_Define 
ERROR_Drive_Param 
ERROR_Drive_IMU_idle 
ERROR_MOTOR_SPEED 
ERROR_MOTOR_POWER 

Definition at line 305 of file MMLower.h.

◆ ENCODER_ECHO_MODE

enum class MMLower::ENCODER_ECHO_MODE
strong
Enumerator
PASSIVE 
ACTIVE 
MAX 

Definition at line 184 of file MMLower.h.

◆ IMU_ACC_FSR

enum class MMLower::IMU_ACC_FSR
strong
Enumerator
_2G 
_4G 
_8G 
_16G 

Definition at line 199 of file MMLower.h.

◆ IMU_ECHO_MODE

enum class MMLower::IMU_ECHO_MODE
strong
Enumerator
PASSIVE 
TIMING 
ACTIVE 
MAX 

Definition at line 191 of file MMLower.h.

◆ IMU_FIFO

enum class MMLower::IMU_FIFO
strong
Enumerator
ENABLE 
DISABLE 

Definition at line 231 of file MMLower.h.

◆ IMU_GYRO_FSR

enum class MMLower::IMU_GYRO_FSR
strong
Enumerator
_250DPS 
_500DPS 
_1000DPS 
_2000DPS 

Definition at line 207 of file MMLower.h.

◆ IMU_ODR

enum class MMLower::IMU_ODR
strong
Enumerator
_10_SPS 
_20_SPS 
_25_SPS 
_50_SPS 
_100_SPS 
_125_SPS 
_250_SPS 
_500_SPS 
_1000_SPS 
_2000_SPS 
_4000_SPS 
_8000_SPS 

Definition at line 215 of file MMLower.h.

◆ MOVE_ACTION

enum class MMLower::MOVE_ACTION
strong
Enumerator
STOP 
FORWARD 
BACKWARD 
LEFT 
RIGHT 

Definition at line 245 of file MMLower.h.

◆ MOVE_TYPE

enum class MMLower::MOVE_TYPE
strong
Enumerator
DIFF 
OMNI 

Definition at line 237 of file MMLower.h.

◆ RESULT

enum class MMLower::RESULT
strong
Enumerator
OK 
ERROR 
ERROR_SOFTSERIAL_BEGIN 
ERROR_INIT 
ERROR_WAIT_TIMEOUT 
ERROR_READ_TIMEOUT 
ERROR_SERVO_MIN_PULSE 
ERROR_SERVO_MAX_PULSE 
ERROR_SERVO_MIN_ANGLE 
ERROR_SERVO_MAX_ANGLE 
ERROR_MODE 
ERROR_INTERVAL 
ERROR_IMU_ACC_FSR 
ERROR_IMU_GYRO_FSR 
ERROR_IMU_ODR 
ERROR_MOTOR_SPEED 
ERROR_MOTOR_POWER 
ERROR_MOTOR1_SPEED 
ERROR_MOTOR2_SPEED 
ERROR_MOTOR3_SPEED 
ERROR_MOTOR4_SPEED 
ERROR_SERVO_ANGLE 
ERROR_SERVO1_ANGLE 
ERROR_SERVO2_ANGLE 
ERROR_SERVO3_ANGLE 
ERROR_SERVO4_ANGLE 
ERROR_MOVE_ACTION 
ERROR_MOVE_SPEED 
ERROR_MOVE_ENCODER 
ERROR_QC_IMU 
ERROR_POWER_VOLT_RANGE 

Definition at line 254 of file MMLower.h.

Constructor & Destructor Documentation

◆ MMLower()

MMLower::MMLower ( uint8_t rx,
uint8_t tx,
uint32_t baudrate )

Definition at line 9 of file MMLower.cpp.

Member Function Documentation

◆ EchoTest()

MMLower::RESULT MMLower::EchoTest ( void )

Definition at line 1236 of file MMLower.cpp.

◆ Get_Drive_Degrees()

MMLower::Drive_RESULT MMLower::Get_Drive_Degrees ( uint8_t num,
int32_t & Degs )

Definition at line 2139 of file MMLower.cpp.

◆ Get_Drive_EncoderCounter()

MMLower::Drive_RESULT MMLower::Get_Drive_EncoderCounter ( uint8_t num,
int32_t & enCounter )

Definition at line 2109 of file MMLower.cpp.

◆ Get_Drive_isTaskDone()

MMLower::Drive_RESULT MMLower::Get_Drive_isTaskDone ( uint8_t num,
bool * isEnd )

Definition at line 2004 of file MMLower.cpp.

◆ Get_IMU_nancalib_acc()

MMLower::RESULT MMLower::Get_IMU_nancalib_acc ( float * accdata)

Definition at line 1029 of file MMLower.cpp.

◆ GetAllEncoderCounter()

MMLower::RESULT MMLower::GetAllEncoderCounter ( int32_t * enCounter)

Definition at line 1096 of file MMLower.cpp.

◆ GetALLEncoderSpeed()

MMLower::RESULT MMLower::GetALLEncoderSpeed ( int32_t * enSpeed)

Definition at line 1004 of file MMLower.cpp.

◆ GetAllInfo()

MMLower::RESULT MMLower::GetAllInfo ( AllInfo_t & info)

Definition at line 1361 of file MMLower.cpp.

◆ GetButtonsState()

MMLower::RESULT MMLower::GetButtonsState ( bool * btnsState)

Definition at line 981 of file MMLower.cpp.

◆ GetButtonState()

MMLower::RESULT MMLower::GetButtonState ( uint8_t num,
bool & btnState )

Definition at line 958 of file MMLower.cpp.

◆ GetEncoderCounter()

MMLower::RESULT MMLower::GetEncoderCounter ( uint8_t num,
int32_t & enCounter )

Definition at line 1074 of file MMLower.cpp.

◆ GetEncoderDegrees()

MMLower::RESULT MMLower::GetEncoderDegrees ( uint8_t num,
int32_t & enDeges )

Definition at line 1052 of file MMLower.cpp.

◆ GetFWBuildDay()

MMLower::RESULT MMLower::GetFWBuildDay ( String & date)

Definition at line 1284 of file MMLower.cpp.

◆ GetFWDescriptor()

MMLower::RESULT MMLower::GetFWDescriptor ( String & descriptor)

Definition at line 1312 of file MMLower.cpp.

◆ GetFWVersion()

MMLower::RESULT MMLower::GetFWVersion ( String & version)

Definition at line 1262 of file MMLower.cpp.

◆ GetIMUAcc()

MMLower::RESULT MMLower::GetIMUAcc ( double & x,
double & y,
double & z )

Definition at line 1167 of file MMLower.cpp.

◆ GetIMUEuler()

MMLower::RESULT MMLower::GetIMUEuler ( double & roll,
double & pitch,
double & yaw )

Definition at line 1120 of file MMLower.cpp.

◆ GetIMUGyro()

MMLower::RESULT MMLower::GetIMUGyro ( double & x,
double & y,
double & z )

Definition at line 1144 of file MMLower.cpp.

◆ GetModelIndex()

MMLower::RESULT MMLower::GetModelIndex ( uint8_t & index)

Definition at line 1340 of file MMLower.cpp.

◆ GetPowerInfo()

MMLower::RESULT MMLower::GetPowerInfo ( float & curVolt,
float & curVoltPerc )

Definition at line 1190 of file MMLower.cpp.

◆ GetRotateState()

MMLower::RESULT MMLower::GetRotateState ( uint8_t num,
bool & isEnd )

Definition at line 1214 of file MMLower.cpp.

◆ Init()

MMLower::RESULT MMLower::Init ( uint32_t timeout_ms = 1000)

Definition at line 15 of file MMLower.cpp.

◆ loop()

void MMLower::loop ( void )

Definition at line 2175 of file MMLower.cpp.

◆ onBtnChg()

void MMLower::onBtnChg ( BtnChgCallback callback)

Definition at line 2180 of file MMLower.cpp.

◆ RunAutoQC()

MMLower::RESULT MMLower::RunAutoQC ( void )

Definition at line 1391 of file MMLower.cpp.

◆ Set_Drive2Motor_PARAM()

MMLower::Drive_RESULT MMLower::Set_Drive2Motor_PARAM ( uint8_t m1_num,
uint8_t m2_num,
DIR m1_dir,
DIR m2_dir,
uint8_t num )

Definition at line 1421 of file MMLower.cpp.

◆ Set_Drive_Brake()

MMLower::Drive_RESULT MMLower::Set_Drive_Brake ( bool brake,
uint8_t num )

Definition at line 2037 of file MMLower.cpp.

◆ Set_Drive_Encode_PPR()

MMLower::Drive_RESULT MMLower::Set_Drive_Encode_PPR ( uint8_t num,
uint16_t * ppr )

Definition at line 1537 of file MMLower.cpp.

◆ Set_Drive_Motor_Type()

MMLower::Drive_RESULT MMLower::Set_Drive_Motor_Type ( uint8_t num,
uint8_t type )

Definition at line 1571 of file MMLower.cpp.

◆ Set_Drive_Move_Degs()

MMLower::Drive_RESULT MMLower::Set_Drive_Move_Degs ( int16_t power_left,
int16_t power_right,
uint16_t Degree_c,
bool brake,
bool async,
uint8_t num )

Definition at line 1645 of file MMLower.cpp.

◆ Set_Drive_Move_Func()

MMLower::Drive_RESULT MMLower::Set_Drive_Move_Func ( int16_t power_left,
int16_t power_right,
uint8_t num )

Definition at line 1608 of file MMLower.cpp.

◆ Set_Drive_Move_Time()

MMLower::Drive_RESULT MMLower::Set_Drive_Move_Time ( int16_t power_left,
int16_t power_right,
uint32_t Time_mS,
bool brake,
bool async,
uint8_t num )

Definition at line 1685 of file MMLower.cpp.

◆ Set_Drive_MoveGyro_Degs()

MMLower::Drive_RESULT MMLower::Set_Drive_MoveGyro_Degs ( int16_t power,
int16_t Target_dri,
uint16_t Degree_c,
bool brake,
bool async,
uint8_t num )

Definition at line 1879 of file MMLower.cpp.

◆ Set_Drive_MoveGyro_Func()

MMLower::Drive_RESULT MMLower::Set_Drive_MoveGyro_Func ( int16_t power,
int16_t Target_dri,
uint8_t num )

Definition at line 1842 of file MMLower.cpp.

◆ Set_Drive_MoveGyro_PID()

MMLower::RESULT MMLower::Set_Drive_MoveGyro_PID ( float Kp,
float Ki,
float Kd,
uint8_t num )

Definition at line 1482 of file MMLower.cpp.

◆ Set_Drive_MoveGyro_Time()

MMLower::Drive_RESULT MMLower::Set_Drive_MoveGyro_Time ( int16_t power,
int16_t Target_dri,
uint32_t Time_mS,
bool brake,
bool async,
uint8_t num )

Definition at line 1919 of file MMLower.cpp.

◆ Set_Drive_MoveSync_Degs()

MMLower::Drive_RESULT MMLower::Set_Drive_MoveSync_Degs ( int16_t power_left,
int16_t power_right,
uint16_t Degree_c,
bool brake,
bool async,
uint8_t num )

Definition at line 1762 of file MMLower.cpp.

◆ Set_Drive_MoveSync_Func()

MMLower::Drive_RESULT MMLower::Set_Drive_MoveSync_Func ( int16_t power_left,
int16_t power_right,
uint8_t num )

Definition at line 1725 of file MMLower.cpp.

◆ Set_Drive_MoveSync_PID()

MMLower::RESULT MMLower::Set_Drive_MoveSync_PID ( float Kp,
float Ki,
float Kd,
uint8_t num )

Definition at line 1455 of file MMLower.cpp.

◆ Set_Drive_MoveSync_Time()

MMLower::Drive_RESULT MMLower::Set_Drive_MoveSync_Time ( int16_t power_left,
int16_t power_right,
uint32_t Time_mS,
bool brake,
bool async,
uint8_t num )

Definition at line 1802 of file MMLower.cpp.

◆ Set_Drive_MoveTurn_PID()

MMLower::RESULT MMLower::Set_Drive_MoveTurn_PID ( float Kp,
float Ki,
float Kd,
uint8_t num )

Definition at line 1510 of file MMLower.cpp.

◆ Set_Drive_Reset_Count()

MMLower::Drive_RESULT MMLower::Set_Drive_Reset_Count ( uint8_t num,
bool reset )

Definition at line 2073 of file MMLower.cpp.

◆ Set_Drive_TurnGyro()

MMLower::Drive_RESULT MMLower::Set_Drive_TurnGyro ( int16_t power,
int16_t Target_dri,
uint8_t mode,
bool brake,
bool async,
uint8_t num )

Definition at line 1959 of file MMLower.cpp.

◆ SetALL_Encode_PPR()

MMLower::RESULT MMLower::SetALL_Encode_PPR ( uint16_t * ppr)

Definition at line 873 of file MMLower.cpp.

◆ SetALLDC_Type_Brake()

MMLower::RESULT MMLower::SetALLDC_Type_Brake ( uint8_t * type)

Definition at line 786 of file MMLower.cpp.

◆ SetALLDCBrake()

MMLower::RESULT MMLower::SetALLDCBrake ( void )

Definition at line 760 of file MMLower.cpp.

◆ SetAllDCMotorPower()

MMLower::RESULT MMLower::SetAllDCMotorPower ( Motors_Param_t param)

Definition at line 481 of file MMLower.cpp.

◆ SetAllDCMotorSpeed()

MMLower::RESULT MMLower::SetAllDCMotorSpeed ( Motors_Param_t param)

Definition at line 431 of file MMLower.cpp.

◆ SetAllServoAngle()

MMLower::RESULT MMLower::SetAllServoAngle ( uint16_t angle1,
uint16_t angle2,
uint16_t angle3,
uint16_t angle4 )

Definition at line 564 of file MMLower.cpp.

◆ SetDC_Type_Brake()

MMLower::RESULT MMLower::SetDC_Type_Brake ( uint8_t num,
uint8_t type )

Definition at line 816 of file MMLower.cpp.

◆ SetDCBrake()

MMLower::RESULT MMLower::SetDCBrake ( uint8_t num)

Definition at line 735 of file MMLower.cpp.

◆ SetDCMotorDir()

MMLower::RESULT MMLower::SetDCMotorDir ( uint8_t num,
DIR dir )

Definition at line 45 of file MMLower.cpp.

◆ SetDCMotorPower()

MMLower::RESULT MMLower::SetDCMotorPower ( uint8_t num,
int16_t power )

Definition at line 336 of file MMLower.cpp.

◆ SetDCMotorRotate()

MMLower::RESULT MMLower::SetDCMotorRotate ( uint8_t num,
int16_t maxSpeed,
uint16_t degree )

Definition at line 402 of file MMLower.cpp.

◆ SetDCMotorSpeed()

MMLower::RESULT MMLower::SetDCMotorSpeed ( uint8_t num,
int16_t speed )

Definition at line 369 of file MMLower.cpp.

◆ SetDCMotorSpeedRange()

MMLower::RESULT MMLower::SetDCMotorSpeedRange ( uint8_t num,
uint16_t min,
uint16_t max )

Definition at line 122 of file MMLower.cpp.

◆ SetEncode_PPR_MaxRPM()

MMLower::RESULT MMLower::SetEncode_PPR_MaxRPM ( uint8_t num,
uint16_t ppr,
uint16_t Maxspeed )

Definition at line 843 of file MMLower.cpp.

◆ SetEncoderDir()

MMLower::RESULT MMLower::SetEncoderDir ( uint8_t num,
DIR dir )

Definition at line 70 of file MMLower.cpp.

◆ SetEncoderResetCounter()

MMLower::RESULT MMLower::SetEncoderResetCounter ( uint8_t num)

Definition at line 653 of file MMLower.cpp.

◆ SetIMU_Calib_data()

MMLower::RESULT MMLower::SetIMU_Calib_data ( float * bufdata)

Definition at line 678 of file MMLower.cpp.

◆ SetIMUEchoMode()

MMLower::RESULT MMLower::SetIMUEchoMode ( IMU_ECHO_MODE mode,
uint16_t echoIntervalMs )

Definition at line 225 of file MMLower.cpp.

◆ SetIMUInit()

MMLower::RESULT MMLower::SetIMUInit ( IMU_ACC_FSR accFSR,
IMU_GYRO_FSR gyroFSR,
IMU_ODR odr,
IMU_FIFO fifo )

Definition at line 260 of file MMLower.cpp.

◆ SetIMUToZero()

MMLower::RESULT MMLower::SetIMUToZero ( void )

Definition at line 934 of file MMLower.cpp.

◆ SetMoveDistance()

MMLower::RESULT MMLower::SetMoveDistance ( MOVE_TYPE type,
MOVE_ACTION action,
uint16_t speed,
uint16_t enCounter )

Definition at line 610 of file MMLower.cpp.

◆ SetPIDParam()

MMLower::RESULT MMLower::SetPIDParam ( uint8_t num,
uint8_t pidNum,
float kp,
float ki,
float kd )

Definition at line 709 of file MMLower.cpp.

◆ SetPowerParam()

MMLower::RESULT MMLower::SetPowerParam ( float fullVolt,
float cutOffVolt,
float alarmVolt )

Definition at line 303 of file MMLower.cpp.

◆ SetServoAngle()

MMLower::RESULT MMLower::SetServoAngle ( uint8_t num,
uint16_t angle )

Definition at line 532 of file MMLower.cpp.

◆ SetServoAngleRange()

MMLower::RESULT MMLower::SetServoAngleRange ( uint8_t num,
uint16_t min,
uint16_t max )

Definition at line 188 of file MMLower.cpp.

◆ SetServoDir()

MMLower::RESULT MMLower::SetServoDir ( uint8_t num,
DIR dir )

Definition at line 96 of file MMLower.cpp.

◆ SetServoPulseRange()

MMLower::RESULT MMLower::SetServoPulseRange ( uint8_t num,
uint16_t min,
uint16_t max )

Definition at line 151 of file MMLower.cpp.

◆ SetStateLED()

MMLower::RESULT MMLower::SetStateLED ( uint8_t brightness,
uint32_t colorRGB )

Definition at line 905 of file MMLower.cpp.

Member Data Documentation

◆ enCounter

int32_t MMLower::enCounter[MatrixR4_ENCODER_NUM]

Definition at line 438 of file MMLower.h.

◆ imuAccX

double MMLower::imuAccX

Definition at line 441 of file MMLower.h.

◆ imuAccY

double MMLower::imuAccY

Definition at line 441 of file MMLower.h.

◆ imuAccZ

double MMLower::imuAccZ

Definition at line 441 of file MMLower.h.

◆ imuGyroX

double MMLower::imuGyroX

Definition at line 440 of file MMLower.h.

◆ imuGyroY

double MMLower::imuGyroY

Definition at line 440 of file MMLower.h.

◆ imuGyroZ

double MMLower::imuGyroZ

Definition at line 440 of file MMLower.h.


The documentation for this class was generated from the following files: