dev_can.h 651 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __APP_CAN_H
  2. #define __APP_CAN_H
  3. #include "hal_conf.h"
  4. #include "queue.h"
  5. #define CAN_PGN_PF 0xFFFF00
  6. #define CAN_PGN_PS 0xFF00
  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. uint8_t push_can_message_to_queue(uint32_t id, uint8_t len, uint8_t *p_data);
  21. #endif // __APP_CAN_H