protocol.h 377 B

12345678910111213141516171819202122
  1. #ifndef _PROTOCOL_H__
  2. #define _PROTOCOL_H__
  3. #include "libs/types.h"
  4. #define Command_Start 0x01
  5. #define Command_Stop 0x02
  6. #define Command_Hall_Detect 0x03
  7. #pragma pack (push,1)
  8. typedef struct {
  9. u8 indentify; //if can, this is can addr
  10. }Frame_Head_t;
  11. typedef struct {
  12. Frame_Head_t head;
  13. u8 command;
  14. u8 payload[0];
  15. }Frame_t;
  16. #pragma pack(pop)
  17. #endif /*_PROTOCOL_H__ */