|
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_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
,
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
, AUTO_SEND_BUTTON_STATE = 0x31
, AUTO_SEND_ENCODER_COUNTER
, AUTO_SEND_IMU_EULER
,
AUTO_SEND_IMU_GYRO
, AUTO_SEND_IMU_ACC
, 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
} |
|
typedef void(*) | BtnChgCallback(uint8_t num, BTN_STATE newState) |
|
|
| 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 | 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 | 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 (int16_t &roll, int16_t &pitch, int16_t &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 | 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) |
|
void | loop (void) |
|
void | onBtnChg (BtnChgCallback callback) |
|
Handling the Lower MCU (STM32) communication.
Definition at line 51 of file MMLower.h.