未验证 提交 8d309ed5 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #3343 from chengxiaohu/master

Add DMA for ADC driver, and other little update.
...@@ -157,12 +157,12 @@ extern "C" { ...@@ -157,12 +157,12 @@ extern "C" {
#define SPI1_RX_DMA_INSTANCE DMA2_Stream0 #define SPI1_RX_DMA_INSTANCE DMA2_Stream0
#define SPI1_RX_DMA_CHANNEL DMA_CHANNEL_3 #define SPI1_RX_DMA_CHANNEL DMA_CHANNEL_3
#define SPI1_RX_DMA_IRQ DMA2_Stream0_IRQn #define SPI1_RX_DMA_IRQ DMA2_Stream0_IRQn
#elif defined(BSP_SPI4_TX_USING_DMA) && !defined(SPI4_TX_DMA_INSTANCE) #elif defined(BSP_SPI4_RX_USING_DMA) && !defined(SPI4_RX_DMA_INSTANCE)
#define SPI4_DMA_TX_IRQHandler DMA2_Stream0_IRQHandler #define SPI4_DMA_RX_IRQHandler DMA2_Stream0_IRQHandler
#define SPI4_TX_DMA_RCC RCC_AHB1ENR_DMA2EN #define SPI4_RX_DMA_RCC RCC_AHB1ENR_DMA2EN
#define SPI4_TX_DMA_INSTANCE DMA2_Stream0 #define SPI4_RX_DMA_INSTANCE DMA2_Stream0
#define SPI4_TX_DMA_CHANNEL DMA_CHANNEL_4 #define SPI4_RX_DMA_CHANNEL DMA_CHANNEL_4
#define SPI4_TX_DMA_IRQ DMA2_Stream0_IRQn #define SPI4_RX_DMA_IRQ DMA2_Stream0_IRQn
#endif #endif
/* DMA2 stream1 */ /* DMA2 stream1 */
...@@ -208,12 +208,12 @@ extern "C" { ...@@ -208,12 +208,12 @@ extern "C" {
#define SPI1_TX_DMA_INSTANCE DMA2_Stream3 #define SPI1_TX_DMA_INSTANCE DMA2_Stream3
#define SPI1_TX_DMA_CHANNEL DMA_CHANNEL_3 #define SPI1_TX_DMA_CHANNEL DMA_CHANNEL_3
#define SPI1_TX_DMA_IRQ DMA2_Stream3_IRQn #define SPI1_TX_DMA_IRQ DMA2_Stream3_IRQn
#elif defined(BSP_SPI4_TX_USING_DMA) && !defined(SPI4_TX_DMA_INSTANCE) #elif defined(BSP_SPI4_RX_USING_DMA) && !defined(SPI4_RX_DMA_INSTANCE)
#define SPI4_DMA_TX_IRQHandler DMA2_Stream3_IRQHandler #define SPI4_DMA_RX_IRQHandler DMA2_Stream3_IRQHandler
#define SPI4_TX_DMA_RCC RCC_AHB1ENR_DMA2EN #define SPI4_RX_DMA_RCC RCC_AHB1ENR_DMA2EN
#define SPI4_TX_DMA_INSTANCE DMA2_Stream3 #define SPI4_RX_DMA_INSTANCE DMA2_Stream3
#define SPI4_TX_DMA_CHANNEL DMA_CHANNEL_5 #define SPI4_RX_DMA_CHANNEL DMA_CHANNEL_5
#define SPI4_TX_DMA_IRQ DMA2_Stream3_IRQn #define SPI4_RX_DMA_IRQ DMA2_Stream3_IRQn
#endif #endif
/* DMA2 stream4 */ /* DMA2 stream4 */
......
...@@ -61,6 +61,17 @@ extern "C" { ...@@ -61,6 +61,17 @@ extern "C" {
#endif /* PWM5_CONFIG */ #endif /* PWM5_CONFIG */
#endif /* BSP_USING_PWM5 */ #endif /* BSP_USING_PWM5 */
#ifdef BSP_USING_PWM9
#ifndef PWM9_CONFIG
#define PWM9_CONFIG \
{ \
.tim_handle.Instance = TIM9, \
.name = "pwm9", \
.channel = 0 \
}
#endif /* PWM9_CONFIG */
#endif /* BSP_USING_PWM9 */
#ifdef BSP_USING_PWM12 #ifdef BSP_USING_PWM12
#ifndef PWM12_CONFIG #ifndef PWM12_CONFIG
#define PWM12_CONFIG \ #define PWM12_CONFIG \
......
...@@ -27,6 +27,17 @@ extern "C" { ...@@ -27,6 +27,17 @@ extern "C" {
} }
#endif /* TIM_DEV_INFO_CONFIG */ #endif /* TIM_DEV_INFO_CONFIG */
#ifdef BSP_USING_TIM3
#ifndef TIM3_CONFIG
#define TIM3_CONFIG \
{ \
.tim_handle.Instance = TIM3, \
.tim_irqn = TIM3_IRQn, \
.name = "timer3", \
}
#endif /* TIM3_CONFIG */
#endif /* BSP_USING_TIM3 */
#ifdef BSP_USING_TIM11 #ifdef BSP_USING_TIM11
#ifndef TIM11_CONFIG #ifndef TIM11_CONFIG
#define TIM11_CONFIG \ #define TIM11_CONFIG \
......
...@@ -254,6 +254,11 @@ void turn_on_lcd_backlight(void) ...@@ -254,6 +254,11 @@ void turn_on_lcd_backlight(void)
rt_pin_write(LCD_DISP_GPIO_NUM, PIN_HIGH); rt_pin_write(LCD_DISP_GPIO_NUM, PIN_HIGH);
rt_pin_write(LCD_BL_GPIO_NUM, PIN_HIGH); rt_pin_write(LCD_BL_GPIO_NUM, PIN_HIGH);
}
#else
void turn_on_lcd_backlight(void)
{
} }
#endif #endif
......
...@@ -712,6 +712,9 @@ menu "Using USB" ...@@ -712,6 +712,9 @@ menu "Using USB"
config RT_VCOM_TASK_STK_SIZE config RT_VCOM_TASK_STK_SIZE
int "virtual com thread stack size" int "virtual com thread stack size"
default 512 default 512
config RT_CDC_RX_BUFSIZE
int "virtual com rx buffer size"
default 128
config RT_VCOM_TX_USE_DMA config RT_VCOM_TX_USE_DMA
bool "Enable to use dma for vcom tx" bool "Enable to use dma for vcom tx"
default n default n
......
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
#define VCOM_TX_TIMEOUT 1000 #define VCOM_TX_TIMEOUT 1000
#endif /*RT_VCOM_TX_TIMEOUT*/ #endif /*RT_VCOM_TX_TIMEOUT*/
#ifdef RT_CDC_RX_BUFSIZE
#define CDC_RX_BUFSIZE RT_CDC_RX_BUFSIZE
#else
#define CDC_RX_BUFSIZE 128 #define CDC_RX_BUFSIZE 128
#endif
#define CDC_MAX_PACKET_SIZE 64 #define CDC_MAX_PACKET_SIZE 64
#define VCOM_DEVICE "vcom" #define VCOM_DEVICE "vcom"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册