Nut/OS  5.0.5
API Reference
stm32f1_dma.c File Reference
#include <cfg/arch.h>
#include <arch/cm3.h>
#include <dev/irqreg.h>
#include <arch/cm3/cortex_interrupt.h>
#include <arch/cm3/stm/stm32_dma.h>
Include dependency graph for stm32f1_dma.c:

Functions

void DMA_Setup (uint8_t ch, void *dst, void *src, uint16_t length, uint32_t flags)
void DMA_Enable (uint8_t ch)
void DMA_Disable (uint8_t ch)
void DMA_Init (void)
 DMA System Initialization.
void DMA_IrqMask (uint8_t ch, uint32_t mask, uint8_t ena)
 Control DMA channel interrupt masks.
void DMA_ClearFlag (uint8_t ch, uint32_t flags)
 Clear DMA channel flags.
uint32_t DMA_GetFlag (uint8_t ch)
 Get DMA channel flags.

Variables

const DMATAB DmaTab []
 Table to align channels and interrupts for simpler access.
const uint8_t DMACount = sizeof(DmaTab)/sizeof(DMATAB)
const DMATABDmaTab1 = &DmaTab[0]

Function Documentation

void DMA_Enable ( uint8_t  ch)
void DMA_Disable ( uint8_t  ch)
void DMA_Init ( void  )

DMA System Initialization.

Register all DMA interrupt handlers.

References DMA_Channel_TypeDef::CCR, DMA1, DMA2, DMA_ClearFlag(), RCC, RCC_AHBENR_DMA1EN, RCC_AHBENR_DMA2EN, and STM_HAS_DMA1.

Here is the call graph for this function:

void DMA_IrqMask ( uint8_t  ch,
uint32_t  mask,
uint8_t  ena 
)

Control DMA channel interrupt masks.

Setup interrupt mask on given channel. Channel numbers are from 0..n while documentation numbers them from 1..n. For that please use the defines DMAx_Cn.

Parameters:
chChannel number to set interrupt mask.
maskMask to set on the designated channel interrupts.
enaEnable (1) or Disable (0) the bits in the mask.

References DMA_Channel_TypeDef::CCR, DMA_FLAGMASK, DMATAB::fofs, and DMA_TypeDef::IFCR.

void DMA_ClearFlag ( uint8_t  ch,
uint32_t  flags 
)

Clear DMA channel flags.

Setup interrupt mask on given channel. Channel numbers are from 0..n while documentation numbers them from 1..n. For that please use the defines DMAx_Cn.

Parameters:
chChannel number.
flagsMask of flags to clear.

References DMA_FLAGMASK, and DMA_TypeDef::IFCR.

uint32_t DMA_GetFlag ( uint8_t  ch)

Get DMA channel flags.

Get interrupt / status flags of given channel.

Parameters:
chChannel number to set interrupt mask.
Returns:
flags Mask of flags to clear.

References DMA_FLAGMASK, DMATAB::fofs, and DMA_TypeDef::ISR.


Variable Documentation

const DMATAB DmaTab[]
Initial value:

Table to align channels and interrupts for simpler access.

const uint8_t DMACount = sizeof(DmaTab)/sizeof(DMATAB)
const DMATAB* DmaTab1 = &DmaTab[0]