| 12345678910111213141516171819202122232425262728293031 |
- #ifndef _COMMUNICATION_H__
- #define _COMMUNICATION_H__
- typedef enum {
- Cmd_Start = 0x1, //start/stop
- Cmd_Ready, //ready / unready
- Cmd_Hall_Cali,
- }motor_cmd_t;
- #pragma pack (push,1)
- typedef struct {
- u8 start; //0x1=start, 0x00=stop
- u16 speed; //目标速度
- s16 current;//启动电流
- u16 ramp_time;//斜波时间
- }cmd_start_t;
- typedef struct {
- u8 ready; //0x1=ready, 0x00=unready
- }cmd_ready_t;
- typedef struct {
- u8 start;
- s16 current;
- }cmd_hall_cali_t;
- #pragma pack(pop)
- #endif /* _COMMUNICATION_H__ */
|