no-OS
stm32_dma.h
Go to the documentation of this file.
1 /***************************************************************************/
35 #ifndef STM32_DMA_H_
36 #define STM32_DMA_H_
37 
38 #include "no_os_dma.h"
39 #include "stm32_hal.h"
40 
49 };
50 
58 };
59 
65  /* DMA Handle */
66  DMA_HandleTypeDef *hdma;
67  /* Channel Number */
68  uint32_t ch_num;
69  /* Memory Increment */
71  /* Peripheral Increment */
73  /* Memory Data Alignment */
75  /* Peripheral Data Alignment */
77  /* DMA Mode */
79  /* Source Address for the data */
80  uint8_t* src;
81  /* Destination Address for the data */
82  uint8_t* dst;
83  /* Transfer length in Bytes */
84  uint32_t length;
85 };
86 
88  /* DMA Channel descriptor */
90 };
91 
93  /* DMA Channel Descriptor */
95 };
96 
97 extern const struct no_os_dma_platform_ops stm32_dma_ops;
98 
99 #endif
100 
no_os_alloc.h
no_os_dma_desc::sg_handler
void(* sg_handler)(void *)
Definition: no_os_dma.h:164
stm32_dma_init
int stm32_dma_init(struct no_os_dma_desc **desc, const struct no_os_dma_init_param *param)
Initialize a DMA controller.
Definition: stm32_dma.c:193
stm32_dma.h
Platform independent function definitions and data types for the DMA API.
stm32_dma_xfer_start
int stm32_dma_xfer_start(struct no_os_dma_desc *desc, struct no_os_dma_ch *chan)
Start a DMA transfer for a specific channel .
Definition: stm32_dma.c:256
no_os_get_time
struct no_os_time no_os_get_time(void)
Get current time.
Definition: stm32_delay.c:82
no_os_dma_init_param
Initialization parameter for the DMA controller.
Definition: no_os_dma.h:171
stm32_dma_init_param
Definition: stm32_dma.h:87
stm32_dma_desc
Definition: stm32_dma.h:92
stm32_dma_channel::mem_data_alignment
enum stm32_dma_data_alignment mem_data_alignment
Definition: stm32_dma.h:74
no_os_dma_desc::id
uint32_t id
Definition: no_os_dma.h:138
no_os_dma_ch::irq_num
uint32_t irq_num
Definition: no_os_dma.h:115
no_os_delay.h
Header file of Delay functions.
DEV_TO_MEM
@ DEV_TO_MEM
Definition: no_os_dma.h:52
stm32_dma_ops
const struct no_os_dma_platform_ops stm32_dma_ops
stm32 platform specific DMA platform ops structure
Definition: stm32_dma.c:330
stm32_dma_channel::per_increment
bool per_increment
Definition: stm32_dma.h:72
no_os_time
Structure holding time data (seconds, microseconds).
Definition: no_os_delay.h:47
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
stm32_dma_channel::hdma
DMA_HandleTypeDef * hdma
Definition: stm32_dma.h:66
stm32_dma_mode
stm32_dma_mode
DMA Data Modes.
Definition: stm32_dma.h:55
no_os_dma_init_param::num_ch
uint32_t num_ch
Definition: no_os_dma.h:175
stm32_dma_channel::src
uint8_t * src
Definition: stm32_dma.h:80
no_os_dma_init_param::id
uint32_t id
Definition: no_os_dma.h:173
stm32_dma_ops
const struct no_os_dma_platform_ops stm32_dma_ops
stm32 platform specific DMA platform ops structure
Definition: stm32_dma.c:330
no_os_error.h
Error codes definition.
no_os_udelay
void no_os_udelay(uint32_t usecs)
Generate microseconds delay.
Definition: stm32_delay.c:61
no_os_dma_ch
Describes the state of a DMA channel.
Definition: no_os_dma.h:107
stm32_irq.h
Header file for stm32 irq specifics.
no_os_dma_platform_ops
Definition: no_os_dma.h:241
no_os_dma_xfer_desc::dst
uint8_t * dst
Definition: no_os_dma.h:75
stm32_dma_channel
STM32 DMA Channels.
Definition: stm32_dma.h:64
MEM_TO_MEM
@ MEM_TO_MEM
Definition: no_os_dma.h:50
no_os_irq_init_param::irq_ctrl_id
uint32_t irq_ctrl_id
Definition: no_os_irq.h:109
stm32_dma_remove
int stm32_dma_remove(struct no_os_dma_desc *desc)
Free the resources allocated for a DMA descriptor.
Definition: stm32_dma.c:314
stm32_dma_init_param::chn
struct stm32_dma_channel * chn
Definition: stm32_dma.h:89
stm32_dma_channel::length
uint32_t length
Definition: stm32_dma.h:84
stm32_dma_desc::chn
struct stm32_dma_channel * chn
Definition: stm32_dma.h:94
stm32_irq_ops
const struct no_os_irq_platform_ops stm32_irq_ops
stm32 specific IRQ platform ops structure
Definition: stm32_irq.c:582
no_os_irq_ctrl_init
int32_t no_os_irq_ctrl_init(struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
Initialize the IRQ interrupts.
Definition: no_os_irq.c:45
no_os_dma_xfer_desc
It's used to setup a generic DMA transfer.
Definition: no_os_dma.h:71
no_os_dma_desc::irq_ctrl
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: no_os_dma.h:151
no_os_dma_desc::num_ch
uint32_t num_ch
Definition: no_os_dma.h:140
no_os_dma_platform_ops::dma_init
int(* dma_init)(struct no_os_dma_desc **, struct no_os_dma_init_param *)
Definition: no_os_dma.h:243
no_os_dma_ch::free
bool free
Definition: no_os_dma.h:111
stm32_dma_data_alignment
stm32_dma_data_alignment
DMA Data alignment.
Definition: stm32_dma.h:45
DMA_CIRCULAR_MODE
@ DMA_CIRCULAR_MODE
Definition: stm32_dma.h:57
stm32_dma_config_xfer
int stm32_dma_config_xfer(struct no_os_dma_ch *channel, struct no_os_dma_xfer_desc *xfer)
Configure a DMA channel for a transfer.
Definition: stm32_dma.c:54
no_os_dma_xfer_desc::xfer_type
enum no_os_dma_xfer_type xfer_type
Definition: no_os_dma.h:79
stm32_dma_channel::dst
uint8_t * dst
Definition: stm32_dma.h:82
stm32_dma_xfer_abort
int stm32_dma_xfer_abort(struct no_os_dma_desc *desc, struct no_os_dma_ch *chan)
Disable a DMA channel.
Definition: stm32_dma.c:287
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
no_os_time::us
unsigned int us
Definition: no_os_delay.h:48
NULL
#define NULL
Definition: wrapper.h:64
DATA_ALIGN_BYTE
@ DATA_ALIGN_BYTE
Definition: stm32_dma.h:46
no_os_dma_xfer_desc::src
uint8_t * src
Definition: no_os_dma.h:73
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Generate miliseconds delay.
Definition: stm32_delay.c:73
no_os_irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:107
DATA_ALIGN_HALF_WORD
@ DATA_ALIGN_HALF_WORD
Definition: stm32_dma.h:47
no_os_time::s
unsigned int s
Definition: no_os_delay.h:48
no_os_irq_ctrl_remove
int32_t no_os_irq_ctrl_remove(struct no_os_irq_ctrl_desc *desc)
Free the resources allocated by no_os_irq_ctrl_init().
Definition: no_os_irq.c:71
no_os_dma_ch::extra
void * extra
Definition: no_os_dma.h:120
stm32_dma_channel::ch_num
uint32_t ch_num
Definition: stm32_dma.h:68
DATA_ALIGN_WORD
@ DATA_ALIGN_WORD
Definition: stm32_dma.h:48
no_os_dma_init_param::sg_handler
void(* sg_handler)(void *)
Definition: no_os_dma.h:185
MEM_TO_DEV
@ MEM_TO_DEV
Definition: no_os_dma.h:51
DMA_NORMAL_MODE
@ DMA_NORMAL_MODE
Definition: stm32_dma.h:56
L
#define L(x)
Definition: ad9144.h:1258
no_os_dma_desc::channels
struct no_os_dma_ch * channels
Definition: no_os_dma.h:142
stm32_dma_channel::per_data_alignment
enum stm32_dma_data_alignment per_data_alignment
Definition: stm32_dma.h:76
stm32_dma_channel::mem_increment
bool mem_increment
Definition: stm32_dma.h:70
stm32_hal.h
no_os_dma_xfer_desc::length
uint32_t length
Definition: no_os_dma.h:77
no_os_dma.h
Platform independent function definitions and data types for the DMA API.
stm32_dma_channel::dma_mode
enum stm32_dma_mode dma_mode
Definition: stm32_dma.h:78
no_os_dma_desc
Describes the state of the DMA controller.
Definition: no_os_dma.h:136