WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hal_dmac_v151_regs_op.h
浏览该文件的文档.
1
10#ifndef HAL_DMAC_V151_REGS_OP_H
11#define HAL_DMAC_V151_REGS_OP_H
12
13#include <stdint.h>
14#include <stdbool.h>
15#include "common_def.h"
16#include "errcode.h"
18#include "dma_porting.h"
19
20#ifdef __cplusplus
21#if __cplusplus
22extern "C" {
23#endif /* __cplusplus */
24#endif /* __cplusplus */
25
33#if defined(CONFIG_DMA_SUPPORT_SMDMA)
34extern uintptr_t g_sdma_regs;
35#endif /* CONFIG_DMA_SUPPORT_SMDMA */
36
41static inline void hal_dma_cfg_set_en(uint32_t val, dma_v151_regs_t *dma_regs)
42{
43 dma_v151_cfg_reg_data_t dma_cfg_reg;
44 dma_cfg_reg.d32 = ((dma_v151_regs_t *)dma_regs)->configuration.d32;
45 dma_cfg_reg.b.dma_enable = val;
46 ((dma_v151_regs_t *)dma_regs)->configuration = dma_cfg_reg;
47}
48
54static inline void hal_dma_ch_cfg_set_ch_en(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
55{
56 dma_cfg_data_t ch_data;
57 ch_data.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg.d32;
58 ch_data.b.ch_enable = val;
59 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg = ch_data;
60}
61
67static inline uint32_t hal_dma_ctrl_get_tranf_size(dma_channel_t channel, dma_v151_regs_t *dma_regs)
68{
69 dma_ctrl_data_t dma_ctrl;
70 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
71 return dma_ctrl.b.transfersize;
72}
73
79static inline void hal_dma_ctrl_set_tranf_size(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
80{
81 dma_ctrl_data_t dma_ctrl;
82 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
83 dma_ctrl.b.transfersize = val;
84 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
85}
86
92static inline void hal_dma_ctrl_set_dst_tr_width(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
93{
94 dma_ctrl_data_t dma_ctrl;
95 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
96 dma_ctrl.b.dwsize = val;
97 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
98}
99
105static inline void hal_dma_ctrl_set_src_tr_width(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
106{
107 dma_ctrl_data_t dma_ctrl;
108 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
109 dma_ctrl.b.swsize = val;
110 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
111}
112
118static inline void hal_dma_ctrl_set_dest_inc(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
119{
120 dma_ctrl_data_t dma_ctrl;
121 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
122 dma_ctrl.b.dest_inc = val;
123 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
124}
125
131static inline void hal_dma_ctrl_set_src_inc(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
132{
133 dma_ctrl_data_t dma_ctrl;
134 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
135 dma_ctrl.b.src_inc = val;
136 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
137}
138
144static inline void hal_dma_ctrl_set_src_bsize(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
145{
146 dma_ctrl_data_t dma_ctrl;
147 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
148 dma_ctrl.b.sbsize = val;
149 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
150}
151
157static inline void hal_dma_ctrl_set_dest_bsize(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
158{
159 dma_ctrl_data_t dma_ctrl;
160 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
161 dma_ctrl.b.dbsize = val;
162 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
163}
164
170static inline void hal_dma_ctrl_set_dest_ms_sel(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
171{
172 dma_ctrl_data_t dma_ctrl;
173 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
174 dma_ctrl.b.dest_ms_sel = val;
175 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
176}
177
183static inline void hal_dma_ctrl_set_src_ms_sel(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
184{
185 dma_ctrl_data_t dma_ctrl;
186 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
187 dma_ctrl.b.src_ms_sel = val;
188 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
189}
190
196static inline void hal_dma_ctrl_set_tc_int_en(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
197{
198 dma_ctrl_data_t dma_ctrl;
199 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
200 dma_ctrl.b.tc_int_en = val;
201 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
202}
203
209static inline void hal_dma_cfg_set_int_err_mask(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
210{
211 dma_cfg_data_t dma_cfg;
212 dma_cfg.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg.d32;
213 dma_cfg.b.int_err_mask = val;
214 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg = dma_cfg;
215}
216
222static inline void hal_dma_cfg_set_tc_int_mask(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
223{
224 dma_cfg_data_t dma_cfg;
225 dma_cfg.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg.d32;
226 dma_cfg.b.tc_int_mask = val;
227 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg = dma_cfg;
228}
229
235static inline void hal_dma_cfg_set_fc_tt(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
236{
237 dma_cfg_data_t dma_cfg;
238 dma_cfg.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg.d32;
239 dma_cfg.b.fc_tt = val;
240 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg = dma_cfg;
241}
242
248static inline void hal_dma_cfg_set_dest_per(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
249{
250 dma_cfg_data_t dma_cfg;
251 dma_cfg.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg.d32;
252 dma_cfg.b.dest_per = val;
253 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg = dma_cfg;
254}
255
261static inline void hal_dma_cfg_set_src_per(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
262{
263 dma_cfg_data_t dma_cfg;
264 dma_cfg.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg.d32;
265 dma_cfg.b.src_per = val;
266 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg = dma_cfg;
267}
268
274static inline void hal_dma_ctrl_set_protection(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
275{
276 dma_ctrl_data_t dma_ctrl;
277 dma_ctrl.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl.d32;
278 dma_ctrl.b.protection = val;
279 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].ctrl = dma_ctrl;
280}
281
287static inline void hal_dma_cfg_set_lock(dma_channel_t channel, uint32_t val, dma_v151_regs_t *dma_regs)
288{
289 dma_cfg_data_t dma_cfg;
290 dma_cfg.d32 = ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg.d32;
291 dma_cfg.b.lock = val;
292 ((dma_v151_regs_t *)dma_regs)->ch_config[channel].cfg = dma_cfg;
293}
294
301
308
314
320
327
332#ifdef __cplusplus
333#if __cplusplus
334}
335#endif /* __cplusplus */
336#endif /* __cplusplus */
337
338#endif
void hal_dma_interrupt_clear_tc(dma_channel_t channel, dma_v151_regs_t *dma_regs)
Clear the status of transfer complete interrupt.
Definition hal_dmac_v151_regs_op.c:91
void hal_dma_interrupt_clear_err(dma_channel_t channel, dma_v151_regs_t *dma_regs)
Clear the status of transfer error interrupt.
Definition hal_dmac_v151_regs_op.c:101
bool hal_dma_regs_data_get_int_tc_st(dma_channel_t channel, dma_v151_regs_t *dma_regs)
Get the status of transfer complete interrupt.
Definition hal_dmac_v151_regs_op.c:75
bool hal_dma_regs_data_get_int_err_st(dma_channel_t channel, dma_v151_regs_t *dma_regs)
Get the status of transfer error interrupt.
Definition hal_dmac_v151_regs_op.c:83
uintptr_t g_dma_regs
Definition hal_dma.c:12
bool hal_dma_regs_data_get_ch_en(dma_channel_t channel, dma_v151_regs_t *dma_regs)
Get the status of channel enable.
Definition hal_dmac_v151_regs_op.c:112
dma_channel_t
DMA channel ID.
Definition dma_porting.h:40
Registers associated with DMA.
Definition hal_dmac_v151_regs_def.h:227
unsigned int uintptr_t
Definition td_type.h:65
Channel Configuration Register
Definition hal_dmac_v151_regs_def.h:166
uint32_t src_per
Definition hal_dmac_v151_regs_def.h:169
uint32_t dest_per
Definition hal_dmac_v151_regs_def.h:170
uint32_t int_err_mask
Definition hal_dmac_v151_regs_def.h:172
uint32_t ch_enable
Definition hal_dmac_v151_regs_def.h:168
uint32_t lock
Definition hal_dmac_v151_regs_def.h:174
uint32_t fc_tt
Definition hal_dmac_v151_regs_def.h:171
struct dma_chn_config_t::@93 b
uint32_t tc_int_mask
Definition hal_dmac_v151_regs_def.h:173
uint32_t d32
Definition hal_dmac_v151_regs_def.h:180
Channel Control Register
Definition hal_dmac_v151_regs_def.h:188
uint32_t protection
Definition hal_dmac_v151_regs_def.h:199
uint32_t dest_inc
Definition hal_dmac_v151_regs_def.h:198
uint32_t src_ms_sel
Definition hal_dmac_v151_regs_def.h:195
uint32_t src_inc
Definition hal_dmac_v151_regs_def.h:197
uint32_t dwsize
Definition hal_dmac_v151_regs_def.h:194
uint32_t dbsize
Definition hal_dmac_v151_regs_def.h:192
uint32_t transfersize
Definition hal_dmac_v151_regs_def.h:190
struct dma_chn_control_t::@94 b
uint32_t tc_int_en
Definition hal_dmac_v151_regs_def.h:200
uint32_t sbsize
Definition hal_dmac_v151_regs_def.h:191
uint32_t dest_ms_sel
Definition hal_dmac_v151_regs_def.h:196
uint32_t d32
Definition hal_dmac_v151_regs_def.h:203
uint32_t swsize
Definition hal_dmac_v151_regs_def.h:193
configuration register
Definition hal_dmac_v151_regs_def.h:125
uint32_t dma_enable
Definition hal_dmac_v151_regs_def.h:127
struct dma_config_t::@90 b
uint32_t d32
Definition hal_dmac_v151_regs_def.h:133