TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
TM_USART_DMA_Functions

Library Functions. More...

Functions

void TM_USART_DMA_Init (USART_TypeDef *USARTx)
 Initializes USART DMA TX functionality. More...
 
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. More...
 
void TM_USART_DMA_Deinit (USART_TypeDef *USARTx)
 Deinitializes USART DMA TX functionality. More...
 
void TM_USART_DMA_EnableInterrupts (USART_TypeDef *USARTx)
 Enables interrupts for DMA for USART streams. More...
 
void TM_USART_DMA_DisableInterrupts (USART_TypeDef *USARTx)
 Disables interrupts for DMA for USART streams. More...
 
DMA_Stream_TypeDef * TM_USART_DMA_GetStreamTX (USART_TypeDef *USARTx)
 Gets poitner to DMA TX stream for desired USART. More...
 
uint8_t TM_USART_DMA_Puts (USART_TypeDef *USARTx, char *str)
 Puts string to USART port with DMA. More...
 
uint8_t TM_USART_DMA_Send (USART_TypeDef *USARTx, uint8_t *DataArray, uint16_t count)
 Sends data over USART with DMA TX functionality. More...
 
uint16_t TM_USART_DMA_Transmitting (USART_TypeDef *USARTx)
 Checks if USART DMA TX is still sending data. More...
 

Detailed Description

Library Functions.

Function Documentation

void TM_USART_DMA_Deinit ( USART_TypeDef *  USARTx)

Deinitializes USART DMA TX functionality.

Parameters
*USARTxPointer to USARTx where you want to disable DMA TX mode
Return values
None
void TM_USART_DMA_DisableInterrupts ( USART_TypeDef *  USARTx)

Disables interrupts for DMA for USART streams.

Parameters
*USARTxPointer to USARTx where DMA interrupts will be disabled
Return values
None
void TM_USART_DMA_EnableInterrupts ( USART_TypeDef *  USARTx)

Enables interrupts for DMA for USART streams.

Note
USART DMA must be initialized first using TM_USART_DMA_Init() or TM_USART_DMA_InitWithStreamAndChannel() functions
Parameters
*USARTxPointer to USARTx where DMA interrupts will be enabled
Return values
None
DMA_Stream_TypeDef* TM_USART_DMA_GetStreamTX ( USART_TypeDef *  USARTx)

Gets poitner to DMA TX stream for desired USART.

Parameters
*USARTxPointer to USART where you wanna get its stream pointer
Return values
Pointerto 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
*USARTxPointer to USARTx where you want to enable DMA TX mode
Return values
None
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
*USARTxPointer to USARTx where you want to enable DMA TX mode
*DMA_StreamPointer to DMAy_Streamx, where y is DMA (1 or 2) and x is Stream (0 to 7)
DMA_ChannelSelect DMA channel for your USART in specific DMA Stream
Return values
None
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
*USARTxPointer to USARTx peripheral you will use
*strPointer to string to send over USART with DMA
Return values
Sendingstarted 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
*USARTxPointer to USARTx to use for send
*DataArrayPointer to array of data to be sent over USART
countNumber of data bytes to be sent over USART with DMA
Return values
Sendingstarted 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
*USARTxPointer to USARTx where you want to check if DMA is still working
Return values
Sendingstatus:
  • 0: USART does not sending anymore
  • > 0: USART DMA is still sending data