usart_dma_transmit_config(uartx->uart_x,USART_DENT_DISABLE); driver_dma_start(uartx->uart_tx_dma,pbuff,length); usart_flag_clear(uartx->uart_x,USART_FLAG_TC); usart_dma_transmit_config(uartx->uart_x,USART_DENT_ENABLE); usart_interrupt_enable(uartx->uart_x,USART_INT_TC); return ...
usart_dma_transmit_config(uartx->uart_x,USART_DENT_DISABLE); driver_dma_start(uartx->uart_tx_dma,pbuff,length); usart_flag_clear(uartx->uart_x,USART_FLAG_TC); usart_dma_transmit_config(uartx->uart_x,USART_DENT_ENABLE); usart_interrupt_enable(uartx->uart_x,USART_INT_TC); return ...
usart_dma_transmit_config(uartx->uart_x,USART_DENT_ENABLE); usart_interrupt_enable(uartx->uart_x,USART_INT_TC); return uart_state; } 16.4.2串口DMA接收函数 在driver_uart.c中定义了串口DMA接收函数driver_uart_dma_receive: C Drv_Err driver_uart_dma_receive(typdef_uart_struct *uartx,uint8...
最后配置USART初始化:GD32全系列MCU中USART外设配置基本相同,在本例程中,USART既可以发送可以接收,GD32标准库提供了USART各项初始化的函数接口,其初始化函数接口说明如USART函数说明列表所示。因USART使用了C函数的printf函数,所以重定向了printf到USART,还得在KEIL的魔术棒Target配置下打开” Use MicroLIB”。 代码清单 ...
usart_transmit_config(USART2,USART_TRANSMIT_ENABLE);//发送使能 usart_receive_config(USART2,USART_...
dma_channel_enable(DMA_CH2); /* USART DMA enable for transmission */ usart_dma_transmit_config(USART0, USART_DENT_ENABLE); /* enable DMA channel1 */ dma_channel_enable(DMA_CH1); } void uart0_init(uint32_t baud) { /* enable COM GPIO clock */ ...
usart_transmit_config(USART1, USART_TRANSMIT_ENABLE);usart_enable(USART1);/* enable DMA0 */ rc...
usart_parity_config(BLE_UART, USART_PM_NONE); // 校验位:NONE usart_word_length_set(BLE_UART, USART_WL_8BIT); // 数据位:8 usart_stop_bit_set(BLE_UART, USART_STB_1BIT); // 停止位:1 usart_receive_config(BLE_UART, USART_RECEIVE_ENABLE); // 打开串口接收功能 ...
2.7 usart_hardware_flow_cts_config ctsconfig:使能/除能CTS,详细列表如下: 2.8 usart_transmit_config txconfig:使能/失能USART发送器,详细列表如下: 2.9 usart_receive_config rxconfig:使能/失能USART接收器,详细列表如下: 2.10 usart_enable 2.11 usart_data_transmit ...
usart_transmit_config(USART0, USART_TRANSMIT_ENABLE); // 发送使能 usart_dma_receive_config(...