drv_fdcan.h 991 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-02-24 heyuan the first version
  9. * 2020-08-17 malongwei Fix something
  10. */
  11. #ifndef __DRV_FDCAN_H__
  12. #define __DRV_FDCAN_H__
  13. #include <board.h>
  14. #include <rtdevice.h>
  15. #if defined(RT_USING_CAN) && defined(RT_CAN_USING_CANFD)
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. typedef struct
  20. {
  21. const char *name;
  22. FDCAN_HandleTypeDef fdcanHandle;
  23. FDCAN_RxHeaderTypeDef RxHeader;
  24. FDCAN_TxHeaderTypeDef TxHeader;
  25. uint8_t u8RxDataBuffer[8];
  26. uint8_t u8TxDataBuffer[8];
  27. FDCAN_FilterTypeDef FilterConfig; /*FDCAN filter*/
  28. struct rt_can_device device; /* inherit from can device */
  29. } stm32_fdcan_t;
  30. typedef struct {
  31. uint32_t u32Baudrate;
  32. struct rt_can_bit_timing cam_bit_timing;
  33. }stm32_fdcan_timing_t;
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /* RT_USING_CAN */
  38. #endif /* __DRV_FDCAN_H__ */