air105.h 97 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087
  1. /*
  2. * Copyright (c) 2022 OpenLuat & AirM2M
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. * this software and associated documentation files (the "Software"), to deal in
  6. * the Software without restriction, including without limitation the rights to
  7. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  8. * the Software, and to permit persons to whom the Software is furnished to do so,
  9. * subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in all
  12. * copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  16. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  17. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  18. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. */
  21. #ifndef __AIR105_H__
  22. #define __AIR105_H__
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* ToDo: replace '<Device>' with your device name; add your doxyGen comment */
  27. /** @addtogroup <Device>_Definitions <Device> Definitions
  28. This file defines all structures and symbols for <Device>:
  29. - registers and bitfields
  30. - peripheral base address
  31. - peripheral ID
  32. - Peripheral definitions
  33. @{
  34. */
  35. /******************************************************************************/
  36. /* Processor and Core Peripherals */
  37. /******************************************************************************/
  38. /** @addtogroup <Device>_CMSIS Device CMSIS Definitions
  39. Configuration of the Cortex-M# Processor and Core Peripherals
  40. @{
  41. */
  42. /*
  43. * ==========================================================================
  44. * ---------- Interrupt Number Definition -----------------------------------
  45. * ==========================================================================
  46. */
  47. typedef enum IRQn
  48. {
  49. /****** Cortex-M# Processor Exceptions Numbers ***************************************************/
  50. /* ToDo: use this Cortex interrupt numbers if your device is a CORTEX-M3 / Cortex-M4 device */
  51. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  52. MemoryManagement_IRQn = -12, /*!< 4 Memory Management Interrupt */
  53. BusFault_IRQn = -11, /*!< 5 Bus Fault Interrupt */
  54. UsageFault_IRQn = -10, /*!< 6 Usage Fault Interrupt */
  55. SVCall_IRQn = -5, /*!< 11 SV Call Interrupt */
  56. DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor Interrupt */
  57. PendSV_IRQn = -2, /*!< 14 Pend SV Interrupt */
  58. SysTick_IRQn = -1, /*!< 15 System Tick Interrupt */
  59. /****** Device Specific Interrupt Numbers ********************************************************/
  60. /* ToDo: add here your device specific external interrupt numbers
  61. according the interrupt handlers defined in startup_Device.s
  62. eg.: Interrupt for Timer#1 TIM1_IRQHandler -> TIM1_IRQn */
  63. DMA_IRQn = 0,
  64. USB_IRQn = 1,
  65. USBDMA_IRQn = 2,
  66. LCD_IRQn = 3,
  67. SCI0_IRQn = 4,
  68. UART0_IRQn = 5,
  69. UART1_IRQn = 6,
  70. SPI0_IRQn = 7,
  71. CRYPT0_IRQn = 8,
  72. TIM0_0_IRQn = 9,
  73. TIM0_1_IRQn = 10,
  74. TIM0_2_IRQn = 11,
  75. TIM0_3_IRQn = 12,
  76. EXTI0_IRQn = 13,
  77. EXTI1_IRQn = 14,
  78. EXTI2_IRQn = 15,
  79. RTC_IRQn = 16,
  80. SENSOR_IRQn = 17,
  81. TRNG_IRQn = 18,
  82. ADC0_IRQn = 19,
  83. SSC_IRQn = 20,
  84. TIM0_4_IRQn = 21,
  85. TIM0_5_IRQn = 22,
  86. KBD_IRQn = 23,
  87. MSR_IRQn = 24,
  88. EXTI3_IRQn = 25,
  89. SPI1_IRQn = 26,
  90. SPI2_IRQn = 27,
  91. SCI2_IRQn = 29,
  92. UART2_IRQn = 32,
  93. UART3_IRQn = 33,
  94. QSPI_IRQn = 35,
  95. I2C0_IRQn = 36,
  96. EXTI4_IRQn = 37,
  97. EXTI5_IRQn = 38,
  98. TIM0_6_IRQn = 39,
  99. TIM0_7_IRQn = 40,
  100. DCMI_IRQn = 42,
  101. QR_IRQn = 46,
  102. GPU_IRQn = 47,
  103. AWD_IRQn = 49,
  104. DAC_IRQn = 50,
  105. SPI5_IRQn = 51
  106. } IRQn_Type;
  107. /*
  108. * ==========================================================================
  109. * ----------- Processor and Core Peripheral Section ------------------------
  110. * ==========================================================================
  111. */
  112. /* Configuration of the Cortex-M# Processor and Core Peripherals */
  113. /* ToDo: set the defines according your Device */
  114. /* ToDo: define the correct core revision
  115. __CM0_REV if your device is a CORTEX-M0 device
  116. __CM3_REV if your device is a CORTEX-M3 device
  117. __CM4_REV if your device is a CORTEX-M4 device */
  118. //#define __CM3_REV 0x0201 /*!< Core Revision r2p1 */
  119. //#define __CM3_REV 0x0200 /*!< Core Revision r2p0 */
  120. #define __CM4_REV 0x0001 /*!< Core Revision r2p0 */
  121. #define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */
  122. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  123. #define __MPU_PRESENT 1 /*!< MPU present or not */
  124. /* ToDo: define __FPU_PRESENT if your devise is a CORTEX-M4 */
  125. #define __FPU_PRESENT 1 /*!< FPU present or not */
  126. /*@}*/ /* end of group <Device>_CMSIS */
  127. /* ToDo: include the correct core_cm#.h file
  128. core_cm0.h if your device is a CORTEX-M0 device
  129. core_cm3.h if your device is a CORTEX-M3 device
  130. core_cm4.h if your device is a CORTEX-M4 device */
  131. #include "core_cm4.h" /* Cortex-M# processor and core peripherals */
  132. /* ToDo: include your system_<Device>.h file
  133. replace '<Device>' with your device name */
  134. #include "system_air105.h" /* <Device> System include file */
  135. /******************************************************************************/
  136. /* Device Specific Peripheral registers structures */
  137. /******************************************************************************/
  138. /** @addtogroup <Device>_Peripherals <Device> Peripherals
  139. <Device> Device Specific Peripheral registers structures
  140. @{
  141. */
  142. #if defined ( __CC_ARM )
  143. #pragma anon_unions
  144. #endif
  145. #include <stdint.h>
  146. /** @addtogroup Exported_types
  147. * @{
  148. */
  149. typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
  150. typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
  151. #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
  152. typedef enum {FALSE = 0, TRUE = !FALSE} Boolean;
  153. typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
  154. /* ToDo: add here your device specific peripheral access structure typedefs
  155. following is an example for a timer */
  156. #define BIT0 (0x00000001U)
  157. #define BIT1 (0x00000002U)
  158. #define BIT2 (0x00000004U)
  159. #define BIT3 (0x00000008U)
  160. #define BIT4 (0x00000010U)
  161. #define BIT5 (0x00000020U)
  162. #define BIT6 (0x00000040U)
  163. #define BIT7 (0x00000080U)
  164. #define BIT8 (0x00000100U)
  165. #define BIT9 (0x00000200U)
  166. #define BIT10 (0x00000400U)
  167. #define BIT11 (0x00000800U)
  168. #define BIT12 (0x00001000U)
  169. #define BIT13 (0x00002000U)
  170. #define BIT14 (0x00004000U)
  171. #define BIT15 (0x00008000U)
  172. #define BIT16 (0x00010000U)
  173. #define BIT17 (0x00020000U)
  174. #define BIT18 (0x00040000U)
  175. #define BIT19 (0x00080000U)
  176. #define BIT20 (0x00100000U)
  177. #define BIT21 (0x00200000U)
  178. #define BIT22 (0x00400000U)
  179. #define BIT23 (0x00800000U)
  180. #define BIT24 (0x01000000U)
  181. #define BIT25 (0x02000000U)
  182. #define BIT26 (0x04000000U)
  183. #define BIT27 (0x08000000U)
  184. #define BIT28 (0x10000000U)
  185. #define BIT29 (0x20000000U)
  186. #define BIT30 (0x40000000U)
  187. #define BIT31 (0x80000000U)
  188. typedef struct
  189. {
  190. __IO uint32_t FREQ_SEL;
  191. __IO uint32_t CG_CTRL1;
  192. __IO uint32_t CG_CTRL2;
  193. __O uint32_t SOFT_RST1;
  194. __O uint32_t SOFT_RST2;
  195. __IO uint32_t LOCK_R;
  196. __IO uint32_t PHER_CTRL;
  197. __I uint32_t SYS_RSVD[(0x2C-0x1C) >> 2];
  198. __I uint32_t HCLK_1MS_VAL;
  199. __I uint32_t PCLK_1MS_VAL;
  200. __IO uint32_t ANA_CTRL;
  201. __IO uint32_t DMA_CHAN;
  202. __IO uint32_t SCI0_GLF;
  203. __IO uint32_t SW_RSV1;
  204. __IO uint32_t SW_RSV2;
  205. __IO uint32_t CARD_RSVD;
  206. __IO uint32_t LDO25_CR;
  207. __IO uint32_t DMA_CHAN1;
  208. __I uint32_t SYS_RSVD2[(0x100-0x54) >> 2];
  209. __IO uint32_t MSR_CR1;
  210. __IO uint32_t MSR_CR2;
  211. __IO uint32_t USBPHY_CR1;
  212. __IO uint32_t USBPHY_CR2;
  213. __IO uint32_t USBPHY_CR3;
  214. __IO uint32_t ISO7816_CR;
  215. __IO uint32_t LDO_CR;
  216. __IO uint32_t CHG_CSR;
  217. __I uint32_t SYS_RSVD3[(0x204-0x120) >> 2];
  218. __IO uint32_t RSVD_POR;
  219. __I uint32_t SYS_RSVD4[(0x3EC-0x208) >> 2];
  220. __IO uint32_t PM2_WK_FLAG;
  221. __IO uint32_t CALIB_CSR;
  222. __IO uint32_t DBG_CR;
  223. __IO uint32_t CHIP_ID;
  224. } SYSCTRL_TypeDef;
  225. typedef struct
  226. {
  227. union
  228. {
  229. __I uint32_t RBR;
  230. __O uint32_t THR;
  231. __IO uint32_t DLL;
  232. } OFFSET_0;
  233. union
  234. {
  235. __IO uint32_t DLH;
  236. __IO uint32_t IER;
  237. } OFFSET_4;
  238. union
  239. {
  240. __I uint32_t IIR;
  241. __O uint32_t FCR;
  242. } OFFSET_8;
  243. __IO uint32_t LCR;
  244. __IO uint32_t MCR;
  245. __I uint32_t LSR;
  246. __I uint32_t MSR;
  247. __IO uint32_t SCR;
  248. __IO uint32_t LPDLL;
  249. __IO uint32_t LPDLH;
  250. __I uint32_t RES0[2];
  251. union
  252. {
  253. __I uint32_t SRBR[16];
  254. __O uint32_t STHR[16];
  255. } OFFSET_48;
  256. __IO uint32_t FAR;
  257. __I uint32_t TFR;
  258. __O uint32_t RFW;
  259. __I uint32_t USR;
  260. __I uint32_t TFL;
  261. __I uint32_t RFL;
  262. __O uint32_t SRR;
  263. __IO uint32_t SRTS;
  264. __IO uint32_t SBCR;
  265. __IO uint32_t SDMAM;
  266. __IO uint32_t SFE;
  267. __IO uint32_t SRT;
  268. __IO uint32_t STET;
  269. __IO uint32_t HTX;
  270. __O uint32_t DMASA;
  271. __I uint32_t RES1[18];
  272. __I uint32_t CPR;
  273. __I uint32_t UCV;
  274. __I uint32_t CTR;
  275. } UART_TypeDef;
  276. typedef struct
  277. {
  278. __IO uint16_t CTRLR0;
  279. uint16_t RESERVED0;
  280. __IO uint16_t CTRLR1;
  281. uint16_t RESERVED1;
  282. __IO uint32_t SSIENR;
  283. __IO uint32_t MWCR;
  284. __IO uint32_t SER;
  285. __IO uint32_t BAUDR;
  286. __IO uint32_t TXFTLR;
  287. __IO uint32_t RXFTLR;
  288. __I uint32_t TXFLR;
  289. __I uint32_t RXFLR;
  290. __I uint32_t SR;
  291. __IO uint32_t IMR;
  292. __I uint32_t ISR;
  293. __I uint32_t RISR;
  294. __I uint32_t TXOICR;
  295. __I uint32_t RXOICR;
  296. __I uint32_t RXUICR;
  297. __I uint32_t MSTICR;
  298. __IO uint32_t ICR;
  299. __IO uint32_t DMACR;
  300. __IO uint32_t DMATDLR;
  301. __IO uint32_t DMARDLR;
  302. __I uint32_t IDR;
  303. __I uint32_t SSI_COMP_VERSION;
  304. __IO uint32_t DR;
  305. __IO uint32_t DR_Array[35];
  306. __IO uint32_t RX_SAMPLE_DLY;
  307. } SPI_TypeDef;
  308. typedef struct
  309. {
  310. __IO uint32_t FCU_CMD;
  311. __O uint32_t ADDRES;
  312. __IO uint32_t BYTE_NUM;
  313. __O uint32_t WR_FIFO;
  314. __I uint32_t RD_FIFO;
  315. __IO uint32_t DEVICE_PARA;
  316. __IO uint32_t REG_WDATA;
  317. __O uint32_t REG_RDATA;
  318. __IO uint32_t INT_MASK;
  319. __IO uint32_t INT_UMASK;
  320. __IO uint32_t INT_MASK_STATUS;
  321. __IO uint32_t INT_STATUS;
  322. __IO uint32_t INT_RAWSTATUS;
  323. __IO uint32_t INT_CLEAR;
  324. __IO uint32_t CACHE_INTF_CMD;
  325. __IO uint32_t DMA_CNTL;
  326. __IO uint32_t FIFO_CNTL;
  327. } QSPI_TypeDef;
  328. typedef struct
  329. {
  330. __IO uint32_t CACHE_I0;
  331. __IO uint32_t CACHE_I1;
  332. __IO uint32_t CACHE_I2;
  333. __IO uint32_t CACHE_I3;
  334. __IO uint32_t CACHE_K0;
  335. __IO uint32_t CACHE_K1;
  336. __IO uint32_t CACHE_K2;
  337. __IO uint32_t CACHE_K3;
  338. __IO uint32_t CACHE_CS;
  339. __IO uint32_t CACHE_REF;
  340. __I uint32_t CACHE_RSVD0[(0x40-0x28) >> 2];
  341. __IO uint32_t CACHE_CONFIG;
  342. __I uint32_t CACHE_RSVD1[(0x74-0x44) >> 2];
  343. __IO uint32_t CACHE_SADDR;
  344. __IO uint32_t CACHE_EADDR;
  345. } CACHE_TypeDef;
  346. typedef struct
  347. {
  348. __IO uint32_t CR0; /*!< HSPIM Control register0 */
  349. __IO uint32_t FLCR; /*!< HSPIM Flow Control register */
  350. __IO uint32_t FLSR; /*!< HSPIM Flow Status register */
  351. __IO uint32_t FCR; /*!< HSPIM FIFO Control register */
  352. __I uint32_t RDR; /*!< HSPIM Read Data register */
  353. __O uint32_t WDR; /*!< HSPIM Write Data register */
  354. __I uint32_t SR; /*!< HSPIM Status register */
  355. __IO uint32_t CR1; /*!< HSPIM Control register1 */
  356. __IO uint32_t FSR; /*!< HSPIM FIFO Status register */
  357. __IO uint32_t DCR; /*!< HSPIM DMA Control register */
  358. __I uint32_t TISR; /*!< HSPIM TX Interrput Status register */
  359. __I uint32_t RISR; /*!< HSPIM RX Interrput Status register */
  360. }HSPIM_TypeDef;
  361. typedef struct
  362. {
  363. __IO uint32_t SMU_CTRL;
  364. __IO uint32_t FPM_CTRL;
  365. __O uint32_t INTR_STAT;
  366. __IO uint32_t INTR_CTRL;
  367. __IO uint32_t RESERVED1[12];
  368. __IO uint32_t SMU_OP1;
  369. __IO uint32_t SMU_OP2;
  370. __O uint32_t SMU_RES;
  371. __IO uint32_t RESERVED2[13];
  372. __IO float MATRIX1_00;
  373. __IO float MATRIX1_01;
  374. __IO float MATRIX1_02;
  375. __IO float MATRIX1_10;
  376. __IO float MATRIX1_11;
  377. __IO float MATRIX1_12;
  378. __IO float MATRIX1_20;
  379. __IO float MATRIX1_21;
  380. __IO float MATRIX1_22;
  381. __IO uint32_t RESERVED3[7];
  382. __IO float MATRIX2_00;
  383. __IO float MATRIX2_01;
  384. __IO float MATRIX2_02;
  385. __IO uint32_t RESERVED4[13];
  386. __IO uint32_t TABLE1_LEN;
  387. __IO uint32_t TABLE2_LEN;
  388. __IO uint32_t ACC;
  389. __IO uint32_t POSITION;
  390. __IO uint32_t VAL3;
  391. __IO uint32_t RESERVED5[443];
  392. __IO uint32_t TABLE1_RAM;
  393. __IO uint32_t RESERVED6[255];
  394. __IO uint32_t TABLE2_RAM;
  395. __IO uint32_t RESERVED7[63];
  396. }QRCODE_TypeDef;
  397. typedef struct
  398. {
  399. __IO uint32_t WDT_CR;
  400. __IO uint32_t RESERVED0;
  401. __I uint32_t WDT_CCVR;
  402. __O uint32_t WDT_CRR;
  403. __I uint32_t WDT_STAT;
  404. __I uint32_t WDT_EOI;
  405. __I uint32_t RESERVED1;
  406. __IO uint32_t WDT_RLD;
  407. __I uint32_t RESERVED[53];
  408. __I uint32_t WDT_COMP_PARAMS_1;
  409. __I uint32_t WDT_COMP_VERSION;
  410. __I uint32_t WDT_COMP_TYPE;
  411. } WDT_TypeDef;
  412. typedef struct
  413. {
  414. __IO uint32_t CRC_CSR;
  415. __O uint32_t CRC_INI;
  416. union
  417. {
  418. __I uint32_t DOUT;
  419. __O uint8_t DIN;
  420. } CRC_DATA;
  421. } CRC_TypeDef;
  422. typedef struct
  423. {
  424. __IO uint32_t LoadCount;
  425. __I uint32_t CurrentValue;
  426. __IO uint32_t ControlReg;
  427. __IO uint32_t EOI;
  428. __I uint32_t IntStatus;
  429. } TIM_TypeDef;
  430. #define TIM_NUM 8
  431. typedef struct
  432. {
  433. TIM_TypeDef TIM[TIM_NUM];
  434. __I uint32_t TIM_IntStatus;
  435. __I uint32_t TIM_EOI;
  436. __I uint32_t TIM_RawIntStatus;
  437. __I uint32_t TIM_Comp;
  438. __IO uint32_t TIM_ReloadCount[TIM_NUM];
  439. } TIM_Module_TypeDef;
  440. typedef struct
  441. {
  442. __IO uint32_t ADC_CR1;
  443. __I uint32_t ADC_SR;
  444. __IO uint32_t ADC_FIFO;
  445. __I uint32_t ADC_DATA;
  446. __I uint32_t ADC_FIFO_FL;
  447. __IO uint32_t ADC_FIFO_THR;
  448. __IO uint32_t ADC_CR2;
  449. } ADC_TypeDef;
  450. typedef struct
  451. {
  452. __IO uint32_t DAC_CR1;
  453. __IO uint32_t DAC_DATA;
  454. __IO uint32_t DAC_TIMER;
  455. __I uint32_t DAC_FIFO_FL;
  456. __IO uint32_t DAC_FIFO_THR;
  457. } DAC_TypeDef;
  458. typedef struct
  459. {
  460. __IO uint32_t AWD_CR1;
  461. __IO uint32_t AWD_CR2;
  462. __I uint32_t AWD_SR;
  463. } AWD_TypeDef;
  464. typedef struct
  465. {
  466. __IO uint32_t IODR;
  467. __IO uint32_t BSRR;
  468. __IO uint32_t OEN;
  469. __IO uint32_t PUE;
  470. } GPIO_TypeDef;
  471. typedef struct
  472. {
  473. __IO uint32_t INTP_TYPE;
  474. __IO uint32_t INTP_STA;
  475. } GPIO_INTP_TypeDef;
  476. #define GPIO_GROUP_NUM 6
  477. typedef struct
  478. {
  479. GPIO_TypeDef GPIO[GPIO_GROUP_NUM];
  480. __I uint32_t RSVD0[(0x114 - 0x060)>>2];
  481. __I uint32_t INTP[GPIO_GROUP_NUM];
  482. __I uint32_t RSVD1[(0x180 - 0x12C)>>2];
  483. __IO uint32_t ALT[GPIO_GROUP_NUM];
  484. __I uint32_t RSVD2[(0x200 - 0x198)>>2];
  485. __IO uint32_t SYS_CR1;
  486. __I uint32_t RSVD3[(0x220 - 0x204)>>2];
  487. __IO uint32_t WAKE_TYPE_EN;
  488. __IO uint32_t WAKE_P0_EN;
  489. __IO uint32_t WAKE_P1_EN;
  490. __IO uint32_t WAKE_P2_EN;
  491. __IO uint32_t WAKE_P3_EN;
  492. __I uint32_t RSVD5[(0x800 - 0x234)>>2];
  493. GPIO_INTP_TypeDef INTP_TYPE_STA[GPIO_GROUP_NUM];
  494. } GPIO_MODULE_TypeDef;
  495. typedef struct
  496. {
  497. __IO uint32_t FLAG[(0x0174 - 0x00164) >> 2];
  498. } FLAG_TypeDef;
  499. #define BPK_KEY_NUM 16
  500. typedef struct
  501. {
  502. __IO uint32_t KEY[BPK_KEY_NUM];
  503. __I uint32_t BPK_RSVD0[(0x80-0x40)>>2];
  504. __IO uint32_t BPK_RDY;
  505. __IO uint32_t BPK_CLR;
  506. __IO uint32_t BPK_LRA;
  507. __IO uint32_t BPK_LWA;
  508. __I uint32_t BPK_RSVD1;
  509. __IO uint32_t BPK_LR;
  510. __IO uint32_t BPK_SCR;
  511. __IO uint32_t BPK_POWER;
  512. __IO uint32_t RTC_CS;
  513. __IO uint32_t RTC_REF;
  514. __IO uint32_t RTC_ARM;
  515. __I uint32_t RTC_TIM;
  516. __O uint32_t RTC_INTCLR;
  517. __IO uint32_t OSC32K_CR;
  518. __IO uint32_t RTC_ATTA_TIM;
  519. __IO uint32_t BPK_RR;
  520. __IO uint32_t SEN_EXT_TYPE;
  521. __IO uint32_t SEN_EXT_CFG;
  522. __IO uint32_t SEN_SOFT_EN;
  523. __IO uint32_t SEN_STATE;
  524. __IO uint32_t SEN_BRIDGE;
  525. __IO uint32_t SEN_SOFT_ATTACK;
  526. __IO uint32_t SEN_SOFT_LOCK;
  527. __IO uint32_t SEN_ATTACK_CNT;
  528. __IO uint32_t SEN_ATTACK_TYP;
  529. __IO uint32_t SEN_VG_DETECT;
  530. __IO uint32_t SEN_RNG_INI;
  531. __IO uint32_t RESERVED3[(0x0104 - 0x00EC) >> 2];
  532. __IO uint32_t SEN_EN[19];
  533. __IO uint32_t SEN_EXTS_START;
  534. __IO uint32_t SEN_LOCK;
  535. __IO uint32_t SEN_ANA0;
  536. __IO uint32_t SEN_ANA1;
  537. __IO uint32_t SEN_ATTCLR;
  538. FLAG_TypeDef SEN_FLAG;
  539. __IO uint32_t SEN_DEBUG;
  540. __I uint32_t BPU_RSVD4[(0x200- 0x178) >> 2];
  541. __IO uint32_t BPK_RAM[(0x600-0x200) >> 2];
  542. } BPU_TypeDef;
  543. typedef struct
  544. {
  545. __IO uint32_t KEY[BPK_KEY_NUM];
  546. __I uint32_t BPK_RSVD0[(0x80-0x40) >> 2];
  547. __IO uint32_t BPK_RDY;
  548. __IO uint32_t BPK_CLR;
  549. __IO uint32_t BPK_LRA;
  550. __IO uint32_t BPK_LWA;
  551. __I uint32_t BPK_RSVD1;
  552. __IO uint32_t BPK_LR;
  553. __IO uint32_t BPK_SCR;
  554. __IO uint32_t BPK_POWER;
  555. } BPK_TypeDef;
  556. typedef struct
  557. {
  558. __IO uint32_t RTC_CS;
  559. __IO uint32_t RTC_REF;
  560. __IO uint32_t RTC_ARM;
  561. __I uint32_t RTC_TIM;
  562. __O uint32_t RTC_INTCLR;
  563. __IO uint32_t OSC32K_CR;
  564. __IO uint32_t RTC_ATTA_TIM;
  565. } RTC_TypeDef;
  566. #define EXT_SENSOR_NUM 8
  567. #define INNER_SENSOR_NUM 7
  568. typedef struct
  569. {
  570. __IO uint32_t BPK_RR;
  571. __IO uint32_t SEN_EXT_TYPE;
  572. __IO uint32_t SEN_EXT_CFG;
  573. __IO uint32_t SEN_SOFT_EN;
  574. __IO uint32_t SEN_STATE;
  575. __IO uint32_t SEN_BRIDGE;
  576. __IO uint32_t SEN_SOFT_ATTACK;
  577. __IO uint32_t SEN_SOFT_LOCK;
  578. __IO uint32_t SEN_ATTACK_CNT;
  579. __IO uint32_t SEN_ATTACK_TYP;
  580. __IO uint32_t SEN_VG_DETECT;
  581. __IO uint32_t SEN_RNG_INI;
  582. __IO uint32_t RESERVED3[(0x0104-0x00EC) >> 2];
  583. __IO uint32_t SEN_EN[19];
  584. __IO uint32_t SEN_EXTS_START;
  585. __IO uint32_t SEN_LOCK;
  586. __IO uint32_t SEN_ANA0;
  587. __IO uint32_t SEN_ANA1;
  588. __IO uint32_t SEN_ATTCLR;
  589. FLAG_TypeDef SEN_FLAG;
  590. __IO uint32_t SEN_DEBUG;
  591. __I uint32_t RESERVED4[(0x200- 0x178) >> 2];
  592. __IO uint32_t BPK_RAM[(0x600-0x200) >> 2];
  593. } SEN_TypeDef;
  594. typedef struct
  595. {
  596. __IO uint32_t RNG_CSR;
  597. __IO uint32_t RNG_DATA[1];
  598. __I uint32_t RES;
  599. __IO uint32_t RNG_ANA;
  600. __IO uint32_t RNG_PN;
  601. __IO uint32_t RNG_INDEX;
  602. } TRNG_TypeDef;
  603. typedef struct
  604. {
  605. __IO uint32_t IC_CON;
  606. __IO uint32_t IC_TAR;
  607. __IO uint32_t IC_SAR;
  608. __IO uint32_t IC_HS_MADDR;
  609. __IO uint32_t IC_DATA_CMD;
  610. __IO uint32_t IC_SS_SCL_HCNT;
  611. __IO uint32_t IC_SS_SCL_LCNT;
  612. __IO uint32_t IC_FS_SCL_HCNT;
  613. __IO uint32_t IC_FS_SCL_LCNT;
  614. __IO uint32_t IC_HS_SCL_HCNT;
  615. __IO uint32_t IC_HS_SCL_LCNT;
  616. __I uint32_t IC_INTR_STAT;
  617. __IO uint32_t IC_INTR_MASK;
  618. __I uint32_t IC_RAW_INTR_STAT;
  619. __IO uint32_t IC_RX_TL;
  620. __IO uint32_t IC_TX_TL;
  621. __I uint32_t IC_CLR_INTR;
  622. __I uint32_t IC_CLR_RX_UNDER;
  623. __I uint32_t IC_CLR_RX_OVER;
  624. __I uint32_t IC_CLR_TX_OVER;
  625. __I uint32_t IC_CLR_RD_REQ;
  626. __I uint32_t IC_CLR_TX_ABRT;
  627. __I uint32_t IC_CLR_RX_DONE;
  628. __I uint32_t IC_CLR_ACTIVITY;
  629. __I uint32_t IC_CLR_STOP_DET;
  630. __I uint32_t IC_CLR_START_DET;
  631. __I uint32_t IC_CLR_GEN_CALL;
  632. __IO uint32_t IC_ENABLE;
  633. __I uint32_t IC_STATUS;
  634. __I uint32_t IC_TXFLR;
  635. __I uint32_t IC_RXFLR;
  636. __IO uint32_t IC_SDA_HOLD;
  637. __I uint32_t IC_TX_ABRT_SOURCE;
  638. __IO uint32_t IC_SLV_DATA_NACK_ONLY;
  639. __IO uint32_t IC_DMA_CR;
  640. __IO uint32_t IC_DMA_TDLR;
  641. __IO uint32_t IC_DMA_RDLR;
  642. __IO uint32_t IC_SDA_SETUP;
  643. __IO uint32_t IC_ACK_GENERAL_CALL;
  644. __I uint32_t IC_ENABLE_STATUS;
  645. __IO uint32_t IC_FS_SPKLEN;
  646. __IO uint32_t IC_HS_SPKLEN;
  647. } I2C_TypeDef;
  648. typedef struct
  649. {
  650. __IO uint32_t KCU_CTRL0;
  651. __IO uint32_t KCU_CTRL1;
  652. __I uint32_t KCU_STATUS;
  653. __I uint32_t KCU_EVENT;
  654. __IO uint32_t KCU_RNG;
  655. } KCU_TypeDef;
  656. typedef struct
  657. {
  658. __IO uint32_t SAR_L;
  659. __IO uint32_t SAR_H;
  660. __IO uint32_t DAR_L;
  661. __IO uint32_t DAR_H;
  662. __IO uint32_t LLP_L;
  663. __IO uint32_t LLP_H;
  664. __IO uint32_t CTL_L;
  665. __IO uint32_t CTL_H;
  666. __IO uint32_t SSTAT_L;
  667. __IO uint32_t SSTAT_H;
  668. __IO uint32_t DSTAT_L;
  669. __IO uint32_t DSTAT_H;
  670. __IO uint32_t SSTATAR_L;
  671. __IO uint32_t SSTATAR_H;
  672. __IO uint32_t DSTATAR_L;
  673. __IO uint32_t DSTATAR_H;
  674. __IO uint32_t CFG_L;
  675. __IO uint32_t CFG_H;
  676. __IO uint32_t SGR_L;
  677. __IO uint32_t SGR_H;
  678. __IO uint32_t DSR_L;
  679. __IO uint32_t DSR_H;
  680. } DMA_TypeDef;
  681. typedef struct
  682. {
  683. DMA_TypeDef DMA_Channel[8];
  684. __I uint32_t RawTfr_L;
  685. __I uint32_t RawTfr_H;
  686. __I uint32_t RawBlock_L;
  687. __I uint32_t RawBlock_H;
  688. __I uint32_t RawSrcTran_L;
  689. __I uint32_t RawSrcTran_H;
  690. __I uint32_t RawDstTran_L;
  691. __I uint32_t RawDstTran_H;
  692. __I uint32_t RawErr_L;
  693. __I uint32_t RawErr_H;
  694. __I uint32_t StatusTfr_L;
  695. __I uint32_t StatusTfr_H;
  696. __I uint32_t StatusBlock_L;
  697. __I uint32_t StatusBlock_H;
  698. __I uint32_t StatusSrcTran_L;
  699. __I uint32_t StatusSrcTran_H;
  700. __I uint32_t StatusDstTran_L;
  701. __I uint32_t StatusDstTran_H;
  702. __I uint32_t StatusErr_L;
  703. __I uint32_t StatusErr_H;
  704. __IO uint32_t MaskTfr_L;
  705. __IO uint32_t MaskTfr_H;
  706. __IO uint32_t MaskBlock_L;
  707. __IO uint32_t MaskBlock_H;
  708. __IO uint32_t MaskSrcTran_L;
  709. __IO uint32_t MaskSrcTran_H;
  710. __IO uint32_t MaskDstTran_L;
  711. __IO uint32_t MaskDstTran_H;
  712. __IO uint32_t MaskErr_L;
  713. __IO uint32_t MaskErr_H;
  714. __O uint32_t ClearTfr_L;
  715. __O uint32_t ClearTfr_H;
  716. __O uint32_t ClearBlock_L;
  717. __O uint32_t ClearBlock_H;
  718. __O uint32_t ClearSrcTran_L;
  719. __O uint32_t ClearSrcTran_H;
  720. __O uint32_t ClearDstTran_L;
  721. __O uint32_t ClearDstTran_H;
  722. __O uint32_t ClearErr_L;
  723. __O uint32_t ClearErr_H;
  724. __I uint32_t StatusInt_L;
  725. __I uint32_t StatusInt_H;
  726. __IO uint32_t ReqSrcReg_L;
  727. __IO uint32_t ReqSrcReg_H;
  728. __IO uint32_t ReqDstReg_L;
  729. __IO uint32_t ReqDstReg_H;
  730. __IO uint32_t SglReqSrcReg_L;
  731. __IO uint32_t SglReqSrcReg_H;
  732. __IO uint32_t SglReqDstReg_L;
  733. __IO uint32_t SglReqDstReg_H;
  734. __IO uint32_t LstSrcReg_L;
  735. __IO uint32_t LstSrcReg_H;
  736. __IO uint32_t LstDstReg_L;
  737. __IO uint32_t LstDstReg_H;
  738. __IO uint32_t DmaCfgReg_L;
  739. __IO uint32_t DmaCfgReg_H;
  740. __IO uint32_t ChEnReg_L;
  741. __IO uint32_t ChEnReg_H;
  742. __I uint32_t DmaIdReg_L;
  743. __I uint32_t DmaIdReg_H;
  744. __IO uint32_t DmaTestReg_L;
  745. __IO uint32_t DmaTestReg_H;
  746. __IO uint32_t RESERVED2[4];
  747. __I uint32_t DMA_COMP_PARAMS_6_L;
  748. __I uint32_t DMA_COMP_PARAMS_6_H;
  749. __I uint32_t DMA_COMP_PARAMS_5_L;
  750. __I uint32_t DMA_COMP_PARAMS_5_H;
  751. __I uint32_t DMA_COMP_PARAMS_4_L;
  752. __I uint32_t DMA_COMP_PARAMS_4_H;
  753. __I uint32_t DMA_COMP_PARAMS_3_L;
  754. __I uint32_t DMA_COMP_PARAMS_3_H;
  755. __I uint32_t DMA_COMP_PARAMS_2_L;
  756. __I uint32_t DMA_COMP_PARAMS_2_H;
  757. __I uint32_t DMA_COMP_PARAMS_1_L;
  758. __I uint32_t DMA_COMP_PARAMS_1_H;
  759. __I uint32_t DMA_Component_ID_Register_L;
  760. __I uint32_t DMA_Component_ID_Register_H;
  761. } DMA_MODULE_TypeDef;
  762. typedef struct
  763. {
  764. __IO uint32_t lcdi_ctrl;
  765. __IO uint32_t lcdi_cycle;
  766. __IO uint32_t lcdi_status;
  767. __IO uint32_t lcdi_data;
  768. __IO uint32_t lcdi_fifolevel;
  769. __IO uint32_t lcdi_fifothr;
  770. } LCD_TypeDef;
  771. typedef struct
  772. {
  773. __IO uint32_t SCI_DATA;
  774. __IO uint32_t SCI_CR0;
  775. __IO uint32_t SCI_CR1;
  776. __IO uint32_t SCI_CR2;
  777. __IO uint32_t SCI_IER;
  778. __IO uint32_t SCI_RETRY;
  779. __IO uint32_t SCI_TIDE;
  780. __IO uint32_t SCI_TXCOUNT;
  781. __IO uint32_t SCI_RXCOUNT;
  782. __I uint32_t SCI_FR;
  783. __IO uint32_t SCI_RXTIME;
  784. __IO uint32_t SCI_ISTAT;
  785. __IO uint32_t SCI_STABLE;
  786. __IO uint32_t SCI_ATIME;
  787. __IO uint32_t SCI_DTIME;
  788. __IO uint32_t SCI_ATRSTIME;
  789. __IO uint32_t SCI_ATRDTIME;
  790. __IO uint32_t SCI_BLKTIME;
  791. __IO uint32_t SCI_CHTIME;
  792. __IO uint32_t SCI_CLKICC;
  793. __IO uint32_t SCI_BAUD;
  794. __IO uint32_t SCI_VALUE;
  795. __IO uint32_t SCI_CHGUARD;
  796. __IO uint32_t SCI_BLKGUARD;
  797. __IO uint32_t SCI_SYNCCR;
  798. __IO uint32_t SCI_SYNCDATA;
  799. __IO uint32_t SCI_RAWSTAT;
  800. __IO uint32_t SCI_IIR;
  801. __I uint32_t SCI_RES1[4];
  802. __I uint32_t SCI_RES2[32];
  803. } SCI_TypeDef;
  804. /**
  805. * @brief DCMI&IMG COP
  806. */
  807. typedef struct
  808. {
  809. __IO uint32_t CR; /*!< DCMI control register 1, Address offset: 0x00 */
  810. __IO uint32_t SR; /*!< DCMI status register, Address offset: 0x04 */
  811. __IO uint32_t RISR; /*!< DCMI raw interrupt status register, Address offset: 0x08 */
  812. __IO uint32_t IER; /*!< DCMI interrupt enable register, Address offset: 0x0C */
  813. __IO uint32_t MISR; /*!< DCMI masked interrupt status register, Address offset: 0x10 */
  814. __IO uint32_t ICR; /*!< DCMI interrupt clear register, Address offset: 0x14 */
  815. __IO uint32_t RESERVED1[2];
  816. __IO uint32_t CWSTRTR; /*!< DCMI crop window start, Address offset: 0x20 */
  817. __IO uint32_t CWSIZER; /*!< DCMI crop window size, Address offset: 0x24 */
  818. __IO uint32_t DR; /*!< DCMI data register, Address offset: 0x28 */
  819. } DCMI_TypeDef;
  820. typedef struct
  821. {
  822. __IO uint32_t RESERVED[(0x2000-0x0000)/4];
  823. __IO uint32_t CFG;
  824. __IO uint32_t CS;
  825. __IO uint32_t PROT;
  826. __IO uint32_t ADDR;
  827. __IO uint32_t PDATA;
  828. __IO uint32_t RO;
  829. __IO uint32_t ROL;
  830. __IO uint32_t RSVD;
  831. __IO uint32_t TIM;
  832. __IO uint32_t TIM_EN;
  833. } OTP_TypeDef;
  834. typedef struct
  835. {
  836. __IO uint32_t RESERVED0[(0x0008-0x0000) >> 2];
  837. __IO uint32_t SSC_CR3;
  838. __O uint32_t RESERVED1[(0x0104-0x000C) >> 2];
  839. __IO uint32_t SSC_SR;
  840. __IO uint32_t SSC_SR_CLR;
  841. __IO uint32_t SSC_ACK;
  842. __O uint32_t RESERVED2[(0x0184-0x0110) >> 2];
  843. __IO uint32_t DATARAM_SCR;
  844. __O uint32_t RESERVED3[(0x01FC-0x0188) >> 2];
  845. __IO uint32_t BPU_RWC;
  846. __O uint32_t RESERVED4[(0x03EC-0x0200) >> 2];
  847. __IO uint32_t MAIN_SEN_LOCK;
  848. __IO uint32_t MAIN_SEN_EN;
  849. } SSC_TypeDef;
  850. typedef struct
  851. {
  852. __IO uint32_t TST_JTAG;
  853. __IO uint32_t TST_ROM;
  854. __IO uint32_t TST_FLASH;
  855. } MH_SMCU_TST_TypeDef;
  856. #if defined ( __CC_ARM )
  857. #pragma no_anon_unions
  858. #endif
  859. /*@}*/ /* end of group <Device>_Peripherals */
  860. /******************************************************************************/
  861. /* Peripheral memory map */
  862. /******************************************************************************/
  863. /* ToDo: add here your device peripherals base addresses
  864. following is an example for timer */
  865. /** @addtogroup <Device>_MemoryMap <Device> Memory Mapping
  866. @{
  867. */
  868. /* Peripheral and SRAM base address */
  869. #define AIR105_FLASH_BASE (0x01000000UL) /*!< (FLASH ) Base Address */
  870. #define AIR105_SRAM_BASE (0x20000000UL) /*!< (SRAM ) Base Address */
  871. #define AIR105_PERIPH_BASE (0x40000000UL) /*!< (Peripheral) Base Address */
  872. #define AIR105_SRAM_SIZE (0xA0000)
  873. #define AIR105_OTP_BASE (0x40008000UL)
  874. #define AIR105_OTP_SIZE (1UL << 13)
  875. /* Peripheral memory map */
  876. #define AIR105_AHB_BASE (AIR105_PERIPH_BASE)
  877. #define AIR105_APB0_BASE (AIR105_PERIPH_BASE + 0x10000)
  878. #define AIR105_APB1_BASE (AIR105_PERIPH_BASE + 0x20000)
  879. #define AIR105_APB2_BASE (AIR105_PERIPH_BASE + 0x30000)
  880. #define AIR105_APB3_BASE (AIR105_PERIPH_BASE + 0x40000)
  881. #define SSC_BASE (AIR105_AHB_BASE + 0x0000)
  882. #define TST_BASE (AIR105_AHB_BASE + 0x03F4)
  883. #define DMA_BASE (AIR105_AHB_BASE + 0x0800)
  884. #define USB_BASE (AIR105_AHB_BASE + 0x0C00)
  885. #define LCD_BASE (AIR105_AHB_BASE + 0x1000)
  886. #define OTP_BASE (AIR105_AHB_BASE + 0x8000)
  887. #define DCMI_BASE (AIR105_AHB_BASE + 0x60000)
  888. #define CACHE_BASE (AIR105_AHB_BASE + 0x80000)
  889. #define QRCODE_BASE (AIR105_AHB_BASE + 0x90000)
  890. #define GPU_BASE (AIR105_AHB_BASE + 0xA1000)
  891. #define QSPI_BASE (AIR105_AHB_BASE + 0xA2000)
  892. #define HSPI_BASE (AIR105_AHB_BASE + 0xA3000)
  893. #define SCI0_BASE (AIR105_APB0_BASE)
  894. #define CRC_BASE (AIR105_APB0_BASE + 0x2000)
  895. #define TIMM0_BASE (AIR105_APB0_BASE + 0x3000)
  896. #define ADC_BASE (AIR105_APB0_BASE + 0x4000)
  897. #define DAC_BASE (AIR105_APB0_BASE + 0x4100)
  898. #define AWD_BASE (AIR105_APB0_BASE + 0x4200)
  899. #define SCI2_BASE (AIR105_APB0_BASE + 0x5000)
  900. #define UART0_BASE (AIR105_APB0_BASE + 0x6000)
  901. #define UART1_BASE (AIR105_APB0_BASE + 0x7000)
  902. #define SPIM1_BASE (AIR105_APB0_BASE + 0x8000)
  903. #define SPIM2_BASE (AIR105_APB0_BASE + 0x9000)
  904. #define SPIM0_BASE (AIR105_APB0_BASE + 0xA000)
  905. #define SPIS0_BASE (AIR105_APB0_BASE + 0xB000)
  906. #define WDG_BASE (AIR105_APB0_BASE + 0xC000)
  907. #define GPIO_BASE (AIR105_APB0_BASE + 0xD000)
  908. #define TRNG_BASE (AIR105_APB0_BASE + 0xE000)
  909. #define SYSCTRL_BASE (AIR105_APB0_BASE + 0xF000)
  910. #define MSR_BASE (AIR105_APB1_BASE)
  911. #define BPU_BASE (AIR105_APB2_BASE)
  912. #define UART2_BASE (AIR105_APB3_BASE + 0x4000)
  913. #define UART3_BASE (AIR105_APB3_BASE + 0x5000)
  914. #define KEYBOARD_BASE (AIR105_APB3_BASE + 0x8000)
  915. #define I2C0_BASE (AIR105_APB3_BASE + 0x9000)
  916. #define HSPIM_BASE (AIR105_AHB_BASE + 0xA3020)
  917. /*@}*/ /* end of group <Device>_MemoryMap */
  918. /******************************************************************************/
  919. /* Peripheral declaration */
  920. /******************************************************************************/
  921. /* ToDo: add here your device peripherals pointer definitions
  922. following is an example for timer */
  923. /** @addtogroup <Device>_PeripheralDecl <Device> Peripheral Declaration
  924. @{
  925. */
  926. #define SYSCTRL ((SYSCTRL_TypeDef *) SYSCTRL_BASE)
  927. #define UART0 ((UART_TypeDef *) UART0_BASE)
  928. #define UART1 ((UART_TypeDef *) UART1_BASE)
  929. #define UART2 ((UART_TypeDef *) UART2_BASE)
  930. #define UART3 ((UART_TypeDef *) UART3_BASE)
  931. #define SPIM0 ((SPI_TypeDef *) SPIM0_BASE)
  932. #define SPIM1 ((SPI_TypeDef *) SPIM1_BASE)
  933. #define SPIM2 ((SPI_TypeDef *) SPIM2_BASE)
  934. #define SPIS0 ((SPI_TypeDef *) SPIS0_BASE)
  935. #define QSPI ((QSPI_TypeDef *) QSPI_BASE)
  936. #define HSPIM ((HSPIM_TypeDef *) HSPIM_BASE)
  937. #define CACHE ((CACHE_TypeDef *)CACHE_BASE)
  938. #define QRCODE ((QRCODE_TypeDef *)QRCODE_BASE)
  939. #define GPU ((GPU_TypeDef *)GPU_BASE)
  940. #define SCI0 ((SCI_TypeDef *) SCI0_BASE)
  941. #define SCI2 ((SCI_TypeDef *) SCI2_BASE)
  942. #define TIMM0 ((TIM_Module_TypeDef *)TIMM0_BASE)
  943. #define ADC0 ((ADC_TypeDef *)ADC_BASE)
  944. #define DAC ((DAC_TypeDef *)DAC_BASE)
  945. #define AWD ((AWD_TypeDef *)AWD_BASE)
  946. #define TRNG ((TRNG_TypeDef *)TRNG_BASE)
  947. #define LCD ((LCD_TypeDef *)LCD_BASE)
  948. #define KCU ((KCU_TypeDef *)KEYBOARD_BASE)
  949. #define CRC ((CRC_TypeDef *)CRC_BASE)
  950. #define OTP ((OTP_TypeDef *)OTP_BASE)
  951. #define I2C0 ((I2C_TypeDef *)I2C0_BASE)
  952. #define DMA ((DMA_MODULE_TypeDef *)DMA_BASE)
  953. #define DMA_Channel_0 ((DMA_TypeDef *)DMA_BASE)
  954. #define DMA_Channel_1 ((DMA_TypeDef *)(DMA_BASE + 0x58))
  955. #define DMA_Channel_2 ((DMA_TypeDef *)(DMA_BASE + 0x58*2))
  956. #define DMA_Channel_3 ((DMA_TypeDef *)(DMA_BASE + 0x58*3))
  957. #define DMA_Channel_4 ((DMA_TypeDef *)(DMA_BASE + 0x58*4))
  958. #define DMA_Channel_5 ((DMA_TypeDef *)(DMA_BASE + 0x58*5))
  959. #define DMA_Channel_6 ((DMA_TypeDef *)(DMA_BASE + 0x58*6))
  960. #define DMA_Channel_7 ((DMA_TypeDef *)(DMA_BASE + 0x58*7))
  961. #define GPIO ((GPIO_MODULE_TypeDef *)GPIO_BASE)
  962. #define GPIOA ((GPIO_TypeDef *)GPIO_BASE)
  963. #define GPIOB ((GPIO_TypeDef *)(GPIO_BASE + 0x0010))
  964. #define GPIOC ((GPIO_TypeDef *)(GPIO_BASE + 0x0020))
  965. #define GPIOD ((GPIO_TypeDef *)(GPIO_BASE + 0x0030))
  966. #define GPIOE ((GPIO_TypeDef *)(GPIO_BASE + 0x0040))
  967. #define GPIOF ((GPIO_TypeDef *)(GPIO_BASE + 0x0050))
  968. #define GPIO_GROUP ((GPIO_TypeDef *)GPIO_BASE)
  969. #define GPIO_ALT_GROUP ((__IO uint32_t *)(GPIO_BASE + 0x180))
  970. #define GPIO_WKEN_TYPE_EN ((__IO uint32_t *)(GPIO_BASE + 0x220))
  971. #define GPIO_WKEN_P0_EN ((__IO uint32_t *)(GPIO_BASE + 0x224))
  972. #define GPIO_WKEN_P1_EN ((__IO uint32_t *)(GPIO_BASE + 0x228))
  973. #define GPIO_WKEN_P2_EN ((__IO uint32_t *)(GPIO_BASE + 0x22C))
  974. #define WDT ((WDT_TypeDef *)WDG_BASE)
  975. #define SSC ((SSC_TypeDef *)SSC_BASE)
  976. #define TST ((MH_SMCU_TST_TypeDef *)TST_BASE)
  977. #define DCMI ((DCMI_TypeDef *)DCMI_BASE)
  978. #define BPU ((BPU_TypeDef *)BPU_BASE)
  979. #define BPK ((BPK_TypeDef *)BPU_BASE)
  980. #define RTC ((RTC_TypeDef *)(BPU_BASE + 0xA0))
  981. #define SENSOR ((SEN_TypeDef *)(BPU_BASE + 0xBC))
  982. #define SEN_FLAG ((FLAG_TypeDef*)(BPU_BASE + 0x164))
  983. /** @addtogroup Exported_constants
  984. * @{
  985. */
  986. /** @addtogroup Peripheral_Registers_Bits_Definition
  987. * @{
  988. */
  989. /******************************************************************************/
  990. /* Peripheral Registers_Bits_Definition */
  991. /******************************************************************************/
  992. /******************************************************************************/
  993. /* */
  994. /* System Control Unit */
  995. /* */
  996. /******************************************************************************/
  997. /******************* Bit definition for FREQ_SEL register *******************/
  998. #define SYSCTRL_FREQ_SEL_XTAL_Pos (16)
  999. #define SYSCTRL_FREQ_SEL_XTAL_Mask (0x1F << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1000. #define SYSCTRL_FREQ_SEL_XTAL_108Mhz (0x08 << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1001. #define SYSCTRL_FREQ_SEL_XTAL_120Mhz (0x09 << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1002. #define SYSCTRL_FREQ_SEL_XTAL_132Mhz (0x0a << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1003. #define SYSCTRL_FREQ_SEL_XTAL_144Mhz (0x0b << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1004. #define SYSCTRL_FREQ_SEL_XTAL_156Mhz (0x0c << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1005. #define SYSCTRL_FREQ_SEL_XTAL_168Mhz (0x0d << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1006. #define SYSCTRL_FREQ_SEL_XTAL_180Mhz (0x0e << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1007. #define SYSCTRL_FREQ_SEL_XTAL_192Mhz (0x0f << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1008. #define SYSCTRL_FREQ_SEL_XTAL_204Mhz (0x10 << SYSCTRL_FREQ_SEL_XTAL_Pos)
  1009. #define SYSCTRL_FREQ_SEL_CLOCK_SOURCE_Pos (12)
  1010. #define SYSCTRL_FREQ_SEL_CLOCK_SOURCE_Mask (0x01 << SYSCTRL_FREQ_SEL_CLOCK_SOURCE_Pos)
  1011. #define SYSCTRL_FREQ_SEL_CLOCK_SOURCE_EXT (0x00 << SYSCTRL_FREQ_SEL_CLOCK_SOURCE_Pos)
  1012. #define SYSCTRL_FREQ_SEL_CLOCK_SOURCE_INC (0x01 << SYSCTRL_FREQ_SEL_CLOCK_SOURCE_Pos)
  1013. #define SYSCTRL_FREQ_SEL_PLL_DIV_Pos (8)
  1014. #define SYSCTRL_FREQ_SEL_PLL_DIV_Mask (0x03 << SYSCTRL_FREQ_SEL_PLL_DIV_Pos)
  1015. #define SYSCTRL_FREQ_SEL_PLL_DIV_1_0 (0x00 << SYSCTRL_FREQ_SEL_PLL_DIV_Pos)
  1016. #define SYSCTRL_FREQ_SEL_PLL_DIV_1_2 (0x01 << SYSCTRL_FREQ_SEL_PLL_DIV_Pos)
  1017. #define SYSCTRL_FREQ_SEL_PLL_DIV_1_4 (0x02 << SYSCTRL_FREQ_SEL_PLL_DIV_Pos)
  1018. #define SYSCTRL_FREQ_SEL_HCLK_DIV_Pos (4)
  1019. #define SYSCTRL_FREQ_SEL_HCLK_DIV_Mask (0x01 << SYSCTRL_FREQ_SEL_HCLK_DIV_Pos)
  1020. #define SYSCTRL_FREQ_SEL_HCLK_DIV_1_0 (0x00 << SYSCTRL_FREQ_SEL_HCLK_DIV_Pos)
  1021. #define SYSCTRL_FREQ_SEL_HCLK_DIV_1_2 (0x01 << SYSCTRL_FREQ_SEL_HCLK_DIV_Pos)
  1022. #define SYSCTRL_FREQ_SEL_PCLK_DIV_Pos (0)
  1023. #define SYSCTRL_FREQ_SEL_PCLK_DIV_Mask (0x01 << SYSCTRL_FREQ_SEL_PCLK_DIV_Pos)
  1024. #define SYSCTRL_FREQ_SEL_PCLK_DIV_1_2 (0x00 << SYSCTRL_FREQ_SEL_PCLK_DIV_Pos)
  1025. #define SYSCTRL_FREQ_SEL_PCLK_DIV_1_4 (0x01 << SYSCTRL_FREQ_SEL_PCLK_DIV_Pos)
  1026. /******************* Bit definition for CG_CTRL2 register *******************/
  1027. #define SYSCTRL_AHBPeriph_DMA ((uint32_t)0x20000000)
  1028. #define SYSCTRL_AHBPeriph_USB ((uint32_t)0x10000000)
  1029. #define SYSCTRL_AHBPeriph_QR ((uint32_t)0x00000020)
  1030. #define SYSCTRL_AHBPeriph_OTP ((uint32_t)0x00000008)
  1031. #define SYSCTRL_AHBPeriph_GPU ((uint32_t)0x00000004)
  1032. #define SYSCTRL_AHBPeriph_LCD ((uint32_t)0x00000002)
  1033. #define SYSCTRL_AHBPeriph_CRYPT ((uint32_t)0x00000001)
  1034. #define SYSCTRL_AHBPeriph_ALL ((uint32_t)0x3000002F)
  1035. #define IS_SYSCTRL_AHB_PERIPH(PERIPH) ((((PERIPH) & ~SYSCTRL_AHBPeriph_ALL) == 0x00) && ((PERIPH) != 0x00))
  1036. /******************* Bit definition for CG_CTRL1 register *******************/
  1037. #define SYSCTRL_APBPeriph_TRNG ((uint32_t)0x80000000)
  1038. #define SYSCTRL_APBPeriph_ADC ((uint32_t)0x40000000)
  1039. #define SYSCTRL_APBPeriph_CRC ((uint32_t)0x20000000)
  1040. #define SYSCTRL_APBPeriph_KBD ((uint32_t)0x08000000)
  1041. #define SYSCTRL_APBPeriph_BPU ((uint32_t)0x04000000)
  1042. #define SYSCTRL_APBPeriph_DCMIS ((uint32_t)0x00800000)
  1043. #define SYSCTRL_APBPeriph_TIMM0 ((uint32_t)0x00200000)
  1044. #define SYSCTRL_APBPeriph_GPIO ((uint32_t)0x00100000)
  1045. #define SYSCTRL_APBPeriph_I2C0 ((uint32_t)0x00040000)
  1046. #define SYSCTRL_APBPeriph_SCI2 ((uint32_t)0x00010000)
  1047. #define SYSCTRL_APBPeriph_SCI0 ((uint32_t)0x00004000)
  1048. #define SYSCTRL_APBPeriph_HSPI ((uint32_t)0x00002000)
  1049. #define SYSCTRL_APBPeriph_SPI2 ((uint32_t)0x00000400)
  1050. #define SYSCTRL_APBPeriph_SPI1 ((uint32_t)0x00000200)
  1051. #define SYSCTRL_APBPeriph_SPI0 ((uint32_t)0x00000100)
  1052. #define SYSCTRL_APBPeriph_UART3 ((uint32_t)0x00000008)
  1053. #define SYSCTRL_APBPeriph_UART2 ((uint32_t)0x00000004)
  1054. #define SYSCTRL_APBPeriph_UART1 ((uint32_t)0x00000002)
  1055. #define SYSCTRL_APBPeriph_UART0 ((uint32_t)0x00000001)
  1056. #define SYSCTRL_APBPeriph_ALL ((uint32_t)0xECB5670F)
  1057. #define IS_SYSCTRL_APB_PERIPH(PERIPH) ((((PERIPH) & ~SYSCTRL_APBPeriph_ALL) == 0x00) && ((PERIPH) != 0x00))
  1058. /******************* Bit definition for SOFT_RST2 register *******************/
  1059. #define SYSCTRL_GLB_RESET ((uint32_t)0x80000000)
  1060. #define SYSCTRL_CM3_RESET ((uint32_t)0x40000000)
  1061. #define SYSCTRL_DMA_RESET ((uint32_t)0x20000000)
  1062. #define SYSCTRL_USB_RESET ((uint32_t)0x10000000)
  1063. #define SYSCTRL_QR_RESET ((uint32_t)0x00000020)
  1064. #define SYSCTRL_OTP_RESET ((uint32_t)0x00000008)
  1065. #define SYSCTRL_GPU_RESET ((uint32_t)0x00000004)
  1066. #define SYSCTRL_LCD_RESET ((uint32_t)0x00000002)
  1067. #define SYSCTRL_CRYPT_RESET ((uint32_t)0x00000001)
  1068. #define SYSCTRL_AHBPeriph_RESET_ALL ((uint32_t)0xF000002F)
  1069. #define IS_SYSCTRL_AHB_PERIPH_RESET(PERIPH) ((((PERIPH) & ~SYSCTRL_AHBPeriph_RESET_ALL) == 0x00) && ((PERIPH) != 0x00))
  1070. /******************* Bit definition for PHER_CTRL register *******************/
  1071. #define SYSCTRL_PHER_CTRL_SPI0_SLV_EN ((uint32_t)0x01000000) /* 0:MASTER 1:SLAVE */
  1072. #define SYSCTRL_PHER_CTRL_SCI2_VCCEN_INV ((uint32_t)0x00400000)
  1073. #define SYSCTRL_PHER_CTRL_SCI0_VCCEN_INV ((uint32_t)0x00100000)
  1074. #define SYSCTRL_PHER_CTRL_SCI2_CDET_INV ((uint32_t)0x00040000)
  1075. #define SYSCTRL_PHER_CTRL_SCI0_CDET_INV ((uint32_t)0x00010000)
  1076. /******************* Bit definition for DMA_CHAN REGISTER ********************/
  1077. #define SYSCTRL_PHER_CTRL_DMA_CH0_IF_Pos (0)
  1078. #define SYSCTRL_PHER_CTRL_DMA_CH0_IF_Mask (0x3FU<<SYSCTRL_PHER_CTRL_DMA_CH0_IF_Pos)
  1079. #define SYSCTRL_PHER_CTRL_DMA_CH1_IF_Pos (8)
  1080. #define SYSCTRL_PHER_CTRL_DMA_CH1_IF_Mask (0x3FU<<SYSCTRL_PHER_CTRL_DMA_CH1_IF_Pos)
  1081. #define SYSCTRL_PHER_CTRL_DMA_CH2_IF_Pos (16)
  1082. #define SYSCTRL_PHER_CTRL_DMA_CH2_IF_Mask (0x3FU<<SYSCTRL_PHER_CTRL_DMA_CH2_IF_Pos)
  1083. #define SYSCTRL_PHER_CTRL_DMA_CH3_IF_Pos (24)
  1084. #define SYSCTRL_PHER_CTRL_DMA_CH3_IF_Mask (0x3FU<<SYSCTRL_PHER_CTRL_DMA_CH3_IF_Pos)
  1085. #define SYSCTRL_PHER_CTRL_DMA_CH4_IF_Pos (0)
  1086. #define SYSCTRL_PHER_CTRL_DMA_CH4_IF_Mask (0x3FU<<SYSCTRL_PHER_CTRL_DMA_CH4_IF_Pos)
  1087. #define SYSCTRL_PHER_CTRL_DMA_CH5_IF_Pos (8)
  1088. #define SYSCTRL_PHER_CTRL_DMA_CH5_IF_Mask (0x3FU<<SYSCTRL_PHER_CTRL_DMA_CH5_IF_Pos)
  1089. #define SYSCTRL_PHER_CTRL_DMA_CH6_IF_Pos (16)
  1090. #define SYSCTRL_PHER_CTRL_DMA_CH6_IF_Mask (0x3FU<<SYSCTRL_PHER_CTRL_DMA_CH6_IF_Pos)
  1091. #define SYSCTRL_PHER_CTRL_DMA_CH7_IF_Pos (24)
  1092. #define SYSCTRL_PHER_CTRL_DMA_CH7_IF_Mask (0x3FU<<SYSCTRL_PHER_CTRL_DMA_CH7_IF_Pos)
  1093. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_DCMI_TX (0x00)
  1094. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_LCD (0x01)
  1095. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_UART0_TX (0x02)
  1096. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_UART0_RX (0x03)
  1097. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_UART1_TX (0x04)
  1098. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_UART1_RX (0x05)
  1099. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_DAC (0x06)
  1100. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_SPI0_TX (0x0A)
  1101. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_SPI0_RX (0x0B)
  1102. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_SPI1_TX (0x0C)
  1103. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_SPI1_RX (0x0D)
  1104. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_SPI2_TX (0x0E)
  1105. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_SPI2_RX (0x0F)
  1106. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_UART2_TX (0x14)
  1107. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_UART2_RX (0x15)
  1108. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_UART3_TX (0x16)
  1109. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_UART3_RX (0x17)
  1110. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_I2C_TX (0x18)
  1111. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_I2C_RX (0x19)
  1112. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_QSPI_TX (0x1A)
  1113. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_HSPI_RX (0x20)
  1114. #define SYSCTRL_PHER_CTRL_DMA_CHx_IF_HSPI_TX (0x21)
  1115. /******************************************************************************/
  1116. /* */
  1117. /* Universal Asynchronous Receiver Transmitter */
  1118. /* */
  1119. /******************************************************************************/
  1120. /******************* Bit definition for UART_RBR register *******************/
  1121. #define UART_RBR_RBR ((uint32_t)0x01FF) /*!< Data value */
  1122. /******************* Bit definition for UART_THR register *******************/
  1123. #define UART_THR_THR ((uint32_t)0x01FF) /*!< Data value */
  1124. /******************* Bit definition for UART_DLH register *******************/
  1125. #define UART_DLH_DLH ((uint32_t)0x0FF)
  1126. /******************* Bit definition for UART_DLL register *******************/
  1127. #define UART_DLL_DLL ((uint32_t)0x0FF)
  1128. /******************* Bit definition for UART_IER register *******************/
  1129. #define UART_IER_ERBFI ((uint32_t)0x0001)
  1130. #define UART_IER_ETBEI ((uint32_t)0x0002)
  1131. #define UART_IER_ELSI ((uint32_t)0x0004)
  1132. #define UART_IER_EDSSI ((uint32_t)0x0008)
  1133. #define UART_IER_PTIME ((uint32_t)0x0080)
  1134. /******************* Bit definition for UART_IIR register *******************/
  1135. #define UART_IIR_IID ((uint32_t)0x0007)
  1136. #define UART_IIR_IID_0 ((uint32_t)0x0001)
  1137. #define UART_IIR_IID_1 ((uint32_t)0x0002)
  1138. #define UART_IIR_IID_2 ((uint32_t)0x0004)
  1139. #define UART_IIR_IID_3 ((uint32_t)0x0008)
  1140. #define UART_IIR_FIFOSE ((uint32_t)0x0060)
  1141. #define UART_IIR_FIFOSE_0 ((uint32_t)0x0020)
  1142. #define UART_IIR_FIFOSE_1 ((uint32_t)0x0040)
  1143. /******************* Bit definition for UART_FCR register *******************/
  1144. #define UART_FCR_FIFOE ((uint32_t)0x0001)
  1145. #define UART_FCR_RFIFOR ((uint32_t)0x0002)
  1146. #define UART_FCR_XFIFOR ((uint32_t)0x0004)
  1147. #define UART_FCR_DMAM ((uint32_t)0x0008)
  1148. #define UART_FCR_TET ((uint32_t)0x0030)
  1149. #define UART_FCR_TET_0 ((uint32_t)0x0010)
  1150. #define UART_FCR_TET_1 ((uint32_t)0x0020)
  1151. #define UART_FCR_RCVER ((uint32_t)0x00C0)
  1152. #define UART_FCR_RCVER_0 ((uint32_t)0x0040)
  1153. #define UART_FCR_RCVER_1 ((uint32_t)0x0080)
  1154. /******************* Bit definition for UART_LCR register *******************/
  1155. #define UART_LCR_DLS ((uint32_t)0x0003)
  1156. #define UART_LCR_DLS_0 ((uint32_t)0x0001)
  1157. #define UART_LCR_DLS_1 ((uint32_t)0x0002)
  1158. #define UART_LCR_STOP ((uint32_t)0x0004)
  1159. #define UART_LCR_PEN ((uint32_t)0x0008)
  1160. #define UART_LCR_EPS ((uint32_t)0x0010)
  1161. #define UART_LCR_SP ((uint32_t)0x0020)
  1162. #define UART_LCR_BC ((uint32_t)0x0040)
  1163. #define UART_LCR_DLAB ((uint32_t)0x0080)
  1164. /******************* Bit definition for UART_MCR register *******************/
  1165. #define UART_MCR_DTR ((uint32_t)0x0001)
  1166. #define UART_MCR_RTS ((uint32_t)0x0002)
  1167. #define UART_MCR_OUT1 ((uint32_t)0x0004)
  1168. #define UART_MCR_OUT2 ((uint32_t)0x0008)
  1169. #define UART_MCR_LB ((uint32_t)0x0010)
  1170. #define UART_MCR_AFCE ((uint32_t)0x0020)
  1171. #define UART_MCR_SIRE ((uint32_t)0x0040)
  1172. /******************* Bit definition for UART_LSR register *******************/
  1173. #define UART_LSR_DR ((uint32_t)0x0001)
  1174. #define UART_LSR_OE ((uint32_t)0x0002)
  1175. #define UART_LSR_PE ((uint32_t)0x0004)
  1176. #define UART_LSR_FE ((uint32_t)0x0008)
  1177. #define UART_LSR_BI ((uint32_t)0x0010)
  1178. #define UART_LSR_THRE ((uint32_t)0x0020)
  1179. #define UART_LSR_TEMT ((uint32_t)0x0040)
  1180. #define UART_LSR_PFE ((uint32_t)0x0080)
  1181. /******************* Bit definition for UART_MSR register *******************/
  1182. #define UART_MSR_DCTS ((uint32_t)0x0001)
  1183. #define UART_MSR_DDSR ((uint32_t)0x0002)
  1184. #define UART_MSR_TERI ((uint32_t)0x0004)
  1185. #define UART_MSR_DDCD ((uint32_t)0x0008)
  1186. #define UART_MSR_CTS ((uint32_t)0x0010)
  1187. #define UART_MSR_DSR ((uint32_t)0x0020)
  1188. #define UART_MSR_RI ((uint32_t)0x0040)
  1189. #define UART_MSR_DCD ((uint32_t)0x0080)
  1190. /******************* Bit definition for UART_SRBR register *******************/
  1191. #define UART_SRBR_SRBR ((uint32_t)0x01FF) /*!< Data value */
  1192. /******************* Bit definition for UART_STHR register *******************/
  1193. #define UART_STHR_STHR ((uint32_t)0x01FF) /*!< Data value */
  1194. /******************* Bit definition for UART_FAR register *******************/
  1195. #define UART_FAR_FAR ((uint32_t)0x0001)
  1196. /******************* Bit definition for UART_TFR register *******************/
  1197. #define UART_TFR_TFR ((uint32_t)0x00FF)
  1198. /******************* Bit definition for UART_RFW register *******************/
  1199. #define UART_RFW_RFWD ((uint32_t)0x00FF)
  1200. #define UART_RFW_RFPE ((uint32_t)0x0100)
  1201. #define UART_RFW_RFFE ((uint32_t)0x0200)
  1202. /******************* Bit definition for UART_USR register *******************/
  1203. #define UART_USR_BUSY ((uint32_t)0x0001)
  1204. #define UART_USR_TFNF ((uint32_t)0x0002)
  1205. #define UART_USR_TFE ((uint32_t)0x0004)
  1206. #define UART_USR_RFNE ((uint32_t)0x0008)
  1207. #define UART_USR_RFF ((uint32_t)0x0010)
  1208. /******************* Bit definition for UART_TFL register *******************/
  1209. #define UART_TFL_TFL ((uint32_t)0x000F)
  1210. /******************* Bit definition for UART_RFL register *******************/
  1211. #define UART_RFL_RFL ((uint32_t)0x000F)
  1212. /******************* Bit definition for UART_SRR register *******************/
  1213. #define UART_SRR_UR ((uint32_t)0x0001)
  1214. #define UART_SRR_RFR ((uint32_t)0x0002)
  1215. #define UART_SRR_XFR ((uint32_t)0x0004)
  1216. /******************* Bit definition for UART_SRR register *******************/
  1217. #define UART_SRR_UR ((uint32_t)0x0001)
  1218. /******************* Bit definition for UART_SRTS register *******************/
  1219. #define UART_SRTS_SRTS ((uint32_t)0x0001)
  1220. /******************* Bit definition for UART_SBCR register *******************/
  1221. #define UART_SBCR_SBCR ((uint32_t)0x0001)
  1222. /******************* Bit definition for UART_SDMAM register *******************/
  1223. #define UART_SDMAM_SDMAM ((uint32_t)0x0001)
  1224. /******************* Bit definition for UART_SFE register *******************/
  1225. #define UART_SFE_SFE ((uint32_t)0x0001)
  1226. /******************* Bit definition for UART_SRT register *******************/
  1227. #define UART_SRT_SRT ((uint32_t)0x0003)
  1228. #define UART_SRT_SRT_0 ((uint32_t)0x0001)
  1229. #define UART_SRT_SRT_1 ((uint32_t)0x0002)
  1230. /******************* Bit definition for UART_STET register *******************/
  1231. #define UART_STET_STET ((uint32_t)0x0003)
  1232. #define UART_STET_STET_0 ((uint32_t)0x0001)
  1233. #define UART_STET_STET_1 ((uint32_t)0x0002)
  1234. /******************* Bit definition for UART_HTX register *******************/
  1235. #define UART_HTX_HTX ((uint32_t)0x0001)
  1236. /******************* Bit definition for UART_DMASA register *******************/
  1237. #define UART_DMASA_DMASA ((uint32_t)0x0001)
  1238. /******************************************************************************/
  1239. /* */
  1240. /* General Purpose and Alternate Function I/O */
  1241. /* */
  1242. /******************************************************************************/
  1243. /*!<****************** Bit definition for GPIO_IODR register *******************/
  1244. #define DEEP_SLEEP_WKUP_EN_SENSOR (BIT14)
  1245. #define DEEP_SLEEP_WKUP_EN_MSR (BIT13)
  1246. #define DEEP_SLEEP_WKUP_EN_RTC (BIT12)
  1247. #define DEEP_SLEEP_WKUP_EN_KBD (BIT11)
  1248. #define DEEP_SLEEP_WKUP_EN_GPIO (BIT0)
  1249. /******************************************************************************/
  1250. /* */
  1251. /* Serial Peripheral Interface */
  1252. /* */
  1253. /******************************************************************************/
  1254. /***************** Bit definition for SPI_CTRLR0 register *******************/
  1255. #define SPI_CTRLR0_DFS ((uint32_t)0x000F)
  1256. #define SPI_CTRLR0_DFS_0 ((uint32_t)0x0001)
  1257. #define SPI_CTRLR0_DFS_1 ((uint32_t)0x0002)
  1258. #define SPI_CTRLR0_DFS_2 ((uint32_t)0x0004)
  1259. #define SPI_CTRLR0_DFS_3 ((uint32_t)0x0008)
  1260. #define SPI_CTRLR0_FRF ((uint32_t)0x0030)
  1261. #define SPI_CTRLR0_FRF_0 ((uint32_t)0x0010)
  1262. #define SPI_CTRLR0_FRF_1 ((uint32_t)0x0020)
  1263. #define SPI_CTRLR0_SCPH ((uint32_t)0x0040)
  1264. #define SPI_CTRLR0_SCPOL ((uint32_t)0x0080)
  1265. #define SPI_CTRLR0_TMOD ((uint32_t)0x0300)
  1266. #define SPI_CTRLR0_TMOD_0 ((uint32_t)0x0100)
  1267. #define SPI_CTRLR0_TMOD_1 ((uint32_t)0x0200)
  1268. #define SPI_CTRLR0_SLV_OE ((uint32_t)0x0400)
  1269. #define SPI_CTRLR0_SRL ((uint32_t)0x0800)
  1270. #define SPI_CTRLR0_CFS ((uint32_t)0xF000)
  1271. /***************** Bit definition for SPI_CTRLR1 register *******************/
  1272. #define SPI_CTRLR0_NDF ((uint32_t)0xFFFF)
  1273. /***************** Bit definition for SPI_SSIENR register *******************/
  1274. #define SPI_SSIENR_SSIENR ((uint32_t)0x0001)
  1275. /***************** Bit definition for SPI_MWCR register *********************/
  1276. #define SPI_MWCR_MWMOD ((uint32_t)0x0001)
  1277. #define SPI_MWCR_MDD ((uint32_t)0x0002)
  1278. #define SPI_MWCR_MHS ((uint32_t)0x0004)
  1279. /***************** Bit definition for SPI_SER register **********************/
  1280. #define SPI_SER_SER ((uint32_t)0x000F)
  1281. #define SPI_SER_0 ((uint32_t)0x0001)
  1282. #define SPI_SER_1 ((uint32_t)0x0002)
  1283. #define SPI_SER_2 ((uint32_t)0x0004)
  1284. #define SPI_SER_3 ((uint32_t)0x0008)
  1285. /***************** Bit definition for SPI_BAUDR register ********************/
  1286. #define SPI_BAUDR_BAUDR ((uint32_t)0xFFFF)
  1287. /***************** Bit definition for SPI_TXFTLR register *******************/
  1288. #define SPI_TXFTLR_TFT ((uint32_t)0x000F)
  1289. /***************** Bit definition for SPI_RXFTLR register *******************/
  1290. #define SPI_RXFTLR_RFT ((uint32_t)0x000F)
  1291. /***************** Bit definition for SPI_TXFLR register ********************/
  1292. #define SPI_TXFLR_TXTFL ((uint32_t)0x001F)
  1293. /***************** Bit definition for SPI_RXFLR register ********************/
  1294. #define SPI_RXFLR_RXTFL ((uint32_t)0x001F)
  1295. /***************** Bit definition for SPI_SR register ***********************/
  1296. #define SPI_SR_BUSY ((uint32_t)0x0001)
  1297. #define SPI_SR_TFNF ((uint32_t)0x0002)
  1298. #define SPI_SR_TFE ((uint32_t)0x0004)
  1299. #define SPI_SR_RFNE ((uint32_t)0x0008)
  1300. #define SPI_SR_RFF ((uint32_t)0x0010)
  1301. #define SPI_SR_TXE ((uint32_t)0x0020)
  1302. #define SPI_SR_DCOL ((uint32_t)0x0040)
  1303. /***************** Bit definition for SPI_IMR register **********************/
  1304. #define SPI_IMR_TXEIM ((uint32_t)0x0001)
  1305. #define SPI_IMR_TXOIM ((uint32_t)0x0002)
  1306. #define SPI_IMR_RXUIM ((uint32_t)0x0004)
  1307. #define SPI_IMR_RXOIM ((uint32_t)0x0008)
  1308. #define SPI_IMR_RXFIM ((uint32_t)0x0010)
  1309. #define SPI_IMR_MSTIM ((uint32_t)0x0020)
  1310. /***************** Bit definition for SPI_ISR register **********************/
  1311. #define SPI_ISR_TXEIS ((uint32_t)0x0001)
  1312. #define SPI_ISR_TXOIS ((uint32_t)0x0002)
  1313. #define SPI_ISR_RXUIS ((uint32_t)0x0004)
  1314. #define SPI_ISR_RXOIS ((uint32_t)0x0008)
  1315. #define SPI_ISR_RXFIS ((uint32_t)0x0010)
  1316. #define SPI_ISR_MSTIS ((uint32_t)0x0020)
  1317. /***************** Bit definition for SPI_RISR register *********************/
  1318. #define SPI_RISR_TXEIR ((uint32_t)0x0001)
  1319. #define SPI_RISR_TXOIR ((uint32_t)0x0002)
  1320. #define SPI_RISR_RXUIR ((uint32_t)0x0004)
  1321. #define SPI_RISR_RXOIR ((uint32_t)0x0008)
  1322. #define SPI_RISR_RXFIR ((uint32_t)0x0010)
  1323. #define SPI_RISR_MSTIR ((uint32_t)0x0020)
  1324. /***************** Bit definition for SPI_TXOICR register *******************/
  1325. #define SPI_TXOICR_TXOICR ((uint32_t)0x0001)
  1326. /***************** Bit definition for SPI_RXOICR register *******************/
  1327. #define SPI_RXOICR_RXOICR ((uint32_t)0x0001)
  1328. /***************** Bit definition for SPI_RXUICR register *******************/
  1329. #define SPI_RXUICR_RXUICR ((uint32_t)0x0001)
  1330. /***************** Bit definition for SPI_MSTICR register *******************/
  1331. #define SPI_MSTICR_MSTICR ((uint32_t)0x0001)
  1332. /***************** Bit definition for SPI_DMACR register ********************/
  1333. #define SPI_DMACR_RDMAE ((uint32_t)0x0001)
  1334. #define SPI_DMACR_TDMAE ((uint32_t)0x0002)
  1335. /***************** Bit definition for SPI_DMATDLR register ******************/
  1336. #define SPI_DMATDLR_DMATDLR ((uint32_t)0x000F)
  1337. /***************** Bit definition for SPI_DMARDLR register ******************/
  1338. #define SPI_DMATDLR_DMARDLR ((uint32_t)0x000F)
  1339. /***************** Bit definition for SPI_DMARDLR register ******************/
  1340. #define SPI_DMATDLR_DMARDLR ((uint32_t)0x000F)
  1341. /***************** Bit definition for SPI_DR register ***********************/
  1342. #define SPI_DR_DR ((uint32_t)0xFFFF)
  1343. /************** Bit definition for SPI_RX_SAMPLE_DLY register ***************/
  1344. #define SPI_RX_SAMPLE_DLY ((uint32_t)0xFFFF)
  1345. /******************************************************************************/
  1346. /* */
  1347. /* Inter-integrated Circuit Interface */
  1348. /* */
  1349. /******************************************************************************/
  1350. /******************* Bit definition for IC_CON register *********************/
  1351. #define I2C_IC_CON_MASTER_MODE ((uint32_t)0x0001)
  1352. #define I2C_IC_CON_SPEED ((uint32_t)0x0006)
  1353. #define I2C_IC_CON_SPEED_0 ((uint32_t)0x0002)
  1354. #define I2C_IC_CON_SPEED_1 ((uint32_t)0x0004)
  1355. #define I2C_IC_CON_10BITADDR_SLAVE ((uint32_t)0x0008)
  1356. #define I2C_IC_CON_10BITADDR_MASTER ((uint32_t)0x0010)
  1357. #define I2C_IC_CON_RESTART_EN ((uint32_t)0x0020)
  1358. #define I2C_IC_CON_SLAVE_DISABLE ((uint32_t)0x0040)
  1359. /******************* Bit definition for IC_TAR register *********************/
  1360. #define I2C_IC_TAR_TAR ((uint32_t)0x03FF)
  1361. #define I2C_IC_TAR_GC_OR_START ((uint32_t)0x0400)
  1362. #define I2C_IC_TAR_SPECIAL ((uint32_t)0x0800)
  1363. #define I2C_IC_TAR_10BITADDR_MASTER ((uint32_t)0x1000)
  1364. /******************* Bit definition for IC_SAR register *********************/
  1365. #define I2C_IC_SAR_SAR ((uint32_t)0x03FF)
  1366. /******************* Bit definition for IC_HS_MADDR register ****************/
  1367. #define I2C_IC_HS_MADDR_MAR ((uint32_t)0x0007)
  1368. #define I2C_IC_HS_MADDR_MAR_0 ((uint32_t)0x0001)
  1369. #define I2C_IC_HS_MADDR_MAR_1 ((uint32_t)0x0002)
  1370. #define I2C_IC_HS_MADDR_MAR_2 ((uint32_t)0x0004)
  1371. /******************* Bit definition for IC_DATA_CMD register ****************/
  1372. #define I2C_IC_DATA_CMD_DAT ((uint32_t)0x00FF)
  1373. #define I2C_IC_DATA_CMD_CMD ((uint32_t)0x0100)
  1374. #define I2C_IC_DATA_CMD_STOP ((uint32_t)0x0200)
  1375. #define I2C_IC_DATA_CMD_RESTART ((uint32_t)0x0400)
  1376. /******************* Bit definition for IC_SS_SCL_HCNT register *************/
  1377. #define I2C_IC_SS_SCL_HCNT_HCNT ((uint32_t)0xFFFF)
  1378. /******************* Bit definition for IC_SS_SCL_LCNT register *************/
  1379. #define I2C_IC_SS_SCL_LCNT_LCNT ((uint32_t)0xFFFF)
  1380. /******************* Bit definition for IC_FS_SCL_HCNT register *************/
  1381. #define I2C_IC_FS_SCL_HCNT_HCNT ((uint32_t)0xFFFF)
  1382. /******************* Bit definition for IC_FS_SCL_LCNT register *************/
  1383. #define I2C_IC_FS_SCL_LCNT_LCNT ((uint32_t)0xFFFF)
  1384. /******************* Bit definition for IC_HS_SCL_HCNT register *************/
  1385. #define I2C_IC_HS_SCL_HCNT_HCNT ((uint32_t)0xFFFF)
  1386. /******************* Bit definition for IC_HS_SCL_LCNT register *************/
  1387. #define I2C_IC_HS_SCL_LCNT_LCNT ((uint32_t)0xFFFF)
  1388. /******************* Bit definition for IC_INTR_STAT register ***************/
  1389. #define I2C_IC_INTR_STAT_R_RX_UNDER ((uint32_t)0x0001)
  1390. #define I2C_IC_INTR_STAT_R_RX_OVER ((uint32_t)0x0002)
  1391. #define I2C_IC_INTR_STAT_R_RX_FULL ((uint32_t)0x0004)
  1392. #define I2C_IC_INTR_STAT_R_TX_OVER ((uint32_t)0x0008)
  1393. #define I2C_IC_INTR_STAT_R_TX_EMPTY ((uint32_t)0x0010)
  1394. #define I2C_IC_INTR_STAT_R_RD_REQ ((uint32_t)0x0020)
  1395. #define I2C_IC_INTR_STAT_R_TX_ABRT ((uint32_t)0x0040)
  1396. #define I2C_IC_INTR_STAT_R_RX_DONE ((uint32_t)0x0080)
  1397. #define I2C_IC_INTR_STAT_R_ACTIVITY ((uint32_t)0x0100)
  1398. #define I2C_IC_INTR_STAT_R_STOP_DET ((uint32_t)0x0200)
  1399. #define I2C_IC_INTR_STAT_R_START_DET ((uint32_t)0x0400)
  1400. #define I2C_IC_INTR_STAT_R_GEN_CALL ((uint32_t)0x0800)
  1401. /******************* Bit definition for IC_INTR_MASK register ***************/
  1402. #define I2C_IC_INTR_MASK_M_RX_UNDER ((uint32_t)0x0001)
  1403. #define I2C_IC_INTR_MASK_M_RX_OVER ((uint32_t)0x0002)
  1404. #define I2C_IC_INTR_MASK_M_RX_FULL ((uint32_t)0x0004)
  1405. #define I2C_IC_INTR_MASK_M_TX_OVER ((uint32_t)0x0008)
  1406. #define I2C_IC_INTR_MASK_M_TX_EMPTY ((uint32_t)0x0010)
  1407. #define I2C_IC_INTR_MASK_M_RD_REQ ((uint32_t)0x0020)
  1408. #define I2C_IC_INTR_MASK_M_TX_ABRT ((uint32_t)0x0040)
  1409. #define I2C_IC_INTR_MASK_M_RX_DONE ((uint32_t)0x0080)
  1410. #define I2C_IC_INTR_MASK_M_ACTIVITY ((uint32_t)0x0100)
  1411. #define I2C_IC_INTR_MASK_M_STOP_DET ((uint32_t)0x0200)
  1412. #define I2C_IC_INTR_MASK_M_START_DET ((uint32_t)0x0400)
  1413. #define I2C_IC_INTR_MASK_M_GEN_CALL ((uint32_t)0x0800)
  1414. /******************* Bit definition for IC_RAW_INTR_STAT register ***********/
  1415. #define I2C_IC_RAW_INTR_STAT_RX_UNDER ((uint32_t)0x0001)
  1416. #define I2C_IC_RAW_INTR_STAT_RX_OVER ((uint32_t)0x0002)
  1417. #define I2C_IC_RAW_INTR_STAT_RX_FULL ((uint32_t)0x0004)
  1418. #define I2C_IC_RAW_INTR_STAT_TX_OVER ((uint32_t)0x0008)
  1419. #define I2C_IC_RAW_INTR_STAT_TX_EMPTY ((uint32_t)0x0010)
  1420. #define I2C_IC_RAW_INTR_STAT_RD_REQ ((uint32_t)0x0020)
  1421. #define I2C_IC_RAW_INTR_STAT_TX_ABRT ((uint32_t)0x0040)
  1422. #define I2C_IC_RAW_INTR_STAT_RX_DONE ((uint32_t)0x0080)
  1423. #define I2C_IC_RAW_INTR_STAT_ACTIVITY ((uint32_t)0x0100)
  1424. #define I2C_IC_RAW_INTR_STAT_STOP_DET ((uint32_t)0x0200)
  1425. #define I2C_IC_RAW_INTR_STAT_START_DET ((uint32_t)0x0400)
  1426. #define I2C_IC_RAW_INTR_STAT_GEN_CALL ((uint32_t)0x0800)
  1427. /******************* Bit definition for IC_RX_TL register *******************/
  1428. #define I2C_IC_RX_TL_TL ((uint32_t)0x00FF)
  1429. /******************* Bit definition for IC_TX_TL register *******************/
  1430. #define I2C_IC_TX_TL_TL ((uint32_t)0x00FF)
  1431. /******************* Bit definition for IC_CLR_INTR register ****************/
  1432. #define I2C_IC_CLR_INTR ((uint32_t)0x0001)
  1433. /******************* Bit definition for IC_CLR_RX_UNDER register ************/
  1434. #define I2C_IC_CLR_RX_UNDER ((uint32_t)0x0001)
  1435. /******************* Bit definition for IC_CLR_RX_OVER register *************/
  1436. #define I2C_IC_CLR_RX_OVER ((uint32_t)0x0001)
  1437. /******************* Bit definition for IC_CLR_TX_OVER register *************/
  1438. #define I2C_IC_CLR_TX_OVER ((uint32_t)0x0001)
  1439. /******************* Bit definition for IC_CLR_RD_REQ register **************/
  1440. #define I2C_IC_CLR_RD_REQ ((uint32_t)0x0001)
  1441. /******************* Bit definition for IC_CLR_TX_ABRT register *************/
  1442. #define I2C_IC_CLR_TX_ABRT ((uint32_t)0x0001)
  1443. /******************* Bit definition for IC_CLR_RX_DONE register *************/
  1444. #define I2C_IC_CLR_RX_DONE ((uint32_t)0x0001)
  1445. /******************* Bit definition for IC_CLR_ACTIVITY register ************/
  1446. #define I2C_IC_CLR_ACTIVITY ((uint32_t)0x0001)
  1447. /******************* Bit definition for IC_CLR_STOP_DET register ************/
  1448. #define I2C_IC_CLR_STOP_DET ((uint32_t)0x0001)
  1449. /******************* Bit definition for IC_CLR_START_DET register ***********/
  1450. #define I2C_IC_CLR_START_DET ((uint32_t)0x0001)
  1451. /******************* Bit definition for IC_CLR_GEN_CALL register ************/
  1452. #define I2C_IC_CLR_GEN_CALL ((uint32_t)0x0001)
  1453. /******************* Bit definition for IC_ENABLE register *****************/
  1454. #define I2C_IC_ENABLE_ENABLE ((uint32_t)0x0001)
  1455. #define I2C_IC_ENABLE_ABORT ((uint32_t)0x0002)
  1456. /******************* Bit definition for IC_STATUS register *****************/
  1457. #define I2C_IC_STATUS_ACTIVITY ((uint32_t)0x0001)
  1458. #define I2C_IC_STATUS_TFNF ((uint32_t)0x0002)
  1459. #define I2C_IC_STATUS_TFE ((uint32_t)0x0004)
  1460. #define I2C_IC_STATUS_RFNE ((uint32_t)0x0008)
  1461. #define I2C_IC_STATUS_RFF ((uint32_t)0x0010)
  1462. #define I2C_IC_STATUS_MST_ACTIVITY ((uint32_t)0x0020)
  1463. #define I2C_IC_STATUS_SLV_ACTIVITY ((uint32_t)0x0040)
  1464. /******************* Bit definition for IC_TXFLR register ******************/
  1465. #define I2C_IC_TXFLR_TXFLR (8)
  1466. /******************* Bit definition for IC_RXFLR register ******************/
  1467. #define I2C_IC_RXFLR_RXFLR (8)
  1468. /******************* Bit definition for IC_SDA_HOLD register ***************/
  1469. #define I2C_IC_SDA_HOLD ((uint32_t)0xFFFF)
  1470. /******************* Bit definition for IC_TX_ABRT_SOURCE register *********/
  1471. #define I2C_IC_TX_ABRT_SOURCE_7B_ADDR_NOACK ((uint32_t)0x00000001)
  1472. #define I2C_IC_TX_ABRT_SOURCE_10ADDR1_NOACK ((uint32_t)0x00000002)
  1473. #define I2C_IC_TX_ABRT_SOURCE_10ADDR2_NOACK ((uint32_t)0x00000004)
  1474. #define I2C_IC_TX_ABRT_SOURCE_TXDATA_NOACK ((uint32_t)0x00000008)
  1475. #define I2C_IC_TX_ABRT_SOURCE_GCALL_NOACK ((uint32_t)0x00000010)
  1476. #define I2C_IC_TX_ABRT_SOURCE_GCALL_READ ((uint32_t)0x00000020)
  1477. #define I2C_IC_TX_ABRT_SOURCE_HS_ACKDET ((uint32_t)0x00000040)
  1478. #define I2C_IC_TX_ABRT_SOURCE_SBYTE_ACKDET ((uint32_t)0x00000080)
  1479. #define I2C_IC_TX_ABRT_SOURCE_HS_NORSTRT ((uint32_t)0x00000100)
  1480. #define I2C_IC_TX_ABRT_SOURCE_SBYTE_NORSTRT ((uint32_t)0x00000200)
  1481. #define I2C_IC_TX_ABRT_SOURCE_10B_RD_NORSTRT ((uint32_t)0x00000400)
  1482. #define I2C_IC_TX_ABRT_SOURCE_MASTER_DIS ((uint32_t)0x00000800)
  1483. #define I2C_IC_TX_ABRT_SOURCE_LOST ((uint32_t)0x00001000)
  1484. #define I2C_IC_TX_ABRT_SOURCE_SLVFLUSH_TXFIFO ((uint32_t)0x00002000)
  1485. #define I2C_IC_TX_ABRT_SOURCE_SLV_ARBLOST ((uint32_t)0x00004000)
  1486. #define I2C_IC_TX_ABRT_SOURCE_SLVRD_INTX ((uint32_t)0x00008000)
  1487. #define I2C_IC_TX_ABRT_SOURCE_USER_ABRT ((uint32_t)0x00010000)
  1488. #define I2C_IC_TX_ABRT_SOURCE_TX_FLUSH_CNT ((uint32_t)0xFF000000)
  1489. /******************* Bit definition for IC_SLV_DATA_NACK_ONLY register *****/
  1490. #define I2C_IC_SLV_DATA_NACK_ONLY ((uint32_t)0x0001)
  1491. /******************* Bit definition for IC_DMA_TDLR register ***************/
  1492. #define I2C_IC_DMA_TDLR_TDLR ((uint32_t)0x000F)
  1493. /******************* Bit definition for IC_DMA_RDLR register ***************/
  1494. #define I2C_IC_DMA_TDLR_TDLR ((uint32_t)0x000F)
  1495. /******************* Bit definition for IC_SDA_SETUP register **************/
  1496. #define I2C_IC_SDA_SETUP ((uint32_t)0x00FF)
  1497. /******************* Bit definition for IC_ACK_GENERAL_CALL register *******/
  1498. #define I2C_IC_ACK_GENERAL_CALL ((uint32_t)0x0001)
  1499. /******************* Bit definition for IC_ENABLE_STATUS register **********/
  1500. #define I2C_IC_ENABLE_STATUS_IC_EN ((uint32_t)0x0001)
  1501. #define I2C_IC_ENABLE_STATUS_SLV_RX_ABORTED ((uint32_t)0x0001)
  1502. #define I2C_IC_ENABLE_STATUS_SLV_FIFO_FILLED_AND_FLUSHED ((uint32_t)0x0001)
  1503. /******************* Bit definition for IC_FS_SPKLEN register **************/
  1504. #define I2C_IC_FS_SPKLEN_SPKLEN ((uint32_t)0x00FF)
  1505. /******************* Bit definition for IC_HS_SPKLEN register **************/
  1506. #define I2C_IC_HS_SPKLEN_SPKLEN ((uint32_t)0x00FF)
  1507. /******************* Bit definition for IC_COMP_PARAM_1 register ***********/
  1508. #define I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH ((uint32_t)0x0003)
  1509. #define I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH_0 ((uint32_t)0x0001)
  1510. #define I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH_1 ((uint32_t)0x0002)
  1511. #define I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE ((uint32_t)0x000C)
  1512. #define I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE_0 ((uint32_t)0x0004)
  1513. #define I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE_1 ((uint32_t)0x0008)
  1514. #define I2C_IC_COMP_PARAM_1_HC_COUNT_VALUES ((uint32_t)0x0010)
  1515. #define I2C_IC_COMP_PARAM_1_INTR_IO ((uint32_t)0x0020)
  1516. #define I2C_IC_COMP_PARAM_1_HAS_DMA ((uint32_t)0x0040)
  1517. #define I2C_IC_COMP_PARAM_1_ADD_ENCODED_PARAMS ((uint32_t)0x0080)
  1518. #define I2C_IC_COMP_PARAM_1_RX_BUFFER_DEPTH ((uint32_t)0x0000FF00)
  1519. #define I2C_IC_COMP_PARAM_1_TX_BUFFER_DEPTH ((uint32_t)0x00FF0000)
  1520. /******************* Bit definition for IC_COMP_VERSION register ***********/
  1521. #define I2C_IC_COMP_VERSION ((uint32_t)0xFFFFFFFF)
  1522. /******************* Bit definition for IC_COMP_TYPE register **************/
  1523. #define I2C_IC_COMP_TYPE ((uint32_t)0xFFFFFFFF)
  1524. /******************************************************************************/
  1525. /* */
  1526. /* Backup Register Unit Block */
  1527. /* */
  1528. /******************************************************************************/
  1529. /******************* Bit definition for BPK_RDY register ********************/
  1530. #define BPK_RDY_POR ((uint32_t)0x0002)
  1531. #define BPK_RDY_READY ((uint32_t)0x0001)
  1532. /******************* Bit definition for BPK_RR register *********************/
  1533. #define BPK_RR_RESET ((uint32_t)0x0001)
  1534. /******************* Bit definition for BPK_LR register *********************/
  1535. #define BPK_LR_LOCK_SELF ((uint32_t)0x0001)
  1536. #define BPK_LR_LOCK_RESET ((uint32_t)0x0002)
  1537. #define BPK_LR_LOCK_KEYWRITE ((uint32_t)0x0004)
  1538. #define BPK_LR_LOCK_KEYREAD ((uint32_t)0x0008)
  1539. #define BPK_LR_LOCK_KEYCLEAR ((uint32_t)0x0010)
  1540. #define BPK_LR_LOCK_SCRAMBER ((uint32_t)0x0020)
  1541. #define BPK_LR_LOCK_ALL ((uint32_t)0x003F)
  1542. /******************************************************************************/
  1543. /* */
  1544. /* RTC Unit Block */
  1545. /* */
  1546. /******************************************************************************/
  1547. /******************* Bit definition for RTC_CS register *********************/
  1548. #define RTC_CS_ALARM_IT ((uint32_t)0x01)
  1549. #define RTC_CS_LOCK_TIM ((uint32_t)0x02)
  1550. #define RTC_CS_ALARM_EN ((uint32_t)0x04)
  1551. #define RTC_CS_READY ((uint32_t)0x08)
  1552. #define RTC_CS_CLR ((uint32_t)0x10)
  1553. /******************************************************************************/
  1554. /* */
  1555. /* Keyboard Control Unit Block */
  1556. /* */
  1557. /******************************************************************************/
  1558. /***************** Bit definition for KCU_CTRL0 register ********************/
  1559. #define KCU_PORT_0 ((uint32_t)0x0001)
  1560. #define KCU_PORT_1 ((uint32_t)0x0002)
  1561. #define KCU_PORT_2 ((uint32_t)0x0004)
  1562. #define KCU_PORT_3 ((uint32_t)0x0008)
  1563. #define KCU_PORT_4 ((uint32_t)0x0010)
  1564. #define KCU_PORT_5 ((uint32_t)0x0020)
  1565. #define KCU_PORT_6 ((uint32_t)0x0040)
  1566. #define KCU_PORT_7 ((uint32_t)0x0080)
  1567. #define KCU_PORT_8 ((uint32_t)0x0100)
  1568. #define KCU_PORT_ALL_Mask ((uint32_t)0x001F)
  1569. #define KCU_DEBOUNCETIMELEVEL_0 ((uint32_t)0x0000)
  1570. #define KCU_DEBOUNCETIMELEVEL_1 ((uint32_t)0x0001)
  1571. #define KCU_DEBOUNCETIMELEVEL_2 ((uint32_t)0x0002)
  1572. #define KCU_DEBOUNCETIMELEVEL_3 ((uint32_t)0x0003)
  1573. #define KCU_DEBOUNCETIMELEVEL_4 ((uint32_t)0x0004)
  1574. #define KCU_DEBOUNCETIMELEVEL_5 ((uint32_t)0x0005)
  1575. #define KCU_DEBOUNCETIMELEVEL_6 ((uint32_t)0x0006)
  1576. #define KCU_DEBOUNCETIMELEVEL_7 ((uint32_t)0x0007)
  1577. #define KCU_DEBOUNCETIMELEVEL_POS (9)
  1578. /***************** Bit definition for KCU_CTRL1 register ********************/
  1579. #define KCU_CTRL1_KBD_EN ((uint32_t)0x0001)
  1580. #define KCU_CTRL1_PUSH_IT ((uint32_t)0x0002)
  1581. #define KCU_CTRL1_RELEASE_IT ((uint32_t)0x0004)
  1582. #define KCU_CTRL1_OVERRUN_IT ((uint32_t)0x0008)
  1583. #define KCU_CTRL1_KCU_RUNING ((uint32_t)0x80000000)
  1584. /***************** Bit definition for KCU_STATUS register *******************/
  1585. #define KCU_STATUS_IT ((uint32_t)0x0001)
  1586. #define KCU_STATUS_OVERRUN_IT ((uint32_t)0x0002)
  1587. #define KCU_STATUS_PUSH_IT ((uint32_t)0x0004)
  1588. #define KCU_STATUS_RELEASE_IT ((uint32_t)0x0008)
  1589. #define KCU_STATUS_EVENT_0_PUSH ((uint32_t)0x0010)
  1590. #define KCU_STATUS_EVENT_0_NEW ((uint32_t)0x0020)
  1591. #define KCU_STATUS_EVENT_1_PUSH ((uint32_t)0x0040)
  1592. #define KCU_STATUS_EVENT_1_NEW ((uint32_t)0x0080)
  1593. #define KCU_STATUS_EVENT_2_PUSH ((uint32_t)0x0100)
  1594. #define KCU_STATUS_EVENT_2_NEW ((uint32_t)0x0200)
  1595. #define KCU_STATUS_EVENT_3_PUSH ((uint32_t)0x0400)
  1596. #define KCU_STATUS_EVENT_3_NEW ((uint32_t)0x0800)
  1597. /***************** Bit definition for KCU_EVENT register ********************/
  1598. #define KCU_EVENT_EVENT_0_INPUT_NUM ((uint32_t)0x0000000F)
  1599. #define KCU_EVENT_EVENT_0_OUTPUT_NUM ((uint32_t)0x000000F0)
  1600. #define KCU_EVENT_EVENT_1_INPUT_NUM ((uint32_t)0x00000F00)
  1601. #define KCU_EVENT_EVENT_1_OUTPUT_NUM ((uint32_t)0x0000F000)
  1602. #define KCU_EVENT_EVENT_2_INPUT_NUM ((uint32_t)0x000F0000)
  1603. #define KCU_EVENT_EVENT_2_OUTPUT_NUM ((uint32_t)0x00F00000)
  1604. #define KCU_EVENT_EVENT_3_INPUT_NUM ((uint32_t)0x0F000000)
  1605. #define KCU_EVENT_EVENT_3_OUTPUT_NUM ((uint32_t)0xF0000000)
  1606. /******************************************************************************/
  1607. /* */
  1608. /* Timer Control Unit Block */
  1609. /* */
  1610. /******************************************************************************/
  1611. /********** Bit definition for TIMER_CONTROL_REG register *******************/
  1612. #define TIMER_CONTROL_REG_TIMER_ENABLE (0x0001U)
  1613. #define TIMER_CONTROL_REG_TIMER_MODE (0x0002U)
  1614. #define TIMER_CONTROL_REG_TIMER_INTERRUPT (0x0004U)
  1615. #define TIMER_CONTROL_REG_TIMER_PWM (0x0008U)
  1616. #define TIMER_CONTROL_REG_PWM_SINGLE_PULSE (0x0010U)
  1617. #define TIMER_CONTROL_REG_PWM_RELOAD_SINGLE_PULSE (0x0020U)
  1618. /***************** Bit definition for IntStatus register ********************/
  1619. #define TIMER_INT_STATUS_INTERRUPT (0x0001U)
  1620. /******************************************************************************/
  1621. /* */
  1622. /* WDT Control Unit Block */
  1623. /* */
  1624. /******************************************************************************/
  1625. /***************** Bit definition for WDT_CR register ***********************/
  1626. #define WDT_CR_WDT_EN ((uint32_t)0x0001)
  1627. #define WDT_CR_RMOD ((uint32_t)0x0002)
  1628. /***************** Bit definition for WDT_CCVR register *********************/
  1629. #define WDT_CCVR_CCVR ((uint32_t)0xFFFFFFFF)
  1630. /***************** Bit definition for WDT_CRR register **********************/
  1631. #define WDT_CRR_CRR ((uint32_t)0x00FF)
  1632. /***************** Bit definition for WDT_STAT register *********************/
  1633. #define WDT_STAT_INT ((uint32_t)0x0001)
  1634. /***************** Bit definition for WDT_EOI register **********************/
  1635. #define WDT_EOI_EOI ((uint32_t)0x0001)
  1636. /***************** Bit definition for WDT_RLD register **********************/
  1637. #define WDT_RLD_RLD ((uint32_t)0xFFFFFFFF)
  1638. /******************************************************************************/
  1639. /* */
  1640. /* RNG Control Unit Block */
  1641. /* */
  1642. /******************************************************************************/
  1643. /************ bit definition for TRNG RNG_INDEX REGISTER ************/
  1644. #define RNG_FIFO_INDEX_Mask BIT(31)
  1645. /************ bit definition for TRNG RNG_CSR REGISTER ************/
  1646. #define TRNG_RNG_CSR_INTP_EN_Mask ((uint32_t)0x0010)
  1647. #define TRNG_RNG_CSR_ATTACK_TRNG0_Mask ((uint32_t)0x0004)
  1648. #define TRNG_RNG_CSR_S128_TRNG0_Mask ((uint32_t)0x0001)
  1649. /************ bit definition for TRNG RNG_AMA REGISTER ************/
  1650. #define TRNG_RNG_AMA_ANA_OUT_TRNG0_Mask ((uint32_t)0x10000000)
  1651. #define TRNG_RNG_AMA_PD_TRNG0_Mask ((uint32_t)0x00001000)
  1652. #define TRNG_RNG_AMA_PD_TRNG1_Mask ((uint32_t)0x00002000)
  1653. #define TRNG_RNG_AMA_PD_TRNG2_Mask ((uint32_t)0x00004000)
  1654. #define TRNG_RNG_AMA_PD_TRNG3_Mask ((uint32_t)0x00008000)
  1655. #define TRNG_RNG_AMA_PD_ALL_Mask ((uint32_t)0x0000F000)
  1656. /******************************************************************************/
  1657. /* */
  1658. /* DCMI */
  1659. /* */
  1660. /******************************************************************************/
  1661. /************** Bit definition for DCMI SYSCTRL DBG_CR register *************/
  1662. #define DCMI_DBG_CR_INPUTSEL ((uint32_t)0x00002000)
  1663. /******************** Bits definition for DCMI_CR register ******************/
  1664. #define DCMI_CR_CAPTURE ((uint32_t)0x00000001)
  1665. #define DCMI_CR_CM ((uint32_t)0x00000002)
  1666. #define DCMI_CR_CROP ((uint32_t)0x00000004)
  1667. #define DCMI_CR_JPEG ((uint32_t)0x00000008)
  1668. #define DCMI_CR_ESS ((uint32_t)0x00000010)
  1669. #define DCMI_CR_PCKPOL ((uint32_t)0x00000020)
  1670. #define DCMI_CR_HSPOL ((uint32_t)0x00000040)
  1671. #define DCMI_CR_VSPOL ((uint32_t)0x00000080)
  1672. #define DCMI_CR_FCRC_0 ((uint32_t)0x00000100)
  1673. #define DCMI_CR_FCRC_1 ((uint32_t)0x00000200)
  1674. #define DCMI_CR_EDM_0 ((uint32_t)0x00000400)
  1675. #define DCMI_CR_EDM_1 ((uint32_t)0x00000800)
  1676. #define DCMI_CR_CRE ((uint32_t)0x00001000)
  1677. #define DCMI_CR_ENABLE ((uint32_t)0x00004000)
  1678. #define DCMI_CR_BSM_0 ((uint32_t)0x00010000)
  1679. #define DCMI_CR_BSM_1 ((uint32_t)0x00020000)
  1680. #define DCMI_CR_OEBS ((uint32_t)0x00040000)
  1681. #define DCMI_CR_LSM ((uint32_t)0x00080000)
  1682. #define DCMI_CR_OELS ((uint32_t)0x00100000)
  1683. #define DCMI_CR_DMAS ((uint32_t)0xE0000000)
  1684. /******************** Bits definition for DCMI_SR register ******************/
  1685. #define DCMI_SR_HSYNC ((uint32_t)0x00000001)
  1686. #define DCMI_SR_VSYNC ((uint32_t)0x00000002)
  1687. #define DCMI_SR_FNE ((uint32_t)0x00000004)
  1688. /******************** Bits definition for DCMI_RISR register ****************/
  1689. #define DCMI_RISR_FRAME_RIS ((uint32_t)0x00000001)
  1690. #define DCMI_RISR_OVF_RIS ((uint32_t)0x00000002)
  1691. #define DCMI_RISR_ERR_RIS ((uint32_t)0x00000004)
  1692. #define DCMI_RISR_VSYNC_RIS ((uint32_t)0x00000008)
  1693. #define DCMI_RISR_LINE_RIS ((uint32_t)0x00000010)
  1694. /******************** Bits definition for DCMI_IER register *****************/
  1695. #define DCMI_IER_FRAME_IE ((uint32_t)0x00000001)
  1696. #define DCMI_IER_OVF_IE ((uint32_t)0x00000002)
  1697. #define DCMI_IER_ERR_IE ((uint32_t)0x00000004)
  1698. #define DCMI_IER_VSYNC_IE ((uint32_t)0x00000008)
  1699. #define DCMI_IER_LINE_IE ((uint32_t)0x00000010)
  1700. /******************** Bits definition for DCMI_MISR register ****************/
  1701. #define DCMI_MISR_FRAME_MIS ((uint32_t)0x00000001)
  1702. #define DCMI_MISR_OVF_MIS ((uint32_t)0x00000002)
  1703. #define DCMI_MISR_ERR_MIS ((uint32_t)0x00000004)
  1704. #define DCMI_MISR_VSYNC_MIS ((uint32_t)0x00000008)
  1705. #define DCMI_MISR_LINE_MIS ((uint32_t)0x00000010)
  1706. /******************** Bits definition for DCMI_ICR register *****************/
  1707. #define DCMI_ICR_FRAME_ISC ((uint32_t)0x00000001)
  1708. #define DCMI_ICR_OVF_ISC ((uint32_t)0x00000002)
  1709. #define DCMI_ICR_ERR_ISC ((uint32_t)0x00000004)
  1710. #define DCMI_ICR_VSYNC_ISC ((uint32_t)0x00000008)
  1711. #define DCMI_ICR_LINE_ISC ((uint32_t)0x00000010)
  1712. /****************** Bit definition for QUADSPI_FCU_CMD register ******************/
  1713. #define QUADSPI_FCU_CMD_CODE ((uint32_t)0xFF000000U)
  1714. #define QUADSPI_FCU_CMD_BUS_MODE ((uint32_t)0x00000300U)
  1715. #define QUADSPI_FCU_CMD_CMD_FORMAT ((uint32_t)0x000000F0U)
  1716. #define QUADSPI_FCU_CMD_DONE ((uint32_t)0x00000008U)
  1717. #define QUADSPI_FCU_CMD_BUSY ((uint32_t)0x00000004U)
  1718. #define QUADSPI_FCU_CMD_ACCESS_ACK ((uint32_t)0x00000002U)
  1719. #define QUADSPI_FCU_CMD_ACCESS_REQ ((uint32_t)0x00000001U)
  1720. #define QUADSPI_ADDRESS_ADR ((uint32_t)0xFFFFFF00U)
  1721. #define QUADSPI_ADDRESS_M8 ((uint32_t)0x000000FFU)
  1722. #define QUADSPI_BYTE_NUM_WR_BYTE ((uint32_t)0x00001FFFU)
  1723. #define QUADSPI_BYTE_NUM_RD_BYTE ((uint32_t)0x1FFF0000U)
  1724. #define QUADSPI_WR_FIFO_WR_DATA ((uint32_t)0xFFFFFFFFU)
  1725. #define QUADSPI_RD_FIFO_RD_DATA ((uint32_t)0xFFFFFFFFU)
  1726. #define QUADSPI_DEVICE_PARA_SAMPLE_DLY ((uint32_t)0x00008000U)
  1727. #define QUADSPI_DEVICE_PARA_SAMPLE_PHA ((uint32_t)0x00004000U)
  1728. #define QUADSPI_DEVICE_PARA_PROTOCOL ((uint32_t)0x00000300U)
  1729. #define QUADSPI_DEVICE_PARA_DUMMY_CYCLE ((uint32_t)0x000000F0U)
  1730. #define QUADSPI_DEVICE_PARA_FLASH_READY ((uint32_t)0x00000008U)
  1731. #define QUADSPI_DEVICE_PARA_FREQ_SEL ((uint32_t)0x00000003U)
  1732. #define QUADSPI_REG_WDATA ((uint32_t)0xFFFFFFFFU)
  1733. #define QUADSPI_REG_RDATA ((uint32_t)0xFFFFFFFFU)
  1734. #define QUADSPI_INT_MASK_TFDM ((uint32_t)0x00000040U)
  1735. #define QUADSPI_INT_MASK_RFDM ((uint32_t)0x00000020U)
  1736. #define QUADSPI_INT_MASK_TFOM ((uint32_t)0x00000010U)
  1737. #define QUADSPI_INT_MASK_TFUM ((uint32_t)0x00000008U)
  1738. #define QUADSPI_INT_MASK_RFOM ((uint32_t)0x00000004U)
  1739. #define QUADSPI_INT_MASK_RFUM ((uint32_t)0x00000002U)
  1740. #define QUADSPI_INT_MASK_DONE_IM ((uint32_t)0x00000001U)
  1741. #define QUADSPI_INT_UMSAK_TFDU ((uint32_t)0x00000040U)
  1742. #define QUADSPI_INT_UMSAK_RFDU ((uint32_t)0x00000020U)
  1743. #define QUADSPI_INT_UMSAK_TFOU ((uint32_t)0x00000010U)
  1744. #define QUADSPI_INT_UMSAK_TFUU ((uint32_t)0x00000008U)
  1745. #define QUADSPI_INT_UMSAK_RFOU ((uint32_t)0x00000004U)
  1746. #define QUADSPI_INT_UMSAK_RFUU ((uint32_t)0x00000002U)
  1747. #define QUADSPI_INT_UMSAK_DONE_IU ((uint32_t)0x00000001U)
  1748. #define QUADSPI_INT_MASK_STATUS_TFDM ((uint32_t)0x00000040U)
  1749. #define QUADSPI_INT_MASK_STATUS_RFDM ((uint32_t)0x00000020U)
  1750. #define QUADSPI_INT_MASK_STATUS_TFOM ((uint32_t)0x00000010U)
  1751. #define QUADSPI_INT_MASK_STATUS_TFUM ((uint32_t)0x00000008U)
  1752. #define QUADSPI_INT_MASK_STATUS_RFOM ((uint32_t)0x00000004U)
  1753. #define QUADSPI_INT_MASK_STATUS_RFUM ((uint32_t)0x00000002U)
  1754. #define QUADSPI_INT_MASK_STATUS_DONE_IM ((uint32_t)0x00000001U)
  1755. #define QUADSPI_INT_STATUS_TFDS ((uint32_t)0x00000040U)
  1756. #define QUADSPI_INT_STATUS_RFDS ((uint32_t)0x00000020U)
  1757. #define QUADSPI_INT_STATUS_TFOS ((uint32_t)0x00000010U)
  1758. #define QUADSPI_INT_STATUS_TFUS ((uint32_t)0x00000008U)
  1759. #define QUADSPI_INT_STATUS_RFOS ((uint32_t)0x00000004U)
  1760. #define QUADSPI_INT_STATUS_RFUS ((uint32_t)0x00000002U)
  1761. #define QUADSPI_INT_STATUS_DONE_IS ((uint32_t)0x00000001U)
  1762. #define QUADSPI_INT_RAWSTATUS_TFDR ((uint32_t)0x00000040U)
  1763. #define QUADSPI_INT_RAWSTATUS_RFDR ((uint32_t)0x00000020U)
  1764. #define QUADSPI_INT_RAWSTATUS_TFOR ((uint32_t)0x00000010U)
  1765. #define QUADSPI_INT_RAWSTATUS_TFUR ((uint32_t)0x00000008U)
  1766. #define QUADSPI_INT_RAWSTATUS_RFOR ((uint32_t)0x00000004U)
  1767. #define QUADSPI_INT_RAWSTATUS_RFUR ((uint32_t)0x00000002U)
  1768. #define QUADSPI_INT_RAWSTATUS_DONE_IR ((uint32_t)0x00000001U)
  1769. #define QUADSPI_INT_CLEAR_CTFD ((uint32_t)0x00000040U)
  1770. #define QUADSPI_INT_CLEAR_CRFD ((uint32_t)0x00000020U)
  1771. #define QUADSPI_INT_CLEAR_CTFO ((uint32_t)0x00000010U)
  1772. #define QUADSPI_INT_CLEAR_CTFU ((uint32_t)0x00000008U)
  1773. #define QUADSPI_INT_CLEAR_CRFO ((uint32_t)0x00000004U)
  1774. #define QUADSPI_INT_CLEAR_CRFU ((uint32_t)0x00000002U)
  1775. #define QUADSPI_INT_CLEAR_DONE ((uint32_t)0x00000001U)
  1776. #define QUADSPI_CACHE_INTF_CMD_RELDS ((uint32_t)0xFF000000U)
  1777. #define QUADSPI_CACHE_INTF_CMD_DS ((uint32_t)0x00FF0000U)
  1778. #define QUADSPI_CACHE_INTF_CMD_RD_BUS_MODE ((uint32_t)0x00003000U)
  1779. #define QUADSPI_CACHE_INTF_CMD_RD_FORMAT ((uint32_t)0x00000F00U)
  1780. #define QUADSPI_CACHE_INTF_CMD_RDCMD ((uint32_t)0x000000FFU)
  1781. #define QUADSPI_DMA_CNTL_TX_EN ((uint32_t)0x00000001U)
  1782. #define QUADSPI_FIFO_CNTL_TFFH ((uint32_t)0x80000000U)
  1783. #define QUADSPI_FIFO_CNTL_TFE ((uint32_t)0x00200000U)
  1784. #define QUADSPI_FIFO_CNTL_TFFL ((uint32_t)0x00100000U)
  1785. #define QUADSPI_FIFO_CNTL_TFL ((uint32_t)0x000F0000U)
  1786. #define QUADSPI_FIFO_CNTL_RFFH ((uint32_t)0x00008000U)
  1787. #define QUADSPI_FIFO_CNTL_RFE ((uint32_t)0x00000020U)
  1788. #define QUADSPI_FIFO_CNTL_RFFL ((uint32_t)0x00000010U)
  1789. #define QUADSPI_FIFO_CNTL_RFL ((uint32_t)0x0000000FU)
  1790. #define AIR105_READ_REG8(reg) (*(__IO uint8_t *) reg)
  1791. #define AIR105_READ_REG16(reg) (*(__IO uint16_t *) reg)
  1792. #define AIR105_READ_REG32(reg) (*(__IO uint32_t *) reg)
  1793. #define AIR105_WRITE_REG8(reg, value) (*(__IO uint8_t *) reg = value)
  1794. #define AIR105_WRITE_REG16(reg, value) (*(__IO uint16_t *) reg = value)
  1795. #define AIR105_WRITE_REG32(reg, value) (*(__IO uint32_t *) reg = value)
  1796. #define AIR105_MODIFY_REG8(reg, clear_mask, set_mask) \
  1797. AIR105_WRITE_REG8(reg, (((AIR105_READ_REG8(reg)) & ~clear_mask) | set_mask))
  1798. #define AIR105_MODIFY_REG16(reg, clear_mask, set_mask) \
  1799. AIR105_WRITE_REG16(reg, (((AIR105_READ_REG16(reg)) & ~clear_mask) | set_mask))
  1800. #define AIR105_MODIFY_REG32(reg, clear_mask, set_mask) \
  1801. AIR105_WRITE_REG32(reg, (((AIR105_READ_REG32(reg)) & ~clear_mask) | set_mask))
  1802. #include "air105_conf.h"
  1803. #ifdef __cplusplus
  1804. }
  1805. #endif
  1806. #endif /* AIR105_H */