gh_dma.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. /*!
  2. *******************************************************************************
  3. **
  4. ** \file gh_dma.h
  5. **
  6. ** \brief DMA Engine Subsystem.
  7. **
  8. ** Copyright: 2012 - 2013 (C) GoKe Microelectronics ShangHai Branch
  9. **
  10. ** \attention THIS SAMPLE CODE IS PROVIDED AS IS. GOKE MICROELECTRONICS
  11. ** ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR
  12. ** OMMISSIONS.
  13. **
  14. ** \note Do not modify this file as it is generated automatically.
  15. **
  16. ******************************************************************************/
  17. #ifndef _GH_DMA_H
  18. #define _GH_DMA_H
  19. #ifdef __LINUX__
  20. #include "reg4linux.h"
  21. #else
  22. #define FIO_ADDRESS(block,address) (address)
  23. #define FIO_MOFFSET(block,moffset) (moffset)
  24. #endif
  25. #ifndef __LINUX__
  26. #include "gtypes.h" /* global type definitions */
  27. #include "gh_lib_cfg.h" /* configuration */
  28. #endif
  29. #define GH_DMA_ENABLE_DEBUG_PRINT 0
  30. #ifdef __LINUX__
  31. #define GH_DMA_DEBUG_PRINT_FUNCTION printk
  32. #else
  33. #define GH_DMA_DEBUG_PRINT_FUNCTION printf
  34. #endif
  35. #ifndef __LINUX__
  36. #if GH_DMA_ENABLE_DEBUG_PRINT
  37. #include <stdio.h>
  38. #endif
  39. #endif
  40. /* check configuration */
  41. #ifndef GH_INLINE_LEVEL
  42. #error "GH_INLINE_LEVEL is not defined!"
  43. #endif
  44. #if GH_INLINE_LEVEL > 2
  45. #error "GH_INLINE_LEVEL must be set 0, 1 or 2!"
  46. #endif
  47. #ifndef GH_INLINE
  48. #error "GH_INLINE is not defined!"
  49. #endif
  50. /* disable inlining for debugging */
  51. #ifdef DEBUG
  52. #undef GH_INLINE_LEVEL
  53. #define GH_INLINE_LEVEL 0
  54. #endif
  55. /*----------------------------------------------------------------------------*/
  56. /* registers */
  57. /*----------------------------------------------------------------------------*/
  58. #define REG_DMA_CONTROL FIO_ADDRESS(DMA,0x9000331C) /* read/write */
  59. #define REG_DMA_SOURCE_ADDRESS FIO_ADDRESS(DMA,0x90003320) /* read/write */
  60. #define REG_DMA_DESTINATION_ADDRESS FIO_ADDRESS(DMA,0x90003324) /* read/write */
  61. #define REG_DMA_STATUS FIO_ADDRESS(DMA,0x90003328) /* read/write */
  62. #define REG_DMA_DESCRIPTOR_ADDRESS FIO_ADDRESS(DMA,0x90003308) /* read/write */
  63. #define REG_DMA_IR FIO_ADDRESS(DMA,0x90003304) /* read */
  64. /*----------------------------------------------------------------------------*/
  65. /* bit group structures */
  66. /*----------------------------------------------------------------------------*/
  67. typedef union { /* DMA_Control */
  68. U32 all;
  69. struct {
  70. U32 count : 22;
  71. U32 ts : 2;
  72. U32 blk : 3;
  73. U32 ni : 1;
  74. U32 rm : 1;
  75. U32 wm : 1;
  76. U32 d : 1;
  77. U32 en : 1;
  78. } bitc;
  79. } GH_DMA_CONTROL_S;
  80. typedef union { /* DMA_Status */
  81. U32 all;
  82. struct {
  83. U32 count : 22;
  84. U32 dn : 1;
  85. U32 ae : 1;
  86. U32 rwe : 1;
  87. U32 be : 1;
  88. U32 me : 1;
  89. U32 od : 1;
  90. U32 dd : 1;
  91. U32 da : 1;
  92. U32 oe : 1;
  93. U32 dm : 1;
  94. } bitc;
  95. } GH_DMA_STATUS_S;
  96. typedef union { /* DMA_IR */
  97. U32 all;
  98. struct {
  99. U32 i0 : 1;
  100. U32 i1 : 1;
  101. U32 i2 : 1;
  102. U32 i3 : 1;
  103. U32 : 28;
  104. } bitc;
  105. } GH_DMA_IR_S;
  106. /*----------------------------------------------------------------------------*/
  107. /* mirror variables */
  108. /*----------------------------------------------------------------------------*/
  109. #ifdef __cplusplus
  110. extern "C" {
  111. #endif
  112. /*----------------------------------------------------------------------------*/
  113. /* register DMA_Control (read/write) */
  114. /*----------------------------------------------------------------------------*/
  115. #if GH_INLINE_LEVEL == 0
  116. /*! \brief Writes the register 'DMA_Control'. */
  117. void GH_DMA_set_Control(U8 index, U32 data);
  118. /*! \brief Reads the register 'DMA_Control'. */
  119. U32 GH_DMA_get_Control(U8 index);
  120. /*! \brief Writes the bit group 'count' of register 'DMA_Control'. */
  121. void GH_DMA_set_Control_count(U8 index, U32 data);
  122. /*! \brief Reads the bit group 'count' of register 'DMA_Control'. */
  123. U32 GH_DMA_get_Control_count(U8 index);
  124. /*! \brief Writes the bit group 'ts' of register 'DMA_Control'. */
  125. void GH_DMA_set_Control_ts(U8 index, U8 data);
  126. /*! \brief Reads the bit group 'ts' of register 'DMA_Control'. */
  127. U8 GH_DMA_get_Control_ts(U8 index);
  128. /*! \brief Writes the bit group 'blk' of register 'DMA_Control'. */
  129. void GH_DMA_set_Control_blk(U8 index, U8 data);
  130. /*! \brief Reads the bit group 'blk' of register 'DMA_Control'. */
  131. U8 GH_DMA_get_Control_blk(U8 index);
  132. /*! \brief Writes the bit group 'ni' of register 'DMA_Control'. */
  133. void GH_DMA_set_Control_ni(U8 index, U8 data);
  134. /*! \brief Reads the bit group 'ni' of register 'DMA_Control'. */
  135. U8 GH_DMA_get_Control_ni(U8 index);
  136. /*! \brief Writes the bit group 'rm' of register 'DMA_Control'. */
  137. void GH_DMA_set_Control_rm(U8 index, U8 data);
  138. /*! \brief Reads the bit group 'rm' of register 'DMA_Control'. */
  139. U8 GH_DMA_get_Control_rm(U8 index);
  140. /*! \brief Writes the bit group 'wm' of register 'DMA_Control'. */
  141. void GH_DMA_set_Control_wm(U8 index, U8 data);
  142. /*! \brief Reads the bit group 'wm' of register 'DMA_Control'. */
  143. U8 GH_DMA_get_Control_wm(U8 index);
  144. /*! \brief Writes the bit group 'd' of register 'DMA_Control'. */
  145. void GH_DMA_set_Control_d(U8 index, U8 data);
  146. /*! \brief Reads the bit group 'd' of register 'DMA_Control'. */
  147. U8 GH_DMA_get_Control_d(U8 index);
  148. /*! \brief Writes the bit group 'en' of register 'DMA_Control'. */
  149. void GH_DMA_set_Control_en(U8 index, U8 data);
  150. /*! \brief Reads the bit group 'en' of register 'DMA_Control'. */
  151. U8 GH_DMA_get_Control_en(U8 index);
  152. #else /* GH_INLINE_LEVEL == 0 */
  153. GH_INLINE void GH_DMA_set_Control(U8 index, U32 data)
  154. {
  155. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = data;
  156. #if GH_DMA_ENABLE_DEBUG_PRINT
  157. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control] <-- 0x%08x\n",
  158. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),data,data);
  159. #endif
  160. }
  161. GH_INLINE U32 GH_DMA_get_Control(U8 index)
  162. {
  163. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  164. #if GH_DMA_ENABLE_DEBUG_PRINT
  165. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control] --> 0x%08x\n",
  166. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  167. #endif
  168. return value;
  169. }
  170. GH_INLINE void GH_DMA_set_Control_count(U8 index, U32 data)
  171. {
  172. GH_DMA_CONTROL_S d;
  173. d.all = *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010));
  174. d.bitc.count = data;
  175. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  176. #if GH_DMA_ENABLE_DEBUG_PRINT
  177. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control_count] <-- 0x%08x\n",
  178. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  179. #endif
  180. }
  181. GH_INLINE U32 GH_DMA_get_Control_count(U8 index)
  182. {
  183. GH_DMA_CONTROL_S tmp_value;
  184. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  185. tmp_value.all = value;
  186. #if GH_DMA_ENABLE_DEBUG_PRINT
  187. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control_count] --> 0x%08x\n",
  188. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  189. #endif
  190. return tmp_value.bitc.count;
  191. }
  192. GH_INLINE void GH_DMA_set_Control_ts(U8 index, U8 data)
  193. {
  194. GH_DMA_CONTROL_S d;
  195. d.all = *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010));
  196. d.bitc.ts = data;
  197. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  198. #if GH_DMA_ENABLE_DEBUG_PRINT
  199. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control_ts] <-- 0x%08x\n",
  200. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  201. #endif
  202. }
  203. GH_INLINE U8 GH_DMA_get_Control_ts(U8 index)
  204. {
  205. GH_DMA_CONTROL_S tmp_value;
  206. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  207. tmp_value.all = value;
  208. #if GH_DMA_ENABLE_DEBUG_PRINT
  209. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control_ts] --> 0x%08x\n",
  210. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  211. #endif
  212. return tmp_value.bitc.ts;
  213. }
  214. GH_INLINE void GH_DMA_set_Control_blk(U8 index, U8 data)
  215. {
  216. GH_DMA_CONTROL_S d;
  217. d.all = *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010));
  218. d.bitc.blk = data;
  219. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  220. #if GH_DMA_ENABLE_DEBUG_PRINT
  221. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control_blk] <-- 0x%08x\n",
  222. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  223. #endif
  224. }
  225. GH_INLINE U8 GH_DMA_get_Control_blk(U8 index)
  226. {
  227. GH_DMA_CONTROL_S tmp_value;
  228. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  229. tmp_value.all = value;
  230. #if GH_DMA_ENABLE_DEBUG_PRINT
  231. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control_blk] --> 0x%08x\n",
  232. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  233. #endif
  234. return tmp_value.bitc.blk;
  235. }
  236. GH_INLINE void GH_DMA_set_Control_ni(U8 index, U8 data)
  237. {
  238. GH_DMA_CONTROL_S d;
  239. d.all = *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010));
  240. d.bitc.ni = data;
  241. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  242. #if GH_DMA_ENABLE_DEBUG_PRINT
  243. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control_ni] <-- 0x%08x\n",
  244. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  245. #endif
  246. }
  247. GH_INLINE U8 GH_DMA_get_Control_ni(U8 index)
  248. {
  249. GH_DMA_CONTROL_S tmp_value;
  250. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  251. tmp_value.all = value;
  252. #if GH_DMA_ENABLE_DEBUG_PRINT
  253. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control_ni] --> 0x%08x\n",
  254. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  255. #endif
  256. return tmp_value.bitc.ni;
  257. }
  258. GH_INLINE void GH_DMA_set_Control_rm(U8 index, U8 data)
  259. {
  260. GH_DMA_CONTROL_S d;
  261. d.all = *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010));
  262. d.bitc.rm = data;
  263. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  264. #if GH_DMA_ENABLE_DEBUG_PRINT
  265. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control_rm] <-- 0x%08x\n",
  266. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  267. #endif
  268. }
  269. GH_INLINE U8 GH_DMA_get_Control_rm(U8 index)
  270. {
  271. GH_DMA_CONTROL_S tmp_value;
  272. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  273. tmp_value.all = value;
  274. #if GH_DMA_ENABLE_DEBUG_PRINT
  275. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control_rm] --> 0x%08x\n",
  276. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  277. #endif
  278. return tmp_value.bitc.rm;
  279. }
  280. GH_INLINE void GH_DMA_set_Control_wm(U8 index, U8 data)
  281. {
  282. GH_DMA_CONTROL_S d;
  283. d.all = *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010));
  284. d.bitc.wm = data;
  285. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  286. #if GH_DMA_ENABLE_DEBUG_PRINT
  287. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control_wm] <-- 0x%08x\n",
  288. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  289. #endif
  290. }
  291. GH_INLINE U8 GH_DMA_get_Control_wm(U8 index)
  292. {
  293. GH_DMA_CONTROL_S tmp_value;
  294. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  295. tmp_value.all = value;
  296. #if GH_DMA_ENABLE_DEBUG_PRINT
  297. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control_wm] --> 0x%08x\n",
  298. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  299. #endif
  300. return tmp_value.bitc.wm;
  301. }
  302. GH_INLINE void GH_DMA_set_Control_d(U8 index, U8 data)
  303. {
  304. GH_DMA_CONTROL_S d;
  305. d.all = *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010));
  306. d.bitc.d = data;
  307. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  308. #if GH_DMA_ENABLE_DEBUG_PRINT
  309. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control_d] <-- 0x%08x\n",
  310. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  311. #endif
  312. }
  313. GH_INLINE U8 GH_DMA_get_Control_d(U8 index)
  314. {
  315. GH_DMA_CONTROL_S tmp_value;
  316. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  317. tmp_value.all = value;
  318. #if GH_DMA_ENABLE_DEBUG_PRINT
  319. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control_d] --> 0x%08x\n",
  320. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  321. #endif
  322. return tmp_value.bitc.d;
  323. }
  324. GH_INLINE void GH_DMA_set_Control_en(U8 index, U8 data)
  325. {
  326. GH_DMA_CONTROL_S d;
  327. d.all = *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010));
  328. d.bitc.en = data;
  329. *(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  330. #if GH_DMA_ENABLE_DEBUG_PRINT
  331. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Control_en] <-- 0x%08x\n",
  332. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  333. #endif
  334. }
  335. GH_INLINE U8 GH_DMA_get_Control_en(U8 index)
  336. {
  337. GH_DMA_CONTROL_S tmp_value;
  338. U32 value = (*(volatile U32 *)(REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)));
  339. tmp_value.all = value;
  340. #if GH_DMA_ENABLE_DEBUG_PRINT
  341. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Control_en] --> 0x%08x\n",
  342. (REG_DMA_CONTROL + index * FIO_MOFFSET(DMA,0x00000010)),value);
  343. #endif
  344. return tmp_value.bitc.en;
  345. }
  346. #endif /* GH_INLINE_LEVEL == 0 */
  347. /*----------------------------------------------------------------------------*/
  348. /* register DMA_Source_Address (read/write) */
  349. /*----------------------------------------------------------------------------*/
  350. #if GH_INLINE_LEVEL == 0
  351. /*! \brief Writes the register 'DMA_Source_Address'. */
  352. void GH_DMA_set_Source_Address(U8 index, U32 data);
  353. /*! \brief Reads the register 'DMA_Source_Address'. */
  354. U32 GH_DMA_get_Source_Address(U8 index);
  355. #else /* GH_INLINE_LEVEL == 0 */
  356. GH_INLINE void GH_DMA_set_Source_Address(U8 index, U32 data)
  357. {
  358. *(volatile U32 *)(REG_DMA_SOURCE_ADDRESS + index * FIO_MOFFSET(DMA,0x00000010)) = data;
  359. #if GH_DMA_ENABLE_DEBUG_PRINT
  360. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Source_Address] <-- 0x%08x\n",
  361. (REG_DMA_SOURCE_ADDRESS + index * FIO_MOFFSET(DMA,0x00000010)),data,data);
  362. #endif
  363. }
  364. GH_INLINE U32 GH_DMA_get_Source_Address(U8 index)
  365. {
  366. U32 value = (*(volatile U32 *)(REG_DMA_SOURCE_ADDRESS + index * FIO_MOFFSET(DMA,0x00000010)));
  367. #if GH_DMA_ENABLE_DEBUG_PRINT
  368. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Source_Address] --> 0x%08x\n",
  369. (REG_DMA_SOURCE_ADDRESS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  370. #endif
  371. return value;
  372. }
  373. #endif /* GH_INLINE_LEVEL == 0 */
  374. /*----------------------------------------------------------------------------*/
  375. /* register DMA_Destination_Address (read/write) */
  376. /*----------------------------------------------------------------------------*/
  377. #if GH_INLINE_LEVEL == 0
  378. /*! \brief Writes the register 'DMA_Destination_Address'. */
  379. void GH_DMA_set_Destination_Address(U8 index, U32 data);
  380. /*! \brief Reads the register 'DMA_Destination_Address'. */
  381. U32 GH_DMA_get_Destination_Address(U8 index);
  382. #else /* GH_INLINE_LEVEL == 0 */
  383. GH_INLINE void GH_DMA_set_Destination_Address(U8 index, U32 data)
  384. {
  385. *(volatile U32 *)(REG_DMA_DESTINATION_ADDRESS + index * FIO_MOFFSET(DMA,0x00000010)) = data;
  386. #if GH_DMA_ENABLE_DEBUG_PRINT
  387. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Destination_Address] <-- 0x%08x\n",
  388. (REG_DMA_DESTINATION_ADDRESS + index * FIO_MOFFSET(DMA,0x00000010)),data,data);
  389. #endif
  390. }
  391. GH_INLINE U32 GH_DMA_get_Destination_Address(U8 index)
  392. {
  393. U32 value = (*(volatile U32 *)(REG_DMA_DESTINATION_ADDRESS + index * FIO_MOFFSET(DMA,0x00000010)));
  394. #if GH_DMA_ENABLE_DEBUG_PRINT
  395. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Destination_Address] --> 0x%08x\n",
  396. (REG_DMA_DESTINATION_ADDRESS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  397. #endif
  398. return value;
  399. }
  400. #endif /* GH_INLINE_LEVEL == 0 */
  401. /*----------------------------------------------------------------------------*/
  402. /* register DMA_Status (read/write) */
  403. /*----------------------------------------------------------------------------*/
  404. #if GH_INLINE_LEVEL == 0
  405. /*! \brief Writes the register 'DMA_Status'. */
  406. void GH_DMA_set_Status(U8 index, U32 data);
  407. /*! \brief Reads the register 'DMA_Status'. */
  408. U32 GH_DMA_get_Status(U8 index);
  409. /*! \brief Writes the bit group 'count' of register 'DMA_Status'. */
  410. void GH_DMA_set_Status_count(U8 index, U32 data);
  411. /*! \brief Reads the bit group 'count' of register 'DMA_Status'. */
  412. U32 GH_DMA_get_Status_count(U8 index);
  413. /*! \brief Writes the bit group 'dn' of register 'DMA_Status'. */
  414. void GH_DMA_set_Status_dn(U8 index, U8 data);
  415. /*! \brief Reads the bit group 'dn' of register 'DMA_Status'. */
  416. U8 GH_DMA_get_Status_dn(U8 index);
  417. /*! \brief Writes the bit group 'ae' of register 'DMA_Status'. */
  418. void GH_DMA_set_Status_ae(U8 index, U8 data);
  419. /*! \brief Reads the bit group 'ae' of register 'DMA_Status'. */
  420. U8 GH_DMA_get_Status_ae(U8 index);
  421. /*! \brief Writes the bit group 'rwe' of register 'DMA_Status'. */
  422. void GH_DMA_set_Status_rwe(U8 index, U8 data);
  423. /*! \brief Reads the bit group 'rwe' of register 'DMA_Status'. */
  424. U8 GH_DMA_get_Status_rwe(U8 index);
  425. /*! \brief Writes the bit group 'be' of register 'DMA_Status'. */
  426. void GH_DMA_set_Status_be(U8 index, U8 data);
  427. /*! \brief Reads the bit group 'be' of register 'DMA_Status'. */
  428. U8 GH_DMA_get_Status_be(U8 index);
  429. /*! \brief Writes the bit group 'me' of register 'DMA_Status'. */
  430. void GH_DMA_set_Status_me(U8 index, U8 data);
  431. /*! \brief Reads the bit group 'me' of register 'DMA_Status'. */
  432. U8 GH_DMA_get_Status_me(U8 index);
  433. /*! \brief Writes the bit group 'od' of register 'DMA_Status'. */
  434. void GH_DMA_set_Status_od(U8 index, U8 data);
  435. /*! \brief Reads the bit group 'od' of register 'DMA_Status'. */
  436. U8 GH_DMA_get_Status_od(U8 index);
  437. /*! \brief Writes the bit group 'dd' of register 'DMA_Status'. */
  438. void GH_DMA_set_Status_dd(U8 index, U8 data);
  439. /*! \brief Reads the bit group 'dd' of register 'DMA_Status'. */
  440. U8 GH_DMA_get_Status_dd(U8 index);
  441. /*! \brief Writes the bit group 'da' of register 'DMA_Status'. */
  442. void GH_DMA_set_Status_da(U8 index, U8 data);
  443. /*! \brief Reads the bit group 'da' of register 'DMA_Status'. */
  444. U8 GH_DMA_get_Status_da(U8 index);
  445. /*! \brief Writes the bit group 'oe' of register 'DMA_Status'. */
  446. void GH_DMA_set_Status_oe(U8 index, U8 data);
  447. /*! \brief Reads the bit group 'oe' of register 'DMA_Status'. */
  448. U8 GH_DMA_get_Status_oe(U8 index);
  449. /*! \brief Writes the bit group 'dm' of register 'DMA_Status'. */
  450. void GH_DMA_set_Status_dm(U8 index, U8 data);
  451. /*! \brief Reads the bit group 'dm' of register 'DMA_Status'. */
  452. U8 GH_DMA_get_Status_dm(U8 index);
  453. #else /* GH_INLINE_LEVEL == 0 */
  454. GH_INLINE void GH_DMA_set_Status(U8 index, U32 data)
  455. {
  456. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = data;
  457. #if GH_DMA_ENABLE_DEBUG_PRINT
  458. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status] <-- 0x%08x\n",
  459. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),data,data);
  460. #endif
  461. }
  462. GH_INLINE U32 GH_DMA_get_Status(U8 index)
  463. {
  464. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  465. #if GH_DMA_ENABLE_DEBUG_PRINT
  466. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status] --> 0x%08x\n",
  467. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  468. #endif
  469. return value;
  470. }
  471. GH_INLINE void GH_DMA_set_Status_count(U8 index, U32 data)
  472. {
  473. GH_DMA_STATUS_S d;
  474. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  475. d.bitc.count = data;
  476. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  477. #if GH_DMA_ENABLE_DEBUG_PRINT
  478. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_count] <-- 0x%08x\n",
  479. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  480. #endif
  481. }
  482. GH_INLINE U32 GH_DMA_get_Status_count(U8 index)
  483. {
  484. GH_DMA_STATUS_S tmp_value;
  485. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  486. tmp_value.all = value;
  487. #if GH_DMA_ENABLE_DEBUG_PRINT
  488. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_count] --> 0x%08x\n",
  489. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  490. #endif
  491. return tmp_value.bitc.count;
  492. }
  493. GH_INLINE void GH_DMA_set_Status_dn(U8 index, U8 data)
  494. {
  495. GH_DMA_STATUS_S d;
  496. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  497. d.bitc.dn = data;
  498. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  499. #if GH_DMA_ENABLE_DEBUG_PRINT
  500. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_dn] <-- 0x%08x\n",
  501. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  502. #endif
  503. }
  504. GH_INLINE U8 GH_DMA_get_Status_dn(U8 index)
  505. {
  506. GH_DMA_STATUS_S tmp_value;
  507. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  508. tmp_value.all = value;
  509. #if GH_DMA_ENABLE_DEBUG_PRINT
  510. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_dn] --> 0x%08x\n",
  511. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  512. #endif
  513. return tmp_value.bitc.dn;
  514. }
  515. GH_INLINE void GH_DMA_set_Status_ae(U8 index, U8 data)
  516. {
  517. GH_DMA_STATUS_S d;
  518. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  519. d.bitc.ae = data;
  520. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  521. #if GH_DMA_ENABLE_DEBUG_PRINT
  522. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_ae] <-- 0x%08x\n",
  523. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  524. #endif
  525. }
  526. GH_INLINE U8 GH_DMA_get_Status_ae(U8 index)
  527. {
  528. GH_DMA_STATUS_S tmp_value;
  529. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  530. tmp_value.all = value;
  531. #if GH_DMA_ENABLE_DEBUG_PRINT
  532. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_ae] --> 0x%08x\n",
  533. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  534. #endif
  535. return tmp_value.bitc.ae;
  536. }
  537. GH_INLINE void GH_DMA_set_Status_rwe(U8 index, U8 data)
  538. {
  539. GH_DMA_STATUS_S d;
  540. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  541. d.bitc.rwe = data;
  542. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  543. #if GH_DMA_ENABLE_DEBUG_PRINT
  544. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_rwe] <-- 0x%08x\n",
  545. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  546. #endif
  547. }
  548. GH_INLINE U8 GH_DMA_get_Status_rwe(U8 index)
  549. {
  550. GH_DMA_STATUS_S tmp_value;
  551. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  552. tmp_value.all = value;
  553. #if GH_DMA_ENABLE_DEBUG_PRINT
  554. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_rwe] --> 0x%08x\n",
  555. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  556. #endif
  557. return tmp_value.bitc.rwe;
  558. }
  559. GH_INLINE void GH_DMA_set_Status_be(U8 index, U8 data)
  560. {
  561. GH_DMA_STATUS_S d;
  562. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  563. d.bitc.be = data;
  564. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  565. #if GH_DMA_ENABLE_DEBUG_PRINT
  566. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_be] <-- 0x%08x\n",
  567. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  568. #endif
  569. }
  570. GH_INLINE U8 GH_DMA_get_Status_be(U8 index)
  571. {
  572. GH_DMA_STATUS_S tmp_value;
  573. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  574. tmp_value.all = value;
  575. #if GH_DMA_ENABLE_DEBUG_PRINT
  576. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_be] --> 0x%08x\n",
  577. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  578. #endif
  579. return tmp_value.bitc.be;
  580. }
  581. GH_INLINE void GH_DMA_set_Status_me(U8 index, U8 data)
  582. {
  583. GH_DMA_STATUS_S d;
  584. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  585. d.bitc.me = data;
  586. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  587. #if GH_DMA_ENABLE_DEBUG_PRINT
  588. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_me] <-- 0x%08x\n",
  589. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  590. #endif
  591. }
  592. GH_INLINE U8 GH_DMA_get_Status_me(U8 index)
  593. {
  594. GH_DMA_STATUS_S tmp_value;
  595. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  596. tmp_value.all = value;
  597. #if GH_DMA_ENABLE_DEBUG_PRINT
  598. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_me] --> 0x%08x\n",
  599. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  600. #endif
  601. return tmp_value.bitc.me;
  602. }
  603. GH_INLINE void GH_DMA_set_Status_od(U8 index, U8 data)
  604. {
  605. GH_DMA_STATUS_S d;
  606. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  607. d.bitc.od = data;
  608. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  609. #if GH_DMA_ENABLE_DEBUG_PRINT
  610. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_od] <-- 0x%08x\n",
  611. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  612. #endif
  613. }
  614. GH_INLINE U8 GH_DMA_get_Status_od(U8 index)
  615. {
  616. GH_DMA_STATUS_S tmp_value;
  617. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  618. tmp_value.all = value;
  619. #if GH_DMA_ENABLE_DEBUG_PRINT
  620. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_od] --> 0x%08x\n",
  621. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  622. #endif
  623. return tmp_value.bitc.od;
  624. }
  625. GH_INLINE void GH_DMA_set_Status_dd(U8 index, U8 data)
  626. {
  627. GH_DMA_STATUS_S d;
  628. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  629. d.bitc.dd = data;
  630. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  631. #if GH_DMA_ENABLE_DEBUG_PRINT
  632. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_dd] <-- 0x%08x\n",
  633. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  634. #endif
  635. }
  636. GH_INLINE U8 GH_DMA_get_Status_dd(U8 index)
  637. {
  638. GH_DMA_STATUS_S tmp_value;
  639. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  640. tmp_value.all = value;
  641. #if GH_DMA_ENABLE_DEBUG_PRINT
  642. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_dd] --> 0x%08x\n",
  643. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  644. #endif
  645. return tmp_value.bitc.dd;
  646. }
  647. GH_INLINE void GH_DMA_set_Status_da(U8 index, U8 data)
  648. {
  649. GH_DMA_STATUS_S d;
  650. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  651. d.bitc.da = data;
  652. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  653. #if GH_DMA_ENABLE_DEBUG_PRINT
  654. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_da] <-- 0x%08x\n",
  655. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  656. #endif
  657. }
  658. GH_INLINE U8 GH_DMA_get_Status_da(U8 index)
  659. {
  660. GH_DMA_STATUS_S tmp_value;
  661. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  662. tmp_value.all = value;
  663. #if GH_DMA_ENABLE_DEBUG_PRINT
  664. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_da] --> 0x%08x\n",
  665. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  666. #endif
  667. return tmp_value.bitc.da;
  668. }
  669. GH_INLINE void GH_DMA_set_Status_oe(U8 index, U8 data)
  670. {
  671. GH_DMA_STATUS_S d;
  672. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  673. d.bitc.oe = data;
  674. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  675. #if GH_DMA_ENABLE_DEBUG_PRINT
  676. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_oe] <-- 0x%08x\n",
  677. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  678. #endif
  679. }
  680. GH_INLINE U8 GH_DMA_get_Status_oe(U8 index)
  681. {
  682. GH_DMA_STATUS_S tmp_value;
  683. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  684. tmp_value.all = value;
  685. #if GH_DMA_ENABLE_DEBUG_PRINT
  686. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_oe] --> 0x%08x\n",
  687. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  688. #endif
  689. return tmp_value.bitc.oe;
  690. }
  691. GH_INLINE void GH_DMA_set_Status_dm(U8 index, U8 data)
  692. {
  693. GH_DMA_STATUS_S d;
  694. d.all = *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010));
  695. d.bitc.dm = data;
  696. *(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)) = d.all;
  697. #if GH_DMA_ENABLE_DEBUG_PRINT
  698. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Status_dm] <-- 0x%08x\n",
  699. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),d.all,d.all);
  700. #endif
  701. }
  702. GH_INLINE U8 GH_DMA_get_Status_dm(U8 index)
  703. {
  704. GH_DMA_STATUS_S tmp_value;
  705. U32 value = (*(volatile U32 *)(REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)));
  706. tmp_value.all = value;
  707. #if GH_DMA_ENABLE_DEBUG_PRINT
  708. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Status_dm] --> 0x%08x\n",
  709. (REG_DMA_STATUS + index * FIO_MOFFSET(DMA,0x00000010)),value);
  710. #endif
  711. return tmp_value.bitc.dm;
  712. }
  713. #endif /* GH_INLINE_LEVEL == 0 */
  714. /*----------------------------------------------------------------------------*/
  715. /* register DMA_Descriptor_Address (read/write) */
  716. /*----------------------------------------------------------------------------*/
  717. #if GH_INLINE_LEVEL == 0
  718. /*! \brief Writes the register 'DMA_Descriptor_Address'. */
  719. void GH_DMA_set_Descriptor_Address(U8 index, U32 data);
  720. /*! \brief Reads the register 'DMA_Descriptor_Address'. */
  721. U32 GH_DMA_get_Descriptor_Address(U8 index);
  722. #else /* GH_INLINE_LEVEL == 0 */
  723. GH_INLINE void GH_DMA_set_Descriptor_Address(U8 index, U32 data)
  724. {
  725. *(volatile U32 *)(REG_DMA_DESCRIPTOR_ADDRESS + index * FIO_MOFFSET(DMA,0x00000004)) = data;
  726. #if GH_DMA_ENABLE_DEBUG_PRINT
  727. GH_DMA_DEBUG_PRINT_FUNCTION( "WRREG(0x%08x,0x%08x); \\\\ [GH_DMA_set_Descriptor_Address] <-- 0x%08x\n",
  728. (REG_DMA_DESCRIPTOR_ADDRESS + index * FIO_MOFFSET(DMA,0x00000004)),data,data);
  729. #endif
  730. }
  731. GH_INLINE U32 GH_DMA_get_Descriptor_Address(U8 index)
  732. {
  733. U32 value = (*(volatile U32 *)(REG_DMA_DESCRIPTOR_ADDRESS + index * FIO_MOFFSET(DMA,0x00000004)));
  734. #if GH_DMA_ENABLE_DEBUG_PRINT
  735. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_Descriptor_Address] --> 0x%08x\n",
  736. (REG_DMA_DESCRIPTOR_ADDRESS + index * FIO_MOFFSET(DMA,0x00000004)),value);
  737. #endif
  738. return value;
  739. }
  740. #endif /* GH_INLINE_LEVEL == 0 */
  741. /*----------------------------------------------------------------------------*/
  742. /* register DMA_IR (read) */
  743. /*----------------------------------------------------------------------------*/
  744. #if GH_INLINE_LEVEL == 0
  745. /*! \brief Reads the register 'DMA_IR'. */
  746. U32 GH_DMA_get_IR(void);
  747. /*! \brief Reads the bit group 'i0' of register 'DMA_IR'. */
  748. U8 GH_DMA_get_IR_i0(void);
  749. /*! \brief Reads the bit group 'i1' of register 'DMA_IR'. */
  750. U8 GH_DMA_get_IR_i1(void);
  751. /*! \brief Reads the bit group 'i2' of register 'DMA_IR'. */
  752. U8 GH_DMA_get_IR_i2(void);
  753. /*! \brief Reads the bit group 'i3' of register 'DMA_IR'. */
  754. U8 GH_DMA_get_IR_i3(void);
  755. #else /* GH_INLINE_LEVEL == 0 */
  756. GH_INLINE U32 GH_DMA_get_IR(void)
  757. {
  758. U32 value = (*(volatile U32 *)REG_DMA_IR);
  759. #if GH_DMA_ENABLE_DEBUG_PRINT
  760. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_IR] --> 0x%08x\n",
  761. REG_DMA_IR,value);
  762. #endif
  763. return value;
  764. }
  765. GH_INLINE U8 GH_DMA_get_IR_i0(void)
  766. {
  767. GH_DMA_IR_S tmp_value;
  768. U32 value = (*(volatile U32 *)REG_DMA_IR);
  769. tmp_value.all = value;
  770. #if GH_DMA_ENABLE_DEBUG_PRINT
  771. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_IR_i0] --> 0x%08x\n",
  772. REG_DMA_IR,value);
  773. #endif
  774. return tmp_value.bitc.i0;
  775. }
  776. GH_INLINE U8 GH_DMA_get_IR_i1(void)
  777. {
  778. GH_DMA_IR_S tmp_value;
  779. U32 value = (*(volatile U32 *)REG_DMA_IR);
  780. tmp_value.all = value;
  781. #if GH_DMA_ENABLE_DEBUG_PRINT
  782. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_IR_i1] --> 0x%08x\n",
  783. REG_DMA_IR,value);
  784. #endif
  785. return tmp_value.bitc.i1;
  786. }
  787. GH_INLINE U8 GH_DMA_get_IR_i2(void)
  788. {
  789. GH_DMA_IR_S tmp_value;
  790. U32 value = (*(volatile U32 *)REG_DMA_IR);
  791. tmp_value.all = value;
  792. #if GH_DMA_ENABLE_DEBUG_PRINT
  793. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_IR_i2] --> 0x%08x\n",
  794. REG_DMA_IR,value);
  795. #endif
  796. return tmp_value.bitc.i2;
  797. }
  798. GH_INLINE U8 GH_DMA_get_IR_i3(void)
  799. {
  800. GH_DMA_IR_S tmp_value;
  801. U32 value = (*(volatile U32 *)REG_DMA_IR);
  802. tmp_value.all = value;
  803. #if GH_DMA_ENABLE_DEBUG_PRINT
  804. GH_DMA_DEBUG_PRINT_FUNCTION( "value = RDREG(0x%08x); \\\\ [GH_DMA_get_IR_i3] --> 0x%08x\n",
  805. REG_DMA_IR,value);
  806. #endif
  807. return tmp_value.bitc.i3;
  808. }
  809. #endif /* GH_INLINE_LEVEL == 0 */
  810. /*----------------------------------------------------------------------------*/
  811. /* init function */
  812. /*----------------------------------------------------------------------------*/
  813. /*! \brief Initialises the registers and mirror variables. */
  814. void GH_DMA_init(void);
  815. #ifdef __cplusplus
  816. }
  817. #endif
  818. #endif /* _GH_DMA_H */
  819. /*----------------------------------------------------------------------------*/
  820. /* end of file */
  821. /*----------------------------------------------------------------------------*/