dev_can.h 655 B

1234567891011121314151617181920212223242526272829
  1. #ifndef __APP_CAN_H
  2. #define __APP_CAN_H
  3. #include "queue.h"
  4. #include "stm32f4xx_can.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