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

Library Functions. More...

Functions

void TM_DMA_Init (DMA_Stream_TypeDef *Stream, DMA_HandleTypeDef *HDMA)
 Initializes DMA stream. More...
 
void TM_DMA_DeInit (DMA_Stream_TypeDef *Stream)
 Deinitializes DMA stream. More...
 
void TM_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t Source, uint32_t Destination, uint16_t Length)
 Starts DMA transmission for selected stream. More...
 
void TM_DMA_ClearFlags (DMA_Stream_TypeDef *DMA_Stream)
 Clears all flags for selected DMA stream. More...
 
void TM_DMA_ClearFlag (DMA_Stream_TypeDef *DMA_Stream, uint32_t flags)
 Clears selected DMA interrupt flag. More...
 
void TM_DMA_EnableInterrupts (DMA_Stream_TypeDef *DMA_Stream)
 Enables interrupts for DMA stream. More...
 
void TM_DMA_DisableInterrupts (DMA_Stream_TypeDef *DMA_Stream)
 Disables interrupts for DMA stream. More...
 
void TM_DMA_TransferCompleteHandler (DMA_Stream_TypeDef *DMA_Stream)
 Transfer complete callback. More...
 
void TM_DMA_HalfTransferCompleteHandler (DMA_Stream_TypeDef *DMA_Stream)
 Half transfer complete callback. More...
 
void TM_DMA_TransferErrorHandler (DMA_Stream_TypeDef *DMA_Stream)
 Transfer error callback. More...
 
void TM_DMA_DirectModeErrorHandler (DMA_Stream_TypeDef *DMA_Stream)
 Direct mode error callback. More...
 
void TM_DMA_FIFOErrorHandler (DMA_Stream_TypeDef *DMA_Stream)
 FIFO error error callback. More...
 

Detailed Description

Library Functions.

Function Documentation

void TM_DMA_ClearFlag ( DMA_Stream_TypeDef *  DMA_Stream,
uint32_t  flags 
)

Clears selected DMA interrupt flag.

Parameters
*DMA_StreamPointer to DMA_Stream_TypeDef DMA stream where you want to clear flags
flagsFlag(s) which you wanna clear:
  • DMA_FLAG_TCIF: Transfer complete interrupt flag
  • DMA_FLAG HTIF: Half transfer complete interrupt flag
  • DMA_FLAG_TEIF: Transfer error interrupt flag
  • DMA_FLAG_DMEIF: Direct mode error interrupt flag
  • DMA_FLAG_FEIF: FIFO error interrupt flag
  • DMA_FLAG_ALL: All flags
Return values
None
void TM_DMA_ClearFlags ( DMA_Stream_TypeDef *  DMA_Stream)

Clears all flags for selected DMA stream.

Parameters
*DMA_StreamPointer to DMA_Stream_TypeDef DMA stream where you want to clear flags
Return values
None
void TM_DMA_DeInit ( DMA_Stream_TypeDef *  Stream)

Deinitializes DMA stream.

Parameters
*DMA_StreamPointer to DMA_Stream_TypeDef DMA stream to deinitialize
Return values
None
void TM_DMA_DirectModeErrorHandler ( DMA_Stream_TypeDef *  DMA_Stream)

Direct mode error callback.

Note
This function is called when interrupt for specific stream happens for direct mode error
Parameters
*DMA_StreamPointer to DMA stream where interrupt happens
Return values
None
Note
With __weak parameter to prevent link errors if not defined by user
void TM_DMA_DisableInterrupts ( DMA_Stream_TypeDef *  DMA_Stream)

Disables interrupts for DMA stream.

Note
It adds IRQ to NVIC and enables all possible DMA STREAM interrupts
Parameters
*DMA_StreamPointer to DMA stream where to disable interrupts
Return values
None
void TM_DMA_EnableInterrupts ( DMA_Stream_TypeDef *  DMA_Stream)

Enables interrupts for DMA stream.

Note
It adds IRQ to NVIC and enables all possible DMA STREAM interrupts
Parameters
*DMA_StreamPointer to DMA stream where to enable interrupts
Return values
None
void TM_DMA_FIFOErrorHandler ( DMA_Stream_TypeDef *  DMA_Stream)

FIFO error error callback.

Note
This function is called when interrupt for specific stream happens for FIFO error
Parameters
*DMA_StreamPointer to DMA stream where interrupt happens
Return values
None
Note
With __weak parameter to prevent link errors if not defined by user
void TM_DMA_HalfTransferCompleteHandler ( DMA_Stream_TypeDef *  DMA_Stream)

Half transfer complete callback.

Note
This function is called when interrupt for specific stream happens for hal transfer complete
Parameters
*DMA_StreamPointer to DMA stream where interrupt happens
Return values
None
Note
With __weak parameter to prevent link errors if not defined by user
void TM_DMA_Init ( DMA_Stream_TypeDef *  Stream,
DMA_HandleTypeDef *  HDMA 
)

Initializes DMA stream.

Parameters
*DMA_StreamPointer to DMA_Stream_TypeDef DMA stream to initialize
*HDMAPointer to DMA_HandleTypeDef structure with settings. When this parameter is set to null, only click will be enabled for desired stream for DMA
Return values
None
void TM_DMA_Start ( DMA_HandleTypeDef *  hdma,
uint32_t  Source,
uint32_t  Destination,
uint16_t  Length 
)

Starts DMA transmission for selected stream.

Parameters
*HDMAPointer to DMA_HandleTypeDef structure with settings where transmission will be started
SourceSource address from where data will be sent
DestinationDestination address where data will be sent
LengthNumber of bytes to sent
Return values
None
void TM_DMA_TransferCompleteHandler ( DMA_Stream_TypeDef *  DMA_Stream)

Transfer complete callback.

Note
This function is called when interrupt for specific stream happens for transfer complete
This function is called immediately after DMA transfers last element from memory to your peripheral if DMA is configured as M2P (Memory 2 Peripheral). When using for example USART, DMA will transfer last byte to USART peripheral register, but USART still has to do its job. It's important to know this fact, because you can get a lot of troubles, when for ex. you are working with RS485 and you have to control Enable pin for your transceiver.
Parameters
*DMA_StreamPointer to DMA stream where interrupt happens
Return values
None
Note
With __weak parameter to prevent link errors if not defined by user
void TM_DMA_TransferErrorHandler ( DMA_Stream_TypeDef *  DMA_Stream)

Transfer error callback.

Note
This function is called when interrupt for specific stream happens for transfer error
Parameters
*DMA_StreamPointer to DMA stream where interrupt happens
Return values
None
Note
With __weak parameter to prevent link errors if not defined by user