未验证 提交 d06f9ac9 编写于 作者: lymzzyh's avatar lymzzyh 提交者: GitHub

Merge pull request #1716 from xeonxu/stm32hal_can

[STM32 BSP]CAN driver for stm32f4xx HAL.
......@@ -308,7 +308,17 @@ config RT_USING_UART2
config RT_USING_UART6
bool "Using UART6"
default n
if RT_USING_CAN
config USING_BXCAN1
bool "Enable CAN1 RX:PD0 TX:PD1. Do not select HDR."
default n
config USING_BXCAN2
bool "Enable CAN2 RX:PB12 TX:PB6. Do not select HDR."
default n
endif
if RT_USING_SPI
config RT_USING_SPI1
......
......@@ -35,7 +35,10 @@ if GetDepend(['RT_USING_USB_HOST']):
src += ['drv_usbh.c']
if GetDepend(['RT_USING_I2C']):
src += ['drv_i2c.c']
src += ['drv_i2c.c']
if GetDepend(['RT_USING_CAN']):
src += ['drv_can.c']
if GetDepend(['RT_USING_PWM']):
src += ['drv_pwm.c']
......
此差异已折叠。
/*
* File : drv_can.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2018, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2018-08-05 Xeon Xu the first version
*/
#ifndef __CAN_H__
#define __CAN_H__
#ifdef __cplusplus
extern "C" {
#endif
extern int hw_can_init(void);
#ifdef __cplusplus
}
#endif
#endif /*__CAN_H__ */
......@@ -52,7 +52,9 @@ extern "C" {
*/
#define HAL_MODULE_ENABLED
/* #define HAL_ADC_MODULE_ENABLED */
/* #define HAL_CAN_MODULE_ENABLED */
#ifdef RT_USING_CAN
#define HAL_CAN_MODULE_ENABLED
#endif
/* #define HAL_CRC_MODULE_ENABLED */
/* #define HAL_CRYP_MODULE_ENABLED */
/* #define HAL_DAC_MODULE_ENABLED */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册