no-OS
maxim_dma.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef MAXIM_DMA_H_
34 #define MAXIM_DMA_H_
35 
36 #include <stdint.h>
37 #include "no_os_dma.h"
38 #include "dma.h"
39 
40 #if TARGET_NUM == 32650
41 #include "max32650.h"
42 #elif TARGET_NUM == 32655
43 #include "max32655.h"
44 #elif TARGET_NUM == 32660
45 #include "max32660.h"
46 #elif TARGET_NUM == 32665
47 #include "max32665.h"
48 #elif TARGET_NUM == 32690
49 #include "max32690.h"
50 #elif TARGET_NUM == 78000
51 #include "max78000.h"
52 #endif
53 
54 #define MAX_DMA ((struct max_dma_regs *)(MXC_DMA))
55 #define MAX_DMA_IRQ_EN_ALL_CH NO_OS_GENMASK(15, 0)
56 #define MAX_DMA_ENABLED NO_OS_BIT(0)
57 #define MAX_DMA_ENABLE NO_OS_BIT(0)
58 #define MAX_DMA_IRQ_CTZ_EN NO_OS_BIT(31)
59 #define MAX_DMA_REQSEL_MASK NO_OS_GENMASK(9, 4)
60 #define MAX_DMA_DST_INC NO_OS_BIT(22)
61 #define MAX_DMA_SRC_INC NO_OS_BIT(18)
62 
64  volatile uint32_t cfg;
65  volatile uint32_t st;
66  volatile uint32_t src;
67  volatile uint32_t dst;
68  volatile uint32_t cnt;
69  volatile uint32_t src_rld;
70  volatile uint32_t dst_rld;
71  volatile uint32_t cnt_rld;
72 };
73 
74 struct max_dma_regs {
75  volatile uint32_t cn;
76  volatile const uint32_t intr;
77  const uint32_t rsv_0x8_0xff[62];
78  volatile struct max_dma_ch_regs ch[MXC_DMA_CHANNELS];
79 };
80 
82 
91 static inline uint32_t max_dma_get_irq(uint32_t id, uint32_t ch)
92 {
93 #if TARGET_NUM == 32665
94  if (!id)
95  return MXC_DMA0_CH_GET_IRQ(ch);
96 
97  return MXC_DMA1_CH_GET_IRQ(ch);
98 #else
99  return MXC_DMA_CH_GET_IRQ(ch);
100 #endif
101 }
102 
103 #endif
MAX_DMA_DST_INC
#define MAX_DMA_DST_INC
Definition: maxim_dma.h:60
max_dma_ch_regs::dst_rld
volatile uint32_t dst_rld
Definition: maxim_dma.h:70
MAX_DMA_SRC_INC
#define MAX_DMA_SRC_INC
Definition: maxim_dma.h:61
no_os_alloc.h
max_dma_regs::rsv_0x8_0xff
const uint32_t rsv_0x8_0xff[62]
Definition: maxim_dma.h:77
max_dma_ch_regs::src_rld
volatile uint32_t src_rld
Definition: maxim_dma.h:69
no_os_dma_init_param
Initialization parameter for the DMA controller.
Definition: no_os_dma.h:171
no_os_dma_ch::id
uint32_t id
Definition: no_os_dma.h:109
no_os_irq.h
Header file of IRQ interface.
no_os_dma_desc::id
uint32_t id
Definition: no_os_dma.h:138
max_dma_ch_regs
Definition: maxim_dma.h:63
max_dma_ch_regs::cfg
volatile uint32_t cfg
Definition: maxim_dma.h:64
no_os_dma_ch::irq_num
uint32_t irq_num
Definition: no_os_dma.h:115
DEV_TO_MEM
@ DEV_TO_MEM
Definition: no_os_dma.h:52
no_os_dma_desc::extra
void * extra
Definition: no_os_dma.h:153
max_dma_regs
Definition: maxim_dma.h:74
max_dma_regs::cn
volatile uint32_t cn
Definition: maxim_dma.h:75
MAX_DMA_ENABLED
#define MAX_DMA_ENABLED
Definition: maxim_dma.h:56
max_dma_ch_regs::src
volatile uint32_t src
Definition: maxim_dma.h:66
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
MAX_DMA_IRQ_CTZ_EN
#define MAX_DMA_IRQ_CTZ_EN
Definition: maxim_dma.h:58
no_os_dma_init_param::num_ch
uint32_t num_ch
Definition: no_os_dma.h:175
no_os_dma_init_param::id
uint32_t id
Definition: no_os_dma.h:173
max_dma_ops
struct no_os_dma_platform_ops max_dma_ops
Maxim platform specific callbacks for the DMA API.
Definition: maxim_dma.c:273
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
no_os_error.h
Error codes definition.
max_dma_regs::intr
const volatile uint32_t intr
Definition: maxim_dma.h:76
no_os_dma_ch
Describes the state of a DMA channel.
Definition: no_os_dma.h:107
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
MEM_TO_MEM
@ MEM_TO_MEM
Definition: no_os_dma.h:50
max_irq_ops
const struct no_os_irq_platform_ops max_irq_ops
maxim specific IRQ platform ops structure
Definition: maxim_irq.c:657
no_os_irq_init_param::irq_ctrl_id
uint32_t irq_ctrl_id
Definition: no_os_irq.h:109
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
max_dma_ops
struct no_os_dma_platform_ops max_dma_ops
Maxim platform specific callbacks for the DMA API.
Definition: maxim_dma.c:273
no_os_dma_desc::irq_ctrl
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: no_os_dma.h:151
MAX_DMA_GCR_RST_POS
#define MAX_DMA_GCR_RST_POS
Definition: maxim_dma.c:43
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
no_os_dma_xfer_desc::xfer_type
enum no_os_dma_xfer_type xfer_type
Definition: no_os_dma.h:79
MAX_DMA_ENABLE
#define MAX_DMA_ENABLE
Definition: maxim_dma.h:57
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
NULL
#define NULL
Definition: wrapper.h:64
max_dma_ch_regs::cnt
volatile uint32_t cnt
Definition: maxim_dma.h:68
MAX_DMA_IRQ_EN_ALL_CH
#define MAX_DMA_IRQ_EN_ALL_CH
Definition: maxim_dma.h:55
max_dma_ch_regs::st
volatile uint32_t st
Definition: maxim_dma.h:65
max_dma_ch_regs::dst
volatile uint32_t dst
Definition: maxim_dma.h:67
no_os_dma_xfer_desc::src
uint8_t * src
Definition: no_os_dma.h:73
no_os_irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:107
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
max_dma_regs::ch
volatile struct max_dma_ch_regs ch[MXC_DMA_CHANNELS]
Definition: maxim_dma.h:78
max_dma_ch_regs::cnt_rld
volatile uint32_t cnt_rld
Definition: maxim_dma.h:71
MEM_TO_DEV
@ MEM_TO_DEV
Definition: no_os_dma.h:51
no_os_dma_desc::channels
struct no_os_dma_ch * channels
Definition: no_os_dma.h:142
no_os_util.h
Header file of utility functions.
MAX_DMA_REQSEL_MASK
#define MAX_DMA_REQSEL_MASK
Definition: maxim_dma.h:59
MAX_DMA
#define MAX_DMA
Definition: maxim_dma.h:54
no_os_dma_ch::sync_lock
bool sync_lock
Definition: no_os_dma.h:129
maxim_dma.h
Maxim platform specific header DMA API.
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.
no_os_dma_desc
Describes the state of the DMA controller.
Definition: no_os_dma.h:136