本文整理汇总了C++中HAL_UART_DeInit函数的典型用法代码示例。如果您正苦于以下问题:C++ HAL_UART_DeInit函数的具体用法?C++ HAL_UART_DeInit怎么用?C++ HAL_UART_DeInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HAL_UART_DeInit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: USBD_CDC_DeInit
static uint8_t USBD_CDC_DeInit (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
{
USBD_CDC_HandleTypeDef *hcdc = context;
unsigned index;
for (index = 0; index < NUM_OF_CDC_UARTS; index++,hcdc++)
{
/* Close EP IN */
USBD_LL_CloseEP(pdev, parameters[index].data_in_ep);
/* Close EP OUT */
USBD_LL_CloseEP(pdev, parameters[index].data_out_ep);
/* Close Command IN EP */
USBD_LL_CloseEP(pdev, parameters[index].command_ep);
/* DeInitialize the UART peripheral */
if (hcdc->UartHandle.Instance)
if(HAL_UART_DeInit(&hcdc->UartHandle) != HAL_OK)
{
/* Initialization Error */
Error_Handler();
}
}
return USBD_OK;
}
示例2: _uart_close
/*#####################################################*/
bool _uart_close(Uart_t *UartSettings)
{
HAL_UART_DeInit((UART_HandleTypeDef*)UartSettings->udata);
if(UartSettings->udata)
free(UartSettings->udata);
return true;
}
示例3: uart_deinit
void uart_deinit(pyb_uart_obj_t *uart_obj) {
uart_obj->is_enabled = false;
UART_HandleTypeDef *uart = &uart_obj->uart;
HAL_UART_DeInit(uart);
if (uart->Instance == USART1) {
__USART1_FORCE_RESET();
__USART1_RELEASE_RESET();
__USART1_CLK_DISABLE();
} else if (uart->Instance == USART2) {
__USART2_FORCE_RESET();
__USART2_RELEASE_RESET();
__USART2_CLK_DISABLE();
} else if (uart->Instance == USART3) {
__USART3_FORCE_RESET();
__USART3_RELEASE_RESET();
__USART3_CLK_DISABLE();
} else if (uart->Instance == UART4) {
__UART4_FORCE_RESET();
__UART4_RELEASE_RESET();
__UART4_CLK_DISABLE();
} else if (uart->Instance == USART6) {
__USART6_FORCE_RESET();
__USART6_RELEASE_RESET();
__USART6_CLK_DISABLE();
}
}
示例4: SleepMode
void SleepMode(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
/* Disable all GPIOs to reduce power */
MX_GPIO_Deinit();
/* Configure User push-button as external interrupt generator */
__HAL_RCC_GPIOC_CLK_ENABLE();
GPIO_InitStruct.Pin = B1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
HAL_UART_DeInit(&huart2);
/* Suspend Tick increment to prevent wakeup by Systick interrupt.
Otherwise the Systick interrupt will wake up the device within 1ms (HAL time base) */
HAL_SuspendTick();
__HAL_RCC_PWR_CLK_ENABLE();
/* Request to enter SLEEP mode */
HAL_PWR_EnterSLEEPMode(0, PWR_SLEEPENTRY_WFI);
/* Resume Tick interrupt if disabled prior to sleep mode entry*/
HAL_ResumeTick();
/* Reinitialize GPIOs */
MX_GPIO_Init();
/* Reinitialize UART2 */
MX_USART2_UART_Init();
}
示例5: CDC_Itf_DeInit
/**
* @brief CDC_Itf_DeInit
* DeInitializes the CDC media low layer
* @param None
* @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
*/
static int8_t CDC_Itf_DeInit(void)
{
/* DeInitialize the UART peripheral */
if(HAL_UART_DeInit(&UartHandle) != HAL_OK)
{
/* Initialization Error */
Error_Handler();
}
return (USBD_OK);
}
示例6: Debug_UARTConfig
void Debug_UARTConfig() {
UARTHandle.Instance = USART2;
UARTHandle.Init.BaudRate = UART_BAUDRATE;
UARTHandle.Init.WordLength = UART_WORDLENGTH_8B;
UARTHandle.Init.StopBits = UART_STOPBITS_1;
UARTHandle.Init.Parity = UART_PARITY_NONE;
UARTHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UARTHandle.Init.Mode = UART_MODE_TX_RX;
UARTHandle.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
HAL_UART_DeInit(&UARTHandle);
HAL_UART_Init(&UARTHandle);
}
示例7: prvDisableRs232Interface
/**
* @brief Disables the RS232 interface
* @param None
* @retval None
*/
static void prvDisableRs232Interface()
{
HAL_NVIC_DisableIRQ(UART4_IRQn);
HAL_UART_DeInit(&UART_Handle);
__UART4_CLK_DISABLE();
xSemaphoreGive(xSemaphore);
prvRxBuffer1CurrentIndex = 0;
prvRxBuffer1Count = 0;
prvRxBuffer1State = BUFFERState_Writing;
prvRxBuffer2CurrentIndex = 0;
prvRxBuffer2Count = 0;
prvRxBuffer2State = BUFFERState_Writing;
}
示例8: HAL_UART_DeInit
void HardwareSerial::begin(uint32_t baud) {
HAL_StatusTypeDef status;
if ( huart6.Init.BaudRate != baud ) {
HAL_UART_DeInit(&huart6);
huart6.Init.BaudRate = baud;
HAL_UART_Init(&huart6);
}
this->tx_in_progress = false;
this->rx_buffer_bytes_available = 0;
this->rx_buffer_index = 0;
receive_request_pending = false;
status = HAL_UART_Receive_IT(&huart6, &this->rx_buffer[this->rx_buffer_index], 1);
}
示例9: prvDisableUart1Interface
/**
* @brief Disables the UART1 interface
* @param None
* @retval None
*/
static void prvDisableUart1Interface()
{
HAL_NVIC_DisableIRQ(USART1_IRQn);
HAL_UART_DeInit(&UART_Handle);
__USART1_CLK_DISABLE();
xSemaphoreGive(xSemaphore);
prvRxBuffer1CurrentIndex = 0;
prvRxBuffer1Count = 0;
prvRxBuffer1State = BUFFERState_Writing;
prvRxBuffer2CurrentIndex = 0;
prvRxBuffer2Count = 0;
prvRxBuffer2State = BUFFERState_Writing;
prvChannelIsEnabled = false;
}
示例10: PX4FlowPortInit
void PX4FlowPortInit(void)
{
//*******************************************************
//配置USART发送与接受
__USART1_CLK_ENABLE();
PX4_UartHandle.Instance = USART1;
PX4_UartHandle.Init.BaudRate = 115200;
PX4_UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
PX4_UartHandle.Init.StopBits = UART_STOPBITS_1;
PX4_UartHandle.Init.Parity = UART_PARITY_NONE;
PX4_UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
PX4_UartHandle.Init.Mode = UART_MODE_TX_RX;
PX4_UartHandle.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_RXOVERRUNDISABLE_INIT;
PX4_UartHandle.AdvancedInit.OverrunDisable=UART_ADVFEATURE_OVERRUN_DISABLE;//关闭OverRun
HAL_UART_DeInit(&PX4_UartHandle);//卸载USART1
HAL_UART_Init(&PX4_UartHandle);//装载USART1
/* NVIC for USART, to catch the RX complete */
/*##-4- Put UART peripheral in reception process ###########################*/
/* Enable the UART Data Register not empty Interrupt */
__HAL_UART_ENABLE_IT(&PX4_UartHandle, UART_IT_RXNE);
}
示例11: uart_init_peripheral
static int uart_init_peripheral(void)
{
__HAL_RCC_USART2_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
UARThandle.Instance = UART_INSTANCE;
UARThandle.Init.BaudRate = UART_BAUDRATE;
UARThandle.Init.WordLength = UART_WORDLENGTH_8B;
UARThandle.Init.StopBits = UART_STOPBITS_1;
UARThandle.Init.Parity = UART_PARITY_NONE;
UARThandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UARThandle.Init.OverSampling = UART_OVERSAMPLING_8;
UARThandle.Init.Mode = UART_MODE_TX_RX;
DMAhandle_TX.Instance = DMA1_Stream6;
DMAhandle_TX.Init.Channel = DMA_CHANNEL_4;
DMAhandle_TX.Init.Direction = DMA_MEMORY_TO_PERIPH;
DMAhandle_TX.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
DMAhandle_TX.Init.MemBurst = DMA_MBURST_SINGLE;
DMAhandle_TX.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
DMAhandle_TX.Init.MemInc = DMA_MINC_ENABLE;
DMAhandle_TX.Init.Mode = DMA_NORMAL;
DMAhandle_TX.Init.PeriphBurst = DMA_PBURST_SINGLE;
DMAhandle_TX.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
DMAhandle_TX.Init.PeriphInc = DMA_PINC_DISABLE;
DMAhandle_TX.Init.Priority = DMA_PRIORITY_LOW;
DMAhandle_RX = DMAhandle_TX;
DMAhandle_RX.Instance = DMA1_Stream5;
DMAhandle_RX.Init.Channel = DMA_CHANNEL_4;
DMAhandle_RX.Init.Direction = DMA_PERIPH_TO_MEMORY;
DMAhandle_RX.Init.Mode = DMA_CIRCULAR;
UARThandle.hdmatx = &DMAhandle_TX;
UARThandle.hdmarx = &DMAhandle_RX;
HAL_UART_DeInit(&UARThandle);
HAL_UART_Init(&UARThandle);
UART_INSTANCE->BRR = (2u << 4u) | (5u); /* Baudrate = 2000000 with SYSCLK=168MHz,
* HAL is not very good at figuring this number out... */
HAL_DMA_DeInit(&DMAhandle_TX);
HAL_DMA_Init(&DMAhandle_TX);
HAL_DMA_DeInit(&DMAhandle_RX);
HAL_DMA_Init(&DMAhandle_RX);
NVIC_SetPriority(DMA1_Stream6_IRQn, UART_DMA_TX_IRQ_PRIO);
HAL_NVIC_EnableIRQ(DMA1_Stream6_IRQn);
NVIC_SetPriority(DMA1_Stream5_IRQn, UART_DMA_RX_IRQ_PRIO);
HAL_NVIC_EnableIRQ(DMA1_Stream5_IRQn);
/* Use uart data register as peripheral destination for TX */
DMAhandle_TX.Instance->PAR = (uint32_t) &(UARThandle.Instance->DR);
/* Set source and destination address and buffer length */
DMAhandle_RX.Instance->NDTR = RX_BUF_LEN;
DMAhandle_RX.Instance->PAR = (uint32_t) &(UARThandle.Instance->DR);
DMAhandle_RX.Instance->M0AR = (uint32_t) dma_buffer_rx;
/* Enable UART as DMA enabled receiver */
UARThandle.Instance->CR3 |= USART_CR3_DMAR;
/* Enable transfer complete interrupt */
__HAL_DMA_ENABLE_IT(&DMAhandle_RX, DMA_IT_TC);
__HAL_DMA_ENABLE(&DMAhandle_RX);
return 0;
}
示例12: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
#ifndef BOARD_IN_STOP_MODE
GPIO_InitTypeDef GPIO_InitStruct;
#endif
/* STM32F0xx HAL library initialization:
- Configure the Flash prefetch
- Systick timer is configured by default as source of time base, but user
can eventually implement his proper time base source (a general purpose
timer for example or other time source), keeping in mind that Time base
duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
handled in milliseconds basis.
- Low Level Initialization
*/
HAL_Init();
/* Configure the system clock to 48 MHz */
SystemClock_Config();
/* Configure LED3 */
BSP_LED_Init(LED3);
#ifdef BOARD_IN_STOP_MODE
/* HSI must be UART clock source to be able to wake up the MCU */
__HAL_RCC_USART1_CONFIG(RCC_USART1CLKSOURCE_HSI);
#endif
/*##-1- Configure the UART peripheral ######################################*/
/* Put the USART peripheral in the Asynchronous mode (UART Mode) */
/* UART configured as follows:
- Word Length = 8 Bits
- Stop Bit = One Stop bit
- Parity = None
- BaudRate = 9600 baud
- Hardware flow control disabled (RTS and CTS signals) */
UartHandle.Instance = USARTx;
HAL_UART_DeInit(&UartHandle);
UartHandle.Init.BaudRate = 9600;
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_NONE;
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UartHandle.Init.Mode = UART_MODE_TX_RX;
UartHandle.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if(HAL_UART_Init(&UartHandle) != HAL_OK)
{
Error_Handler();
}
#ifdef BOARD_IN_STOP_MODE
BSP_LED_On(LED3);
/* wait for two seconds before test start */
HAL_Delay(2000);
/* make sure that no UART transfer is on-going */
while(__HAL_UART_GET_FLAG(&UartHandle, USART_ISR_BUSY) == SET);
/* make sure that UART is ready to receive
* (test carried out again later in HAL_UARTEx_StopModeWakeUpSourceConfig) */
while(__HAL_UART_GET_FLAG(&UartHandle, USART_ISR_REACK) == RESET);
/* set the wake-up event:
* specify wake-up on RXNE flag */
WakeUpSelection.WakeUpEvent = UART_WAKEUP_ON_READDATA_NONEMPTY;
if (HAL_UARTEx_StopModeWakeUpSourceConfig(&UartHandle, WakeUpSelection)!= HAL_OK)
{
Error_Handler();
}
/* Enable the UART Wake UP from stop mode Interrupt */
__HAL_UART_ENABLE_IT(&UartHandle, UART_IT_WUF);
/* about to enter stop mode: switch off LED */
BSP_LED_Off(LED3);
/* enable MCU wake-up by UART */
HAL_UARTEx_EnableStopMode(&UartHandle);
/* enter stop mode */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
/* ... STOP mode ... */
SystemClock_Config_fromSTOP();
/* at that point, MCU has been awoken: the LED has been turned back on */
/* Wake Up based on RXNE flag successful */
HAL_UARTEx_DisableStopMode(&UartHandle);
/* wait for some delay */
HAL_Delay(100);
//.........这里部分代码省略.........
示例13: stm32_configure
static rt_err_t stm32_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
{
struct stm32_uart *uart;
RT_ASSERT(serial != RT_NULL);
RT_ASSERT(cfg != RT_NULL);
uart = (struct stm32_uart *)serial->parent.user_data;
uart->UartHandle.Init.BaudRate = cfg->baud_rate;
uart->UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
uart->UartHandle.Init.Mode = UART_MODE_TX_RX;
uart->UartHandle.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
switch (cfg->data_bits)
{
case DATA_BITS_7:
uart->UartHandle.Init.WordLength = UART_WORDLENGTH_7B;
break;
case DATA_BITS_8:
uart->UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
break;
case DATA_BITS_9:
uart->UartHandle.Init.WordLength = UART_WORDLENGTH_9B;
break;
default:
uart->UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
break;
}
switch (cfg->stop_bits)
{
case STOP_BITS_1:
uart->UartHandle.Init.StopBits = UART_STOPBITS_1;
break;
case STOP_BITS_2:
uart->UartHandle.Init.StopBits = UART_STOPBITS_2;
break;
default:
uart->UartHandle.Init.StopBits = UART_STOPBITS_1;
break;
}
switch (cfg->parity)
{
case PARITY_NONE:
uart->UartHandle.Init.Parity = UART_PARITY_NONE;
break;
case PARITY_ODD:
uart->UartHandle.Init.Parity = UART_PARITY_ODD;
break;
case PARITY_EVEN:
uart->UartHandle.Init.Parity = UART_PARITY_EVEN;
break;
default:
uart->UartHandle.Init.Parity = UART_PARITY_NONE;
break;
}
if (HAL_UART_DeInit(&uart->UartHandle) != HAL_OK)
{
return RT_ERROR;
}
if (HAL_UART_Init(&uart->UartHandle) != HAL_OK)
{
return RT_ERROR;
}
return RT_EOK;
}
示例14: HELPER_UART_DeInit
/**
* @brief Uart De-Initialization Function.
* @param numUart: numero della periferica UART da de-inizializzare.
* numUart può assumere uno dei seguenti valori:
* @arg HELPER_UART1: periferica UART 1;
* @arg HELPER_UART2: periferica UART 2.
* @arg HELPER_UART3: periferica UART 3;
* @arg HELPER_UART4: periferica UART 4.
* @arg HELPER_UART5: periferica UART 5;
* @arg HELPER_UART6: periferica UART 6.
*
* @retval None
*/
HAL_StatusTypeDef HELPER_UART_DeInit(HELPER_UART_TypeDef numUart){
return HAL_UART_DeInit(HELPER_UART_GetHandle(numUart));
}
示例15: uartReconfigure
void uartReconfigure(uartPort_t *uartPort)
{
/*RCC_PeriphCLKInitTypeDef RCC_PeriphClkInit;
RCC_PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1|RCC_PERIPHCLK_USART2|RCC_PERIPHCLK_USART3|
RCC_PERIPHCLK_UART4|RCC_PERIPHCLK_UART5|RCC_PERIPHCLK_USART6|RCC_PERIPHCLK_UART7|RCC_PERIPHCLK_UART8;
RCC_PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_SYSCLK;
RCC_PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_SYSCLK;
RCC_PeriphClkInit.Usart3ClockSelection = RCC_USART3CLKSOURCE_SYSCLK;
RCC_PeriphClkInit.Uart4ClockSelection = RCC_UART4CLKSOURCE_SYSCLK;
RCC_PeriphClkInit.Uart5ClockSelection = RCC_UART5CLKSOURCE_SYSCLK;
RCC_PeriphClkInit.Usart6ClockSelection = RCC_USART6CLKSOURCE_SYSCLK;
RCC_PeriphClkInit.Uart7ClockSelection = RCC_UART7CLKSOURCE_SYSCLK;
RCC_PeriphClkInit.Uart8ClockSelection = RCC_UART8CLKSOURCE_SYSCLK;
HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInit);*/
HAL_UART_DeInit(&uartPort->Handle);
uartPort->Handle.Init.BaudRate = uartPort->port.baudRate;
// according to the stm32 documentation wordlen has to be 9 for parity bits
// this does not seem to matter for rx but will give bad data on tx!
uartPort->Handle.Init.WordLength = (uartPort->port.options & SERIAL_PARITY_EVEN) ? UART_WORDLENGTH_9B : UART_WORDLENGTH_8B;
uartPort->Handle.Init.StopBits = (uartPort->port.options & SERIAL_STOPBITS_2) ? USART_STOPBITS_2 : USART_STOPBITS_1;
uartPort->Handle.Init.Parity = (uartPort->port.options & SERIAL_PARITY_EVEN) ? USART_PARITY_EVEN : USART_PARITY_NONE;
uartPort->Handle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
uartPort->Handle.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
uartPort->Handle.Init.Mode = 0;
if (uartPort->port.mode & MODE_RX)
uartPort->Handle.Init.Mode |= UART_MODE_RX;
if (uartPort->port.mode & MODE_TX)
uartPort->Handle.Init.Mode |= UART_MODE_TX;
usartConfigurePinInversion(uartPort);
#ifdef TARGET_USART_CONFIG
usartTargetConfigure(uartPort);
#endif
if (uartPort->port.options & SERIAL_BIDIR)
{
HAL_HalfDuplex_Init(&uartPort->Handle);
}
else
{
HAL_UART_Init(&uartPort->Handle);
}
// Receive DMA or IRQ
if (uartPort->port.mode & MODE_RX)
{
if (uartPort->rxDMAStream)
{
uartPort->rxDMAHandle.Instance = uartPort->rxDMAStream;
uartPort->rxDMAHandle.Init.Channel = uartPort->rxDMAChannel;
uartPort->rxDMAHandle.Init.Direction = DMA_PERIPH_TO_MEMORY;
uartPort->rxDMAHandle.Init.PeriphInc = DMA_PINC_DISABLE;
uartPort->rxDMAHandle.Init.MemInc = DMA_MINC_ENABLE;
uartPort->rxDMAHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
uartPort->rxDMAHandle.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
uartPort->rxDMAHandle.Init.Mode = DMA_CIRCULAR;
uartPort->rxDMAHandle.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
uartPort->rxDMAHandle.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_1QUARTERFULL;
uartPort->rxDMAHandle.Init.PeriphBurst = DMA_PBURST_SINGLE;
uartPort->rxDMAHandle.Init.MemBurst = DMA_MBURST_SINGLE;
uartPort->rxDMAHandle.Init.Priority = DMA_PRIORITY_MEDIUM;
HAL_DMA_DeInit(&uartPort->rxDMAHandle);
HAL_DMA_Init(&uartPort->rxDMAHandle);
/* Associate the initialized DMA handle to the UART handle */
__HAL_LINKDMA(&uartPort->Handle, hdmarx, uartPort->rxDMAHandle);
HAL_UART_Receive_DMA(&uartPort->Handle, (uint8_t*)uartPort->port.rxBuffer, uartPort->port.rxBufferSize);
uartPort->rxDMAPos = __HAL_DMA_GET_COUNTER(&uartPort->rxDMAHandle);
}
else
{
/* Enable the UART Parity Error Interrupt */
SET_BIT(uartPort->USARTx->CR1, USART_CR1_PEIE);
/* Enable the UART Error Interrupt: (Frame error, noise error, overrun error) */
SET_BIT(uartPort->USARTx->CR3, USART_CR3_EIE);
/* Enable the UART Data Register not empty Interrupt */
SET_BIT(uartPort->USARTx->CR1, USART_CR1_RXNEIE);
}
}
// Transmit DMA or IRQ
if (uartPort->port.mode & MODE_TX) {
if (uartPort->txDMAStream) {
uartPort->txDMAHandle.Instance = uartPort->txDMAStream;
uartPort->txDMAHandle.Init.Channel = uartPort->txDMAChannel;
uartPort->txDMAHandle.Init.Direction = DMA_MEMORY_TO_PERIPH;
uartPort->txDMAHandle.Init.PeriphInc = DMA_PINC_DISABLE;
uartPort->txDMAHandle.Init.MemInc = DMA_MINC_ENABLE;
uartPort->txDMAHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
//.........这里部分代码省略.........