STM8L15x Standard Peripherals Drivers
|
Data Counter functions. More...
Functions | |
uint8_t | DMA_GetCurrDataCounter (DMA_Channel_TypeDef *DMA_Channelx) |
Returns the number of remaining data units in the current DMA Channelx transfer. | |
void | DMA_SetCurrDataCounter (DMA_Channel_TypeDef *DMA_Channelx, uint8_t DataNumber) |
Set the number of data units to transfer for DMA Channelx. |
Detailed Description
Data Counter functions.
=============================================================================== Data Counter functions =============================================================================== This subsection provides functions allowing to configure and read the buffer size (number of data to be transferred). The DMA data counter can be written only when the DMA channel is disabled (ie. after transfer complete event). The DMA_SetCurrDataCounter() function can be used to write the Channel data counter value. Note: It is advised to use this function rather than DMA_Init() (DMA_BufferSize parameter) in situations where only the Data buffer needs to be reloaded. The DMA data counter can be read to indicate the number of remaining transfers for the relative DMA channel. This counter is decremented at the end of each data transfer and when the transfer is complete: - If Normal mode is selected: the counter is set to 0. - If Circular mode is selected: the counter is reloaded with the initial value (configured before enabling the DMA channel) The DMA_GetCurrDataCounter() function can be used to read the Channel current data counter value.
Function Documentation
uint8_t DMA_GetCurrDataCounter | ( | DMA_Channel_TypeDef * | DMA_Channelx | ) |
Returns the number of remaining data units in the current DMA Channelx transfer.
Definition at line 409 of file stm8l15x_dma.c.
References DMA_Channel_struct::CNBTR, and IS_DMA_CHANNEL.
void DMA_SetCurrDataCounter | ( | DMA_Channel_TypeDef * | DMA_Channelx, |
uint8_t | DataNumber | ||
) |
Set the number of data units to transfer for DMA Channelx.
- Note:
- It is advised to use this function rather than DMA_Init() in situations where only the Data buffer needs to be reloaded.
Definition at line 395 of file stm8l15x_dma.c.
References DMA_Channel_struct::CNBTR, and IS_DMA_CHANNEL.