can_board.h 1001 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __CAN_BOARD_H__
  2. #define __CAN_BOARD_H__
  3. #define CAN_BOARD_NUM 1 // can板数量
  4. #define CHIP_ID_SIZE 4
  5. typedef struct
  6. {
  7. u8 type;
  8. char* name;
  9. }CAN_BOARD_NAME;
  10. struct can_board_res
  11. {
  12. u32 chip_id[CHIP_ID_SIZE]; // 子板标识
  13. u8 type;
  14. u8 given_slot; // 已下发卡槽号
  15. u8 slot; //板卡槽位地址
  16. u8 file_have; //
  17. u8 can_ch; //can总线通道
  18. s8 name[32];// 名字
  19. };
  20. extern struct can_board_res can_board[CAN_BOARD_NUM];
  21. extern u8 can_board_enable;
  22. extern void Hex2Str( const char *sSrc, char *sDest, int nSrcLen );
  23. int HexStr2Bytes(const char* pSrc, unsigned char* pDst, int nSrcLength);
  24. u32 reversebytes(u32 value);
  25. int equ_init_can_file_res(void);
  26. extern struct can_board_res* equ_get_can_slot(u8 give_slot, u8 type, u8* chip_id, u8 id_size);
  27. u8 is_can_slot_valid(u8 i);
  28. u8 get_can_slot(u8 i);
  29. void can_id_printf(void);
  30. char* get_can_name(u8 type);
  31. int get_can_type_from_slot(u8 slot);
  32. void can_brd_error_set(void);
  33. extern void can_brd_error_clear(u8 slot);
  34. #endif