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 
11 #ifndef __DRV_CAN_H__
12 #define __DRV_CAN_H__
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include <rtdevice.h>
19 #include <rtthread.h>
20 #include "drv_common.h"
21 
22 struct at32_baud_rate
23 {
24     rt_uint32_t baud_rate;
25     can_baudrate_type baud_struct;
26 };
27 
28 struct can_config
29 {
30     can_type *can_x;
31     can_base_type base_init_struct;
32     can_baudrate_type baudrate_init_struct;
33     can_filter_init_type filter_init_struct;
34 };
35 
36 /* at32 can device */
37 struct at32_can
38 {
39     char *name;
40     struct can_config config;
41     struct rt_can_device device;     /* inherit from can device */
42 };
43 
44 int rt_hw_can_init(void);
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
50 #endif /*__DRV_CAN_H__ */
51 
52 /************************** end of file ******************/
53