drv_can.h 872 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. * 2021-10-29 mazhiyuan first version
  9. */
  10. #ifndef __DRV_CAN_H__
  11. #define __DRV_CAN_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include <rthw.h>
  15. #include <drv_common.h>
  16. #include <drv_config.h>
  17. #include <hal_data.h>
  18. /* renesas config class */
  19. struct ra_can_config
  20. {
  21. const char *name;
  22. int num_of_mailboxs;
  23. can_ctrl_t *const p_api_ctrl;
  24. can_cfg_t const *const p_cfg;
  25. };
  26. struct ra_can
  27. {
  28. struct rt_can_device can_dev;
  29. struct ra_can_config *config;
  30. can_callback_args_t *callback_args;
  31. };
  32. struct ra_baud_rate_tab
  33. {
  34. rt_uint32_t baud_rate;
  35. rt_uint32_t sjw;
  36. rt_uint32_t ts1;
  37. rt_uint32_t ts2;
  38. rt_uint32_t prescaler;
  39. };
  40. int rt_hw_can_init(void);
  41. #endif