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

CH32V307 添加can驱动。
CAN1和CAN2均可以使用,而且调整好波特率
This commit is contained in:
chenbin182 2022-10-09 10:32:29 +08:00 committed by GitHub
parent f7be5fc84b
commit c17d5d509f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1205 additions and 1 deletions

View File

@ -27,6 +27,9 @@ if GetDepend('SOC_RISCV_FAMILY_CH32'):
if GetDepend('BSP_USING_IWDT'): if GetDepend('BSP_USING_IWDT'):
src += ['drv_iwdt.c'] src += ['drv_iwdt.c']
if GetDepend('BSP_USING_CAN'):
src += ['drv_can.c']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Return('group') Return('group')

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
/*
* 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 ******************/

View File

@ -153,6 +153,19 @@ menu "On-chip Peripheral Drivers"
select LSI_VALUE select LSI_VALUE
default n 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 endmenu
menu "Onboard Peripheral Drivers" menu "Onboard Peripheral Drivers"