APM:Libraries
Classes | Macros | Typedefs | Enumerations | Functions
dma.h File Reference
#include "hal_types.h"
Include dependency graph for dma.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dma_stream_t
 DMA stream type. More...
 
struct  dma_reg_map
 DMA register map type. More...
 
struct  dma_dev
 
struct  DMA_InitType
 

Macros

#define DMA_CR_CH0   (0x0 << 25)
 
#define DMA_CR_CH1   (0x1 << 25)
 
#define DMA_CR_CH2   (0x2 << 25)
 
#define DMA_CR_CH3   (0x3 << 25)
 
#define DMA_CR_CH4   (0x4 << 25)
 
#define DMA_CR_CH5   (0x5 << 25)
 
#define DMA_CR_CH6   (0x6 << 25)
 
#define DMA_CR_CH7   (0x7 << 25)
 
#define DMA_CR_MBURST0   (0x0 << 23)
 
#define DMA_CR_MBURST4   (0x1 << 23)
 
#define DMA_CR_MBURST8   (0x2 << 23)
 
#define DMA_CR_MBURST16   (0x3 << 23)
 
#define DMA_CR_PBURST0   (0x0 << 21)
 
#define DMA_CR_PBURST4   (0x1 << 21)
 
#define DMA_CR_PBURST8   (0x2 << 21)
 
#define DMA_CR_PBURST16   (0x3 << 21)
 
#define DMA_CR_CT0   (0x0 << 19)
 
#define DMA_CR_CT1   (0x1 << 19)
 
#define DMA_CR_DBM   (0x1 << 18)
 
#define DMA_CR_PL_LOW   (0x0 << 16)
 
#define DMA_CR_PL_MEDIUM   (0x1 << 16)
 
#define DMA_CR_PL_HIGH   (0x2 << 16)
 
#define DMA_CR_PL_VERY_HIGH   (0x3 << 16)
 
#define DMA_CR_PL_MASK   (0x3 << 16)
 
#define DMA_CR_PINCOS   (0x1 << 15)
 
#define DMA_CR_MSIZE_8BITS   (0x0 << 13)
 
#define DMA_CR_MSIZE_16BITS   (0x1 << 13)
 
#define DMA_CR_MSIZE_32BITS   (0x2 << 13)
 
#define DMA_CR_PSIZE_8BITS   (0x0 << 11)
 
#define DMA_CR_PSIZE_16BITS   (0x1 << 11)
 
#define DMA_CR_PSIZE_32BITS   (0x2 << 11)
 
#define DMA_CR_MINC   (0x1 << 10)
 
#define DMA_CR_PINC   (0x1 << 9)
 
#define DMA_CR_CIRC   (0x1 << 8)
 
#define DMA_CR_DIR_P2M   (0x0 << 6)
 
#define DMA_CR_DIR_M2P   (0x1 << 6)
 
#define DMA_CR_DIR_M2M   (0x2 << 6)
 
#define DMA_CR_PFCTRL   (0x1 << 5)
 
#define DMA_CR_TCIE   (0x1 << 4)
 
#define DMA_CR_HTIE   (0x1 << 3)
 
#define DMA_CR_TEIE   (0x1 << 2)
 
#define DMA_CR_DMEIE   (0x1 << 1)
 
#define DMA_CR_EN   (0x1)
 
#define DMA_FLAG_FEIF   ((uint32_t)0x01)
 
#define DMA_FLAG_DMEIF   ((uint32_t)0x04)
 
#define DMA_FLAG_TEIF   ((uint32_t)0x08)
 
#define DMA_FLAG_HTIF   ((uint32_t)0x10)
 
#define DMA_FLAG_TCIF   ((uint32_t)0x20)
 
#define DMA_FIFOMode_Disable   ((uint32_t)0x00000000)
 
#define DMA_FIFOMode_Enable   ((uint32_t)0x00000004)
 
#define DMA_FIFOThreshold_1QuarterFull   ((uint32_t)0x00000000)
 
#define DMA_FIFOThreshold_HalfFull   ((uint32_t)0x00000001)
 
#define DMA_FIFOThreshold_3QuartersFull   ((uint32_t)0x00000002)
 
#define DMA_FIFOThreshold_Full   ((uint32_t)0x00000003)
 
#define DMA_Priority_Low   ((uint32_t)0x00000000)
 
#define DMA_Priority_Medium   ((uint32_t)0x00010000)
 
#define DMA_Priority_High   ((uint32_t)0x00020000)
 
#define DMA_Priority_VeryHigh   ((uint32_t)0x00030000)
 
#define _DMA1   (&dma1);
 
#define _DMA2   (&dma2);
 

Typedefs

typedef struct dma_stream_t dma_stream_t
 DMA stream type. More...
 
typedef enum dma_channel dma_channel
 DMA channels. More...
 
typedef struct dma_reg_map dma_reg_map
 DMA register map type. More...
 
typedef enum Dma_stream dma_stream
 
typedef struct dma_dev dma_dev
 
typedef enum dma_mode_flags dma_mode_flags
 
typedef enum dma_xfer_size dma_xfer_size
 

Enumerations

enum  dma_channel {
  DMA_CH0 = 0, DMA_CH1 = 1, DMA_CH2 = 2, DMA_CH3 = 3,
  DMA_CH4 = 4, DMA_CH5 = 5, DMA_CH6 = 6, DMA_CH7 = 7
}
 DMA channels. More...
 
enum  Dma_stream {
  DMA1_STREAM0 = 0, DMA1_STREAM1 = 1, DMA1_STREAM2 = 2, DMA1_STREAM3 = 3,
  DMA1_STREAM4 = 4, DMA1_STREAM5 = 5, DMA1_STREAM6 = 6, DMA1_STREAM7 = 7,
  DMA2_STREAM0 = 0x10 + 0, DMA2_STREAM1 = 0x10 + 1, DMA2_STREAM2 = 0x10 + 2, DMA2_STREAM3 = 0x10 + 3,
  DMA2_STREAM4 = 0x10 + 4, DMA2_STREAM5 = 0x10 + 5, DMA2_STREAM6 = 0x10 + 6, DMA2_STREAM7 = 0x10 + 7,
  NUM_DMA_STREAMS
}
 
enum  dma_mode_flags {
  DMA_MEM_2_MEM = 1 << 14, DMA_MINC_MODE = 1 << 7, DMA_PINC_MODE = 1 << 6, DMA_CIRC_MODE = 1 << 5,
  DMA_FROM_MEM = 1 << 4, DMA_TRNS_ERR = 1 << 3, DMA_HALF_TRNS = 1 << 2, DMA_TRNS_CMPLT = 1 << 1
}
 
enum  dma_xfer_size { DMA_SIZE_8BITS = 0, DMA_SIZE_16BITS = 1, DMA_SIZE_32BITS = 2 }
 

Functions

void dma_init (dma_stream stream)
 Initialize a DMA device. More...
 
void dma_setup_transfer (dma_stream stream, __IO void *peripheral_address, __IO void *memory_address0, uint32_t flags, uint32_t fifo_flags)
 
void dma_setup_transfer_mm (dma_stream stream, __IO void *memory_address0, __IO void *memory_address1, uint32_t flags, uint32_t fifo_flags)
 
void dma_init_transfer (dma_stream stream, DMA_InitType *)
 
void dma_set_num_transfers (dma_stream stream, uint16_t num_transfers)
 
void dma_attach_interrupt (dma_stream stream, Handler handler, uint8_t flag)
 Attach an interrupt to a DMA transfer. More...
 
void dma_detach_interrupt (dma_stream stream)
 Detach a DMA transfer interrupt handler. More...
 
void dma_enable (dma_stream stream)
 
void dma_disable (dma_stream stream)
 
uint8_t dma_is_stream_enabled (dma_stream stream)
 Check if a DMA stream is enabled. More...
 
uint8_t dma_get_isr_bits (dma_stream stream)
 Get the ISR status bits for a DMA stream. More...
 
void dma_clear_isr_bits (dma_stream stream)
 Clear the ISR status bits for a given DMA stream. More...
 
void DMA1_Stream0_IRQHandler (void)
 
void DMA1_Stream1_IRQHandler (void)
 
void DMA1_Stream2_IRQHandler (void)
 
void DMA1_Stream3_IRQHandler (void)
 
void DMA1_Stream4_IRQHandler (void)
 
void DMA1_Stream5_IRQHandler (void)
 
void DMA1_Stream6_IRQHandler (void)
 
void DMA1_Stream7_IRQHandler (void)
 
void DMA2_Stream0_IRQHandler (void)
 
void DMA2_Stream1_IRQHandler (void)
 
void DMA2_Stream2_IRQHandler (void)
 
void DMA2_Stream3_IRQHandler (void)
 
void DMA2_Stream4_IRQHandler (void)
 
void DMA2_Stream5_IRQHandler (void)
 
void DMA2_Stream6_IRQHandler (void)
 
void DMA2_Stream7_IRQHandler (void)
 

Macro Definition Documentation

◆ _DMA1

#define _DMA1   (&dma1);

Definition at line 211 of file dma.h.

◆ _DMA2

#define _DMA2   (&dma2);

Definition at line 212 of file dma.h.

◆ DMA_CR_CH0

#define DMA_CR_CH0   (0x0 << 25)

Definition at line 98 of file dma.h.

◆ DMA_CR_CH1

#define DMA_CR_CH1   (0x1 << 25)

Definition at line 99 of file dma.h.

◆ DMA_CR_CH2

#define DMA_CR_CH2   (0x2 << 25)

Definition at line 100 of file dma.h.

◆ DMA_CR_CH3

#define DMA_CR_CH3   (0x3 << 25)

Definition at line 101 of file dma.h.

◆ DMA_CR_CH4

#define DMA_CR_CH4   (0x4 << 25)

Definition at line 102 of file dma.h.

◆ DMA_CR_CH5

#define DMA_CR_CH5   (0x5 << 25)

Definition at line 103 of file dma.h.

◆ DMA_CR_CH6

#define DMA_CR_CH6   (0x6 << 25)

Definition at line 104 of file dma.h.

◆ DMA_CR_CH7

#define DMA_CR_CH7   (0x7 << 25)

Definition at line 105 of file dma.h.

◆ DMA_CR_CIRC

#define DMA_CR_CIRC   (0x1 << 8)

Definition at line 136 of file dma.h.

◆ DMA_CR_CT0

#define DMA_CR_CT0   (0x0 << 19)

Definition at line 114 of file dma.h.

◆ DMA_CR_CT1

#define DMA_CR_CT1   (0x1 << 19)

Definition at line 115 of file dma.h.

◆ DMA_CR_DBM

#define DMA_CR_DBM   (0x1 << 18)

Definition at line 116 of file dma.h.

◆ DMA_CR_DIR_M2M

#define DMA_CR_DIR_M2M   (0x2 << 6)

Definition at line 139 of file dma.h.

◆ DMA_CR_DIR_M2P

#define DMA_CR_DIR_M2P   (0x1 << 6)

Definition at line 138 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_CR_DIR_P2M

#define DMA_CR_DIR_P2M   (0x0 << 6)

Definition at line 137 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_CR_DMEIE

#define DMA_CR_DMEIE   (0x1 << 1)

Definition at line 145 of file dma.h.

Referenced by dma_detach_interrupt().

◆ DMA_CR_EN

#define DMA_CR_EN   (0x1)

Definition at line 146 of file dma.h.

Referenced by dma_disable(), dma_enable(), dma_init(), dma_init_transfer(), and dma_is_stream_enabled().

◆ DMA_CR_HTIE

#define DMA_CR_HTIE   (0x1 << 3)

Definition at line 143 of file dma.h.

Referenced by dma_detach_interrupt().

◆ DMA_CR_MBURST0

#define DMA_CR_MBURST0   (0x0 << 23)

Definition at line 106 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_CR_MBURST16

#define DMA_CR_MBURST16   (0x3 << 23)

Definition at line 109 of file dma.h.

◆ DMA_CR_MBURST4

#define DMA_CR_MBURST4   (0x1 << 23)

Definition at line 107 of file dma.h.

◆ DMA_CR_MBURST8

#define DMA_CR_MBURST8   (0x2 << 23)

Definition at line 108 of file dma.h.

◆ DMA_CR_MINC

#define DMA_CR_MINC   (0x1 << 10)

Definition at line 134 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_CR_MSIZE_16BITS

#define DMA_CR_MSIZE_16BITS   (0x1 << 13)

Definition at line 127 of file dma.h.

◆ DMA_CR_MSIZE_32BITS

#define DMA_CR_MSIZE_32BITS   (0x2 << 13)

Definition at line 128 of file dma.h.

◆ DMA_CR_MSIZE_8BITS

#define DMA_CR_MSIZE_8BITS   (0x0 << 13)

Definition at line 126 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_CR_PBURST0

#define DMA_CR_PBURST0   (0x0 << 21)

Definition at line 110 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_CR_PBURST16

#define DMA_CR_PBURST16   (0x3 << 21)

Definition at line 113 of file dma.h.

◆ DMA_CR_PBURST4

#define DMA_CR_PBURST4   (0x1 << 21)

Definition at line 111 of file dma.h.

◆ DMA_CR_PBURST8

#define DMA_CR_PBURST8   (0x2 << 21)

Definition at line 112 of file dma.h.

◆ DMA_CR_PFCTRL

#define DMA_CR_PFCTRL   (0x1 << 5)

Definition at line 141 of file dma.h.

◆ DMA_CR_PINC

#define DMA_CR_PINC   (0x1 << 9)

Definition at line 135 of file dma.h.

◆ DMA_CR_PINCOS

#define DMA_CR_PINCOS   (0x1 << 15)

Definition at line 124 of file dma.h.

◆ DMA_CR_PL_HIGH

#define DMA_CR_PL_HIGH   (0x2 << 16)

Definition at line 120 of file dma.h.

◆ DMA_CR_PL_LOW

#define DMA_CR_PL_LOW   (0x0 << 16)

Definition at line 118 of file dma.h.

◆ DMA_CR_PL_MASK

#define DMA_CR_PL_MASK   (0x3 << 16)

Definition at line 122 of file dma.h.

◆ DMA_CR_PL_MEDIUM

#define DMA_CR_PL_MEDIUM   (0x1 << 16)

Definition at line 119 of file dma.h.

◆ DMA_CR_PL_VERY_HIGH

#define DMA_CR_PL_VERY_HIGH   (0x3 << 16)

Definition at line 121 of file dma.h.

◆ DMA_CR_PSIZE_16BITS

#define DMA_CR_PSIZE_16BITS   (0x1 << 11)

Definition at line 131 of file dma.h.

◆ DMA_CR_PSIZE_32BITS

#define DMA_CR_PSIZE_32BITS   (0x2 << 11)

Definition at line 132 of file dma.h.

◆ DMA_CR_PSIZE_8BITS

#define DMA_CR_PSIZE_8BITS   (0x0 << 11)

Definition at line 130 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_CR_TCIE

#define DMA_CR_TCIE   (0x1 << 4)

Definition at line 142 of file dma.h.

Referenced by dma_detach_interrupt(), and F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_CR_TEIE

#define DMA_CR_TEIE   (0x1 << 2)

Definition at line 144 of file dma.h.

Referenced by dma_detach_interrupt().

◆ DMA_FIFOMode_Disable

#define DMA_FIFOMode_Disable   ((uint32_t)0x00000000)

Definition at line 154 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_FIFOMode_Enable

#define DMA_FIFOMode_Enable   ((uint32_t)0x00000004)

Definition at line 155 of file dma.h.

◆ DMA_FIFOThreshold_1QuarterFull

#define DMA_FIFOThreshold_1QuarterFull   ((uint32_t)0x00000000)

Definition at line 157 of file dma.h.

◆ DMA_FIFOThreshold_3QuartersFull

#define DMA_FIFOThreshold_3QuartersFull   ((uint32_t)0x00000002)

Definition at line 159 of file dma.h.

◆ DMA_FIFOThreshold_Full

#define DMA_FIFOThreshold_Full   ((uint32_t)0x00000003)

Definition at line 160 of file dma.h.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

◆ DMA_FIFOThreshold_HalfFull

#define DMA_FIFOThreshold_HalfFull   ((uint32_t)0x00000001)

Definition at line 158 of file dma.h.

◆ DMA_FLAG_DMEIF

#define DMA_FLAG_DMEIF   ((uint32_t)0x04)

Definition at line 149 of file dma.h.

◆ DMA_FLAG_FEIF

#define DMA_FLAG_FEIF   ((uint32_t)0x01)

Definition at line 148 of file dma.h.

◆ DMA_FLAG_HTIF

#define DMA_FLAG_HTIF   ((uint32_t)0x10)

Definition at line 151 of file dma.h.

◆ DMA_FLAG_TCIF

#define DMA_FLAG_TCIF   ((uint32_t)0x20)

Definition at line 152 of file dma.h.

◆ DMA_FLAG_TEIF

#define DMA_FLAG_TEIF   ((uint32_t)0x08)

Definition at line 150 of file dma.h.

◆ DMA_Priority_High

#define DMA_Priority_High   ((uint32_t)0x00020000)

Definition at line 164 of file dma.h.

◆ DMA_Priority_Low

#define DMA_Priority_Low   ((uint32_t)0x00000000)

Definition at line 162 of file dma.h.

◆ DMA_Priority_Medium

#define DMA_Priority_Medium   ((uint32_t)0x00010000)

Definition at line 163 of file dma.h.

◆ DMA_Priority_VeryHigh

#define DMA_Priority_VeryHigh   ((uint32_t)0x00030000)

Definition at line 165 of file dma.h.

Typedef Documentation

◆ dma_channel

typedef enum dma_channel dma_channel

DMA channels.

Notes:

  • This is also the dma_tube type for STM32F1.
  • Channel 0 is not available on all STM32 series.
See also
dma_tube

◆ dma_dev

typedef struct dma_dev dma_dev

Encapsulates state related to a DMA channel interrupt. DMA device type

◆ dma_mode_flags

Flags for DMA transfer configuration.

◆ dma_reg_map

typedef struct dma_reg_map dma_reg_map

DMA register map type.

◆ dma_stream

typedef enum Dma_stream dma_stream

DMA channels переписано по образу и подобию либы от СТ, позволяющей не возиться с выяснением какой поток на каком ДМА

◆ dma_stream_t

typedef struct dma_stream_t dma_stream_t

DMA stream type.

◆ dma_xfer_size

Source and destination transfer sizes.

Enumeration Type Documentation

◆ dma_channel

DMA channels.

Notes:

  • This is also the dma_tube type for STM32F1.
  • Channel 0 is not available on all STM32 series.
See also
dma_tube
Enumerator
DMA_CH0 

Channel 0

DMA_CH1 

Channel 1

DMA_CH2 

Channel 2

DMA_CH3 

Channel 3

DMA_CH4 

Channel 4

DMA_CH5 

Channel 5

DMA_CH6 

Channel 6

DMA_CH7 

Channel 7

Definition at line 68 of file dma.h.

◆ dma_mode_flags

Flags for DMA transfer configuration.

Enumerator
DMA_MEM_2_MEM 

Memory to memory mode

DMA_MINC_MODE 

Auto-increment memory address

DMA_PINC_MODE 

Auto-increment peripheral address

DMA_CIRC_MODE 

Circular mode

DMA_FROM_MEM 

Read from memory to peripheral

DMA_TRNS_ERR 

Interrupt on transfer error

DMA_HALF_TRNS 

Interrupt on half-transfer

DMA_TRNS_CMPLT 

Interrupt on transfer completion

Definition at line 222 of file dma.h.

◆ Dma_stream

enum Dma_stream

DMA channels переписано по образу и подобию либы от СТ, позволяющей не возиться с выяснением какой поток на каком ДМА

Enumerator
DMA1_STREAM0 

Stream 0

DMA1_STREAM1 

Stream 1

DMA1_STREAM2 

Stream 2

DMA1_STREAM3 

Stream 3

DMA1_STREAM4 

Stream 4

DMA1_STREAM5 

Stream 5

DMA1_STREAM6 

Stream 6

DMA1_STREAM7 

Stream 7

DMA2_STREAM0 

Stream 0

DMA2_STREAM1 

Stream 1

DMA2_STREAM2 

Stream 2

DMA2_STREAM3 

Stream 3

DMA2_STREAM4 

Stream 4

DMA2_STREAM5 

Stream 5

DMA2_STREAM6 

Stream 6

DMA2_STREAM7 

Stream 7

NUM_DMA_STREAMS 

Definition at line 170 of file dma.h.

◆ dma_xfer_size

Source and destination transfer sizes.

Enumerator
DMA_SIZE_8BITS 

8-bit transfers

DMA_SIZE_16BITS 

16-bit transfers

DMA_SIZE_32BITS 

32-bit transfers

Definition at line 234 of file dma.h.

Function Documentation

◆ DMA1_Stream0_IRQHandler()

void DMA1_Stream0_IRQHandler ( void  )

Definition at line 339 of file dma.c.

Here is the call graph for this function:

◆ DMA1_Stream1_IRQHandler()

void DMA1_Stream1_IRQHandler ( void  )

Definition at line 343 of file dma.c.

Here is the call graph for this function:

◆ DMA1_Stream2_IRQHandler()

void DMA1_Stream2_IRQHandler ( void  )

Definition at line 347 of file dma.c.

Here is the call graph for this function:

◆ DMA1_Stream3_IRQHandler()

void DMA1_Stream3_IRQHandler ( void  )

Definition at line 351 of file dma.c.

Here is the call graph for this function:

◆ DMA1_Stream4_IRQHandler()

void DMA1_Stream4_IRQHandler ( void  )

Definition at line 355 of file dma.c.

Here is the call graph for this function:

◆ DMA1_Stream5_IRQHandler()

void DMA1_Stream5_IRQHandler ( void  )

Definition at line 359 of file dma.c.

Here is the call graph for this function:

◆ DMA1_Stream6_IRQHandler()

void DMA1_Stream6_IRQHandler ( void  )

Definition at line 363 of file dma.c.

Here is the call graph for this function:

◆ DMA1_Stream7_IRQHandler()

void DMA1_Stream7_IRQHandler ( void  )

Definition at line 367 of file dma.c.

Here is the call graph for this function:

◆ DMA2_Stream0_IRQHandler()

void DMA2_Stream0_IRQHandler ( void  )

Definition at line 371 of file dma.c.

Here is the call graph for this function:

◆ DMA2_Stream1_IRQHandler()

void DMA2_Stream1_IRQHandler ( void  )

Definition at line 375 of file dma.c.

Here is the call graph for this function:

◆ DMA2_Stream2_IRQHandler()

void DMA2_Stream2_IRQHandler ( void  )

Definition at line 379 of file dma.c.

Here is the call graph for this function:

◆ DMA2_Stream3_IRQHandler()

void DMA2_Stream3_IRQHandler ( void  )

Definition at line 383 of file dma.c.

Here is the call graph for this function:

◆ DMA2_Stream4_IRQHandler()

void DMA2_Stream4_IRQHandler ( void  )

Definition at line 387 of file dma.c.

Here is the call graph for this function:

◆ DMA2_Stream5_IRQHandler()

void DMA2_Stream5_IRQHandler ( void  )

Definition at line 391 of file dma.c.

Here is the call graph for this function:

◆ DMA2_Stream6_IRQHandler()

void DMA2_Stream6_IRQHandler ( void  )

Definition at line 395 of file dma.c.

Here is the call graph for this function:

◆ DMA2_Stream7_IRQHandler()

void DMA2_Stream7_IRQHandler ( void  )

Definition at line 399 of file dma.c.

Here is the call graph for this function:

◆ dma_attach_interrupt()

void dma_attach_interrupt ( dma_stream  stream,
Handler  handler,
uint8_t  flag 
)

Attach an interrupt to a DMA transfer.

Interrupts are enabled using appropriate mode flags in dma_setup_transfer().

Parameters
devDMA device
streamStream to attach handler to
handlerInterrupt handler to call when channel interrupt fires.
See also
dma_setup_transfer()
dma_detach_interrupt()

Definition at line 108 of file dma.c.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dma_clear_isr_bits()

void dma_clear_isr_bits ( dma_stream  stream)

Clear the ISR status bits for a given DMA stream.

Parameters
devDMA device
streamStream whose ISR bits to clear.

Definition at line 237 of file dma.c.

Referenced by F4Light::SPIDevice::disable_dma(), dispatch_handler(), and F4Light::SPIDevice::setup_dma_transfer().

Here is the caller graph for this function:

◆ dma_detach_interrupt()

void dma_detach_interrupt ( dma_stream  stream)

Detach a DMA transfer interrupt handler.

After calling this function, the given channel's interrupts will be disabled.

Parameters
devDMA device
streamStream whose handler to detach Clears interrupt enable bits in the channel's CCR register.
See also
dma_attach_interrupt()

Definition at line 132 of file dma.c.

Referenced by F4Light::SPIDevice::disable_dma().

Here is the caller graph for this function:

◆ dma_disable()

void dma_disable ( dma_stream  stream)

Definition at line 219 of file dma.c.

Referenced by F4Light::SPIDevice::disable_dma().

Here is the caller graph for this function:

◆ dma_enable()

void dma_enable ( dma_stream  stream)

Definition at line 213 of file dma.c.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

Here is the caller graph for this function:

◆ dma_get_isr_bits()

uint8_t dma_get_isr_bits ( dma_stream  stream)

Get the ISR status bits for a DMA stream.

The bits are returned right-aligned, in the following order: transfer error flag, half-transfer flag, transfer complete flag, global interrupt flag.

Parameters
devDMA device
streamStream whose ISR bits to return.

Definition at line 272 of file dma.c.

◆ dma_init()

void dma_init ( dma_stream  stream)

Initialize a DMA device.

Parameters
devDevice to initialize.

Definition at line 85 of file dma.c.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

Here is the caller graph for this function:

◆ dma_init_transfer()

void dma_init_transfer ( dma_stream  stream,
DMA_InitType  
)

Definition at line 144 of file dma.c.

Referenced by F4Light::SPIDevice::setup_dma_transfer().

Here is the caller graph for this function:

◆ dma_is_stream_enabled()

uint8_t dma_is_stream_enabled ( dma_stream  stream)

Check if a DMA stream is enabled.

Parameters
devDMA device
streamStream whose enabled bit to check.

Definition at line 230 of file dma.c.

Referenced by F4Light::SPIDevice::get_dma_ready().

Here is the caller graph for this function:

◆ dma_set_num_transfers()

void dma_set_num_transfers ( dma_stream  stream,
uint16_t  num_transfers 
)

Definition at line 206 of file dma.c.

◆ dma_setup_transfer()

void dma_setup_transfer ( dma_stream  stream,
__IO void *  peripheral_address,
__IO void *  memory_address0,
uint32_t  flags,
uint32_t  fifo_flags 
)

◆ dma_setup_transfer_mm()

void dma_setup_transfer_mm ( dma_stream  stream,
__IO void *  memory_address0,
__IO void *  memory_address1,
uint32_t  flags,
uint32_t  fifo_flags 
)