Library Functions.
More...
Library Functions.
| void TM_USART_DMA_Deinit |
( |
USART_TypeDef * |
USARTx | ) |
|
Deinitializes USART DMA TX functionality.
- Parameters
-
| *USARTx | Pointer to USARTx where you want to disable DMA TX mode |
- Return values
-
| void TM_USART_DMA_DisableInterrupts |
( |
USART_TypeDef * |
USARTx | ) |
|
Disables interrupts for DMA for USART streams.
- Parameters
-
| *USARTx | Pointer to USARTx where DMA interrupts will be disabled |
- Return values
-
| void TM_USART_DMA_EnableInterrupts |
( |
USART_TypeDef * |
USARTx | ) |
|
| DMA_Stream_TypeDef* TM_USART_DMA_GetStreamTX |
( |
USART_TypeDef * |
USARTx | ) |
|
Gets poitner to DMA TX stream for desired USART.
- Parameters
-
| *USARTx | Pointer to USART where you wanna get its stream pointer |
- Return values
-
| Pointer | to DMA stream for desired USART |
| void TM_USART_DMA_Init |
( |
USART_TypeDef * |
USARTx | ) |
|
Initializes USART DMA TX functionality.
- Note
- USART HAVE TO be previously initialized using TM_USART library
- Parameters
-
| *USARTx | Pointer to USARTx where you want to enable DMA TX mode |
- Return values
-
| void TM_USART_DMA_InitWithStreamAndChannel |
( |
USART_TypeDef * |
USARTx, |
|
|
DMA_Stream_TypeDef * |
DMA_Stream, |
|
|
uint32_t |
DMA_Channel |
|
) |
| |
Initializes USART DMA TX functionality with custom DMA stream and Channel options.
- Note
- USART HAVE TO be previously initialized using TM_USART library
-
Use this function only in case default Stream and Channel settings are not good for you
- Parameters
-
| *USARTx | Pointer to USARTx where you want to enable DMA TX mode |
| *DMA_Stream | Pointer to DMAy_Streamx, where y is DMA (1 or 2) and x is Stream (0 to 7) |
| DMA_Channel | Select DMA channel for your USART in specific DMA Stream |
- Return values
-
| uint8_t TM_USART_DMA_Puts |
( |
USART_TypeDef * |
USARTx, |
|
|
char * |
str |
|
) |
| |
Puts string to USART port with DMA.
- Note
- Try not to use local variables pointers for DMA memory as parameter *str
- Parameters
-
| *USARTx | Pointer to USARTx peripheral you will use |
| *str | Pointer to string to send over USART with DMA |
- Return values
-
| Sending | started status:
- 0: DMA has not started with sending data
- > 0: DMA has started with sending data
|
| uint8_t TM_USART_DMA_Send |
( |
USART_TypeDef * |
USARTx, |
|
|
uint8_t * |
DataArray, |
|
|
uint16_t |
count |
|
) |
| |
Sends data over USART with DMA TX functionality.
- Note
- Try not to use local variables pointers for DMA memory as parameter *str
- Parameters
-
| *USARTx | Pointer to USARTx to use for send |
| *DataArray | Pointer to array of data to be sent over USART |
| count | Number of data bytes to be sent over USART with DMA |
- Return values
-
| Sending | started status:
- 0: DMA has not started with sending data
- > 0: DMA has started with sending data
|
| uint16_t TM_USART_DMA_Transmitting |
( |
USART_TypeDef * |
USARTx | ) |
|
Checks if USART DMA TX is still sending data.
- Parameters
-
| *USARTx | Pointer to USARTx where you want to check if DMA is still working |
- Return values
-
| Sending | status:
- 0: USART does not sending anymore
- > 0: USART DMA is still sending data
|