| Electronic Components Datasheet Search |
|
AN4104 Datasheet(PDF) 9 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4104 Datasheet(HTML) 9 Page - STMicroelectronics |
|
9 / 13 page ![]() AN4104 DMA firmware driver API Doc ID 023131 Rev 1 9/13 2.1 How to use DMA Driver 1. Before using the DMa driver, enable The DMA controller clock using RCC_AHBPeriphClockCmd (RCC_AHBPeriph_DMAX, ENABLE) function. 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 (if needed) using the DMA_Init() function. 4. Enable the NVIC and 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 the adequate PPP peripheral except internal SRAM and Flash (ie. SPI, USART...) The function allowing this operation is provided in each PPP peripheral driver (ie. SPI_DMACmd for SPI peripheral). 7. Optionally, 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: – Check on DMA channel flags using the function DMA_GetFlagStatus(). – 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, clear it using DMA_ClearFlag() function. And after checking on an interrupt event, clear it using DMA_ClearITPendingBit() function. |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |