can_debug.h 768 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef CAN_DEBUG_H
  2. #define CAN_DEBUG_H
  3. #include "stdint.h"
  4. #include "rkfifo.h"
  5. #include "soft_can.h"
  6. #define MAX_ID_NUM 40
  7. extern rkfifo_t candebug_rkfifo;
  8. typedef struct
  9. {
  10. uint32_t ID;
  11. uint8_t len;
  12. uint8_t connect_status;
  13. uint8_t send_fre;
  14. uint8_t data[8];
  15. uint32_t ID_time;
  16. }Debug_ID_data;
  17. typedef struct
  18. {
  19. Debug_ID_data ID_buf[MAX_ID_NUM];
  20. uint16_t Total_Dev_num; //总设备数
  21. bool Open_flag;
  22. int (*Len)(uint8_t i);
  23. }Debug_buf;
  24. extern Debug_buf debug_can;
  25. void seek_can_debug_buf_adr(void);
  26. void Can_send_debug_to_app(void);
  27. void put_candata_to_rkfifo_rx(CAN_RxHeaderTypeDef rxhead,uint8_t *data);
  28. void put_candata_to_rkfifo_tx(CAN_TxHeaderTypeDef txhead,uint8_t *data);
  29. void check_can_dev_connect(void);
  30. #endif