未验证 提交 c17d5d50 编写于 作者: 斌cazure's avatar 斌cazure 提交者: GitHub

[bsp][ch32v307] 添加can驱动 (#6484)

CH32V307 添加can驱动。
CAN1和CAN2均可以使用,而且调整好波特率
上级 f7be5fc8
......@@ -26,6 +26,9 @@ if GetDepend('SOC_RISCV_FAMILY_CH32'):
if GetDepend('BSP_USING_IWDT'):
src += ['drv_iwdt.c']
if GetDepend('BSP_USING_CAN'):
src += ['drv_can.c']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
......
此差异已折叠。
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-06-21 chenbin the first version
*/
#ifndef __DRV_CAN_H__
#define __DRV_CAN_H__
#ifdef __cplusplus
extern "C"
{
#endif
int rt_hw_can_init(void);
#ifdef __cplusplus
}
#endif
#endif /*__DRV_CAN_H__ */
/************************** end of file ******************/
......@@ -152,7 +152,20 @@ menu "On-chip Peripheral Drivers"
select RT_USING_WDT
select LSI_VALUE
default n
menuconfig BSP_USING_CAN
bool "Enable CAN"
default n
select RT_USING_CAN
if BSP_USING_CAN
config BSP_USING_CAN1
bool "using CAN1"
default n
config BSP_USING_CAN2
bool "using CAN2"
default n
endif
endmenu
menu "Onboard Peripheral Drivers"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册