communication.h 515 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _COMMUNICATION_H__
  2. #define _COMMUNICATION_H__
  3. typedef enum {
  4. Cmd_Start = 0x1, //start/stop
  5. Cmd_Ready, //ready / unready
  6. Cmd_Hall_Cali,
  7. }motor_cmd_t;
  8. #pragma pack (push,1)
  9. typedef struct {
  10. u8 start; //0x1=start, 0x00=stop
  11. u16 speed; //目标速度
  12. s16 current;//启动电流
  13. u16 ramp_time;//斜波时间
  14. }cmd_start_t;
  15. typedef struct {
  16. u8 ready; //0x1=ready, 0x00=unready
  17. }cmd_ready_t;
  18. typedef struct {
  19. u8 start;
  20. s16 current;
  21. }cmd_hall_cali_t;
  22. #pragma pack(pop)
  23. #endif /* _COMMUNICATION_H__ */