dev_can.h 554 B

12345678910111213141516171819202122232425262728
  1. #ifndef __APP_CAN_H
  2. #define __APP_CAN_H
  3. #include "hal_conf.h"
  4. #include "queue.h"
  5. #define CAN_PGN_PF 0xFF
  6. #define CAN_PGN_PS 0xFF
  7. extern uint8_t recv_can_id;
  8. typedef struct
  9. {
  10. uint32_t id;
  11. void (*p_func)(pdu_tag);
  12. } can_rx_tab;
  13. // #define ARR_SIZE(a) sizeof(a) / a[0]
  14. #define ARR_SIZE(a) sizeof(a) / sizeof((a)[0])
  15. // #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
  16. void can_rx_callback(CanRxMsg rx_message);
  17. void can_tx_callback();
  18. void can_process(void);
  19. void dev_can_network_init();
  20. #endif // __APP_CAN_H