drv_can.h 920 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-05-16 shelton first version
  9. */
  10. #ifndef __DRV_CAN_H__
  11. #define __DRV_CAN_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <rtdevice.h>
  16. #include <rtthread.h>
  17. #include "drv_common.h"
  18. struct at32_baud_rate
  19. {
  20. rt_uint32_t baud_rate;
  21. can_baudrate_type baud_struct;
  22. };
  23. struct can_config
  24. {
  25. can_type *can_x;
  26. can_base_type base_init_struct;
  27. can_baudrate_type baudrate_init_struct;
  28. can_filter_init_type filter_init_struct;
  29. };
  30. /* at32 can device */
  31. struct at32_can
  32. {
  33. char *name;
  34. struct can_config config;
  35. struct rt_can_device device; /* inherit from can device */
  36. };
  37. int rt_hw_can_init(void);
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #endif /*__DRV_CAN_H__ */
  42. /************************** end of file ******************/