STM8L15x Standard Peripherals Drivers
|
stm8l15x_dma.c File Reference
This file provides all the DMA firmware functions. More...
#include "stm8l15x_dma.h"
Go to the source code of this file.
Functions | |
void | DMA_ClearFlag (DMA_FLAG_TypeDef DMA_FLAG) |
Clears the DMA Channels selected flags. | |
void | DMA_ClearITPendingBit (DMA_IT_TypeDef DMA_IT) |
Clears the DMA Channelx�s interrupt pending bits. | |
void | DMA_Cmd (DMA_Channel_TypeDef *DMA_Channelx, FunctionalState NewState) |
Enables or disables the specified DMA Channelx. | |
void | DMA_DeInit (DMA_Channel_TypeDef *DMA_Channelx) |
Deinitializes the DMA Channelx registers to their default reset values. | |
uint8_t | DMA_GetCurrDataCounter (DMA_Channel_TypeDef *DMA_Channelx) |
Returns the number of remaining data units in the current DMA Channelx transfer. | |
FlagStatus | DMA_GetFlagStatus (DMA_FLAG_TypeDef DMA_FLAG) |
Checks whether the specified DMA Channelx flag is set or not. | |
ITStatus | DMA_GetITStatus (DMA_IT_TypeDef DMA_IT) |
Checks whether the specified DMA Channelx interrupt has occurred or not. | |
void | DMA_GlobalCmd (FunctionalState NewState) |
Enables or disables All the DMA. | |
void | DMA_GlobalDeInit (void) |
Deinitializes the DMA Global Status register to its default reset values. | |
void | DMA_Init (DMA_Channel_TypeDef *DMA_Channelx, uint32_t DMA_Memory0BaseAddr, uint16_t DMA_PeripheralMemory1BaseAddr, uint8_t DMA_BufferSize, DMA_DIR_TypeDef DMA_DIR, DMA_Mode_TypeDef DMA_Mode, DMA_MemoryIncMode_TypeDef DMA_MemoryIncMode, DMA_Priority_TypeDef DMA_Priority, DMA_MemoryDataSize_TypeDef DMA_MemoryDataSize) |
Initializes the DMA Channelx according to the specified parameters. | |
void | DMA_ITConfig (DMA_Channel_TypeDef *DMA_Channelx, DMA_ITx_TypeDef DMA_ITx, FunctionalState NewState) |
Enables or disables the specified DMA Channelx interrupts. | |
void | DMA_SetCurrDataCounter (DMA_Channel_TypeDef *DMA_Channelx, uint8_t DataNumber) |
Set the number of data units to transfer for DMA Channelx. | |
void | DMA_SetTimeOut (uint8_t DMA_TimeOut) |
Sets the Time out Value. |
Detailed Description
This file provides all the DMA firmware functions.
* * =================================================================== * How to use this driver * =================================================================== * 1. Enable The DMA controller clock using CLK_PeripheralClockConfig() * function: CLK_PeripheralClockConfig(CLK_Peripheral_DMA1, ENABLE). * * 2. Enable and configure the peripheral to be connected to the DMA * channel (except for internal SRAM / FLASH memories: no * initialization is necessary). * * 3. For a given Channel, program the Source and Destination * addresses, the transfer Direction, the Buffer Size, the * Peripheral and Memory Incrementation mode and Data Size, * the Circular or Normal mode, the channel transfer Priority * and the Memory-to-Memory transfer mode (for channel 3 only, * if needed) using the DMA_Init() function. * * 4. Enable the the corresponding interrupt(s) using the function * DMA_ITConfig() if you need to use DMA interrupts. * * 5. Enable the DMA channel using the DMA_Cmd() function. * * 6. Activate the needed channel Request using PPP_DMACmd() function * for any PPP peripheral except internal SRAM and FLASH (ie. TIM4, * USART ...). The function allowing this operation is provided in * each PPP peripheral driver (ie. TIM4_DMACmd for TIM4 peripheral). * * 7. Optionally, you can configure the number of data to be * transferred when the channel is disabled (ie. after each * Transfer Complete event or when a Transfer Error occurs) using * the function DMA_SetCurrDataCounter(). * And you can get the number of remaining data to be transferred * using the function DMA_GetCurrDataCounter() at run time (when * the DMA channel is enabled and running). * * 8. To control DMA events you can use one of the following * two methods: * a- Check on DMA channel flags using the function * DMA_GetFlagStatus(). * b- Use DMA interrupts through the function DMA_ITConfig() * at initialization phase and DMA_GetITStatus() function * into interrupt routines in communication phase. * After checking on a flag you should clear it using * DMA_ClearFlag() function. And after checking on an interrupt * event you should clear it using DMA_ClearITPendingBit() * function. * *
- Attention:
THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
© COPYRIGHT 2011 STMicroelectronics
Definition in file stm8l15x_dma.c.