can_id_deal.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef __DEV_CAN_ID_H
  2. #define __DEV_CAN_ID_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifdef __DEV_CAN_ID_H_GLOBAL
  7. #define __DEV_CAN_ID_H_EXTERN
  8. #else
  9. #define __DEV_CAN_ID_H_EXTERN extern
  10. #endif
  11. /************************************************************************************************
  12. * Version *
  13. ************************************************************************************************/
  14. /************************************************************************************************
  15. * How to use *
  16. ************************************************************************************************/
  17. /************************************************************************************************
  18. * Enable config *
  19. ************************************************************************************************/
  20. /************************************************************************************************
  21. * Includes *
  22. ************************************************************************************************/
  23. #include "can_interface.h"
  24. #include <stdint.h>
  25. /************************************************************************************************
  26. * Defines *
  27. ************************************************************************************************/
  28. extern uint32_t g_ps;
  29. extern uint32_t g_can_id;
  30. extern uint32_t g_can_ota_id;
  31. #define CAN_IAP 0xDF
  32. #define CAN_CALI 0xFF
  33. uint32_t get_new_can_id(uint8_t pf);
  34. uint32_t set_new_can_id(uint16_t pgn);
  35. uint32_t get_ota_id(uint8_t pf);
  36. uint8_t can_id_set(pdu_tag rec_msg);
  37. /************************************************************************************************
  38. * Defines *
  39. ************************************************************************************************/
  40. #ifdef __cplusplus
  41. };
  42. #endif
  43. #endif // __DEV_CAN_ID_H