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