STM8L15x Standard Peripherals Drivers: Data Counter functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Data Counter functions

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.

Parameters:
DMA_Channelx,:selects the DMA Channelx where x can be 0 to 3
Return values:
Thenumber of remaining data units in the current DMA Channelx

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.

Parameters:
DMA_Channelx,:selects the DMA Channelx where x can be 0 to 3
DataNumber,:The number of data units to transfer, it can be any value from 0 to 255
Note:
It is advised to use this function rather than DMA_Init() in situations where only the Data buffer needs to be reloaded.
Return values:
None

Definition at line 395 of file stm8l15x_dma.c.

References DMA_Channel_struct::CNBTR, and IS_DMA_CHANNEL.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com