|
|
@ -29,61 +29,3 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
#include <libopencm3/stm32/usart.h> |
|
|
|
#include <libopencm3/stm32/rcc.h> |
|
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/ |
|
|
|
/** @brief USART Receiver DMA Enable.
|
|
|
|
* |
|
|
|
* DMA is available on: |
|
|
|
* @li USART1 Rx DMA1 channel 3 or 5. |
|
|
|
* @li USART2 Rx DMA1 channel 5. |
|
|
|
* |
|
|
|
* @param usart USART block register address base @ref usart_reg_base |
|
|
|
*/ |
|
|
|
|
|
|
|
void usart_enable_rx_dma(uint32_t usart) |
|
|
|
{ |
|
|
|
USART_CR3(usart) |= USART_CR3_DMAR; |
|
|
|
} |
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/ |
|
|
|
/** @brief USART Receiver DMA Disable.
|
|
|
|
* |
|
|
|
* @param usart USART block register address base @ref usart_reg_base |
|
|
|
*/ |
|
|
|
|
|
|
|
void usart_disable_rx_dma(uint32_t usart) |
|
|
|
{ |
|
|
|
USART_CR3(usart) &= ~USART_CR3_DMAR; |
|
|
|
} |
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/ |
|
|
|
/** @brief USART Transmitter DMA Enable.
|
|
|
|
* |
|
|
|
* DMA is available on: |
|
|
|
* @li USART1 Tx DMA1 channel 2 or 4. |
|
|
|
* @li USART2 Tx DMA1 channel 4. |
|
|
|
* |
|
|
|
* @param usart USART block register address base @ref usart_reg_base |
|
|
|
*/ |
|
|
|
|
|
|
|
void usart_enable_tx_dma(uint32_t usart) |
|
|
|
{ |
|
|
|
USART_CR3(usart) |= USART_CR3_DMAT; |
|
|
|
} |
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/ |
|
|
|
/** @brief USART Transmitter DMA Disable.
|
|
|
|
* |
|
|
|
* @param usart USART block register address base @ref usart_reg_base |
|
|
|
*/ |
|
|
|
|
|
|
|
void usart_disable_tx_dma(uint32_t usart) |
|
|
|
{ |
|
|
|
USART_CR3(usart) &= ~USART_CR3_DMAT; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**@}*/ |
|
|
|
|
|
|
|