at32f423.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. /**
  2. **************************************************************************
  3. * @file at32f423.h
  4. * @brief at32f423 header file
  5. **************************************************************************
  6. * Copyright notice & Disclaimer
  7. *
  8. * The software Board Support Package (BSP) that is made available to
  9. * download from Artery official website is the copyrighted work of Artery.
  10. * Artery authorizes customers to use, copy, and distribute the BSP
  11. * software and its related documentation for the purpose of design and
  12. * development in conjunction with Artery microcontrollers. Use of the
  13. * software is governed by this copyright notice and the following disclaimer.
  14. *
  15. * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
  16. * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
  17. * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
  18. * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
  19. * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
  21. *
  22. **************************************************************************
  23. */
  24. #ifndef __AT32F423_H
  25. #define __AT32F423_H
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #if defined (__CC_ARM)
  30. #pragma anon_unions
  31. #endif
  32. /** @addtogroup CMSIS
  33. * @{
  34. */
  35. /** @addtogroup AT32F423
  36. * @{
  37. */
  38. /** @addtogroup Library_configuration_section
  39. * @{
  40. */
  41. /**
  42. * tip: to avoid modifying this file each time you need to switch between these
  43. * devices, you can define the device in your toolchain compiler preprocessor.
  44. */
  45. #if !defined (AT32F423K8U7_4) && !defined (AT32F423KBU7_4) && !defined (AT32F423KCU7_4) && \
  46. !defined (AT32F423T8U7) && !defined (AT32F423TBU7) && !defined (AT32F423TCU7) && \
  47. !defined (AT32F423C8U7) && !defined (AT32F423CBU7) && !defined (AT32F423CCU7) && \
  48. !defined (AT32F423C8T7) && !defined (AT32F423CBT7) && !defined (AT32F423CCT7) && \
  49. !defined (AT32F423R8T7_7) && !defined (AT32F423RBT7_7) && !defined (AT32F423RCT7_7) && \
  50. !defined (AT32F423R8T7) && !defined (AT32F423RBT7) && !defined (AT32F423RCT7) && \
  51. !defined (AT32F423V8T7) && !defined (AT32F423VBT7) && !defined (AT32F423VCT7)
  52. #error "Please select first the target device used in your application (in at32f423.h file)"
  53. #endif
  54. #if defined (AT32F423K8U7_4) || defined (AT32F423KBU7_4) || defined (AT32F423KCU7_4) || \
  55. defined (AT32F423T8U7) || defined (AT32F423TBU7) || defined (AT32F423TCU7) || \
  56. defined (AT32F423C8U7) || defined (AT32F423CBU7) || defined (AT32F423CCU7) || \
  57. defined (AT32F423C8T7) || defined (AT32F423CBT7) || defined (AT32F423CCT7) || \
  58. defined (AT32F423R8T7_7) || defined (AT32F423RBT7_7) || defined (AT32F423RCT7_7) || \
  59. defined (AT32F423R8T7) || defined (AT32F423RBT7) || defined (AT32F423RCT7) || \
  60. defined (AT32F423V8T7) || defined (AT32F423VBT7) || defined (AT32F423VCT7)
  61. #define AT32F423xx
  62. #endif
  63. /**
  64. * define with package
  65. */
  66. #if defined (AT32F423K8U7_4) || defined (AT32F423KBU7_4) || defined (AT32F423KCU7_4)
  67. #define AT32F423Kx
  68. #endif
  69. #if defined (AT32F423T8U7) || defined (AT32F423TBU7) || defined (AT32F423TCU7)
  70. #define AT32F423Tx
  71. #endif
  72. #if defined (AT32F423C8U7) || defined (AT32F423CBU7) || defined (AT32F423CCU7) || \
  73. defined (AT32F423C8T7) || defined (AT32F423CBT7) || defined (AT32F423CCT7)
  74. #define AT32F423Cx
  75. #endif
  76. #if defined (AT32F423R8T7_7) || defined (AT32F423RBT7_7) || defined (AT32F423RCT7_7) || \
  77. defined (AT32F423R8T7) || defined (AT32F423RBT7) || defined (AT32F423RCT7)
  78. #define AT32F423Rx
  79. #endif
  80. #if defined (AT32F423V8T7) || defined (AT32F423VBT7) || defined (AT32F423VCT7)
  81. #define AT32F423Vx
  82. #endif
  83. /**
  84. * define with memory density
  85. */
  86. #if defined (AT32F423K8U7_4) || defined (AT32F423T8U7) || defined (AT32F423C8U7) || \
  87. defined (AT32F423C8T7) || defined (AT32F423R8T7_7) || defined (AT32F423R8T7) || \
  88. defined (AT32F423V8T7)
  89. #define AT32F423x8
  90. #endif
  91. #if defined (AT32F423KBU7_4) || defined (AT32F423TBU7) || defined (AT32F423CBU7) || \
  92. defined (AT32F423CBT7) || defined (AT32F423RBT7_7) || defined (AT32F423RBT7) || \
  93. defined (AT32F423VBT7)
  94. #define AT32F423xB
  95. #endif
  96. #if defined (AT32F423KCU7_4) || defined (AT32F423TCU7) || defined (AT32F423CCU7) || \
  97. defined (AT32F423CCT7) || defined (AT32F423RCT7_7) || defined (AT32F423RCT7) || \
  98. defined (AT32F423VCT7)
  99. #define AT32F423xC
  100. #endif
  101. #ifndef USE_STDPERIPH_DRIVER
  102. /**
  103. * @brief comment the line below if you will not use the peripherals drivers.
  104. * in this case, these drivers will not be included and the application code will
  105. * be based on direct access to peripherals registers
  106. */
  107. #ifdef _RTE_
  108. #include "RTE_Components.h"
  109. #ifdef RTE_DEVICE_STDPERIPH_FRAMEWORK
  110. #define USE_STDPERIPH_DRIVER
  111. #endif
  112. #endif
  113. #endif
  114. /**
  115. * @brief at32f423 standard peripheral library version number
  116. */
  117. #define __AT32F423_LIBRARY_VERSION_MAJOR (0x02) /*!< [31:24] major version */
  118. #define __AT32F423_LIBRARY_VERSION_MIDDLE (0x00) /*!< [23:16] middle version */
  119. #define __AT32F423_LIBRARY_VERSION_MINOR (0x01) /*!< [15:8] minor version */
  120. #define __AT32F423_LIBRARY_VERSION_RC (0x00) /*!< [7:0] release candidate */
  121. #define __AT32F423_LIBRARY_VERSION ((__AT32F423_LIBRARY_VERSION_MAJOR << 24) | \
  122. (__AT32F423_LIBRARY_VERSION_MIDDLE << 16) | \
  123. (__AT32F423_LIBRARY_VERSION_MINOR << 8) | \
  124. (__AT32F423_LIBRARY_VERSION_RC))
  125. /**
  126. * @}
  127. */
  128. /** @addtogroup configuration_section_for_cmsis
  129. * @{
  130. */
  131. /**
  132. * @brief configuration of the cortex-m4 processor and core peripherals
  133. */
  134. #define __CM4_REV 0x0001U /*!< core revision r0p1 */
  135. #define __MPU_PRESENT 1 /*!< mpu present */
  136. #define __NVIC_PRIO_BITS 4 /*!< at32 uses 4 bits for the priority levels */
  137. #define __Vendor_SysTickConfig 0 /*!< set to 1 if different systick config is used */
  138. #define __FPU_PRESENT 1U /*!< fpu present */
  139. /**
  140. * @brief at32f423 interrupt number definition, according to the selected device
  141. * in @ref library_configuration_section
  142. */
  143. typedef enum IRQn
  144. {
  145. /****** cortex-m4 processor exceptions numbers ***************************************************/
  146. Reset_IRQn = -15, /*!< 1 reset vector, invoked on power up and warm reset */
  147. NonMaskableInt_IRQn = -14, /*!< 2 non maskable interrupt */
  148. HardFault_IRQn = -13, /*!< 3 hard fault, all classes of fault */
  149. MemoryManagement_IRQn = -12, /*!< 4 cortex-m4 memory management interrupt */
  150. BusFault_IRQn = -11, /*!< 5 cortex-m4 bus fault interrupt */
  151. UsageFault_IRQn = -10, /*!< 6 cortex-m4 usage fault interrupt */
  152. SVCall_IRQn = -5, /*!< 11 cortex-m4 sv call interrupt */
  153. DebugMonitor_IRQn = -4, /*!< 12 cortex-m4 debug monitor interrupt */
  154. PendSV_IRQn = -2, /*!< 14 cortex-m4 pend sv interrupt */
  155. SysTick_IRQn = -1, /*!< 15 cortex-m4 system tick interrupt */
  156. /****** at32 specific interrupt numbers *********************************************************/
  157. WWDT_IRQn = 0, /*!< window watchdog timer interrupt */
  158. PVM_IRQn = 1, /*!< pvm through exint line detection interrupt */
  159. TAMP_STAMP_IRQn = 2, /*!< tamper and timestamp interrupts through the exint line */
  160. ERTC_WKUP_IRQn = 3, /*!< ertc wakeup through the exint line */
  161. FLASH_IRQn = 4, /*!< flash global interrupt */
  162. CRM_IRQn = 5, /*!< crm global interrupt */
  163. EXINT0_IRQn = 6, /*!< exint line0 interrupt */
  164. EXINT1_IRQn = 7, /*!< exint line1 interrupt */
  165. EXINT2_IRQn = 8, /*!< exint line2 interrupt */
  166. EXINT3_IRQn = 9, /*!< exint line3 interrupt */
  167. EXINT4_IRQn = 10, /*!< exint line4 interrupt */
  168. DMA1_Channel1_IRQn = 11, /*!< dma1 channel 1 global interrupt */
  169. DMA1_Channel2_IRQn = 12, /*!< dma1 channel 2 global interrupt */
  170. DMA1_Channel3_IRQn = 13, /*!< dma1 channel 3 global interrupt */
  171. DMA1_Channel4_IRQn = 14, /*!< dma1 channel 4 global interrupt */
  172. DMA1_Channel5_IRQn = 15, /*!< dma1 channel 5 global interrupt */
  173. DMA1_Channel6_IRQn = 16, /*!< dma1 channel 6 global interrupt */
  174. DMA1_Channel7_IRQn = 17, /*!< dma1 channel 7 global interrupt */
  175. ADC1_IRQn = 18, /*!< adc1 global interrupt */
  176. CAN1_TX_IRQn = 19, /*!< can1 tx interrupts */
  177. CAN1_RX0_IRQn = 20, /*!< can1 rx0 interrupts */
  178. CAN1_RX1_IRQn = 21, /*!< can1 rx1 interrupt */
  179. CAN1_SE_IRQn = 22, /*!< can1 se interrupt */
  180. EXINT9_5_IRQn = 23, /*!< external line[9:5] interrupts */
  181. TMR1_BRK_TMR9_IRQn = 24, /*!< tmr1 brake interrupt */
  182. TMR1_OVF_TMR10_IRQn = 25, /*!< tmr1 overflow interrupt */
  183. TMR1_TRG_HALL_TMR11_IRQn = 26, /*!< tmr1 trigger and hall interrupt */
  184. TMR1_CH_IRQn = 27, /*!< tmr1 channel interrupt */
  185. TMR2_GLOBAL_IRQn = 28, /*!< tmr2 global interrupt */
  186. TMR3_GLOBAL_IRQn = 29, /*!< tmr3 global interrupt */
  187. TMR4_GLOBAL_IRQn = 30, /*!< tmr4 global interrupt */
  188. I2C1_EVT_IRQn = 31, /*!< i2c1 event interrupt */
  189. I2C1_ERR_IRQn = 32, /*!< i2c1 error interrupt */
  190. I2C2_EVT_IRQn = 33, /*!< i2c2 event interrupt */
  191. I2C2_ERR_IRQn = 34, /*!< i2c2 error interrupt */
  192. SPI1_IRQn = 35, /*!< spi1 global interrupt */
  193. SPI2_IRQn = 36, /*!< spi2 global interrupt */
  194. USART1_IRQn = 37, /*!< usart1 global interrupt */
  195. USART2_IRQn = 38, /*!< usart2 global interrupt */
  196. USART3_IRQn = 39, /*!< usart3 global interrupt */
  197. EXINT15_10_IRQn = 40, /*!< external line[15:10] interrupts */
  198. ERTCAlarm_IRQn = 41, /*!< ertc alarm through exint line interrupt */
  199. OTGFS1_WKUP_IRQn = 42, /*!< otgfs1 wakeup from suspend through exint line interrupt */
  200. TMR12_GLOBAL_IRQn = 43, /*!< tmr12 global interrupt */
  201. TMR13_GLOBAL_IRQn = 44, /*!< tmr13 global interrupt */
  202. TMR14_GLOBAL_IRQn = 45, /*!< tmr14 global interrupt */
  203. SPI3_IRQn = 51, /*!< spi3 global interrupt */
  204. USART4_IRQn = 52, /*!< usart4 global interrupt */
  205. USART5_IRQn = 53, /*!< usart5 global interrupt */
  206. TMR6_DAC_GLOBAL_IRQn = 54, /*!< tmr6 and dac global interrupt */
  207. TMR7_GLOBAL_IRQn = 55, /*!< tmr7 global interrupt */
  208. DMA2_Channel1_IRQn = 56, /*!< dma2 channel 1 global interrupt */
  209. DMA2_Channel2_IRQn = 57, /*!< dma2 channel 2 global interrupt */
  210. DMA2_Channel3_IRQn = 58, /*!< dma2 channel 3 global interrupt */
  211. DMA2_Channel4_IRQn = 59, /*!< dma2 channel 4 global interrupt */
  212. DMA2_Channel5_IRQn = 60, /*!< dma2 channel 5 global interrupt */
  213. CAN2_TX_IRQn = 63, /*!< can2 tx interrupt */
  214. CAN2_RX0_IRQn = 64, /*!< can2 rx0 interrupt */
  215. CAN2_RX1_IRQn = 65, /*!< can2 rx1 interrupt */
  216. CAN2_SE_IRQn = 66, /*!< can2 se interrupt */
  217. OTGFS1_IRQn = 67, /*!< otgfs1 interrupt */
  218. DMA2_Channel6_IRQn = 68, /*!< dma2 channel 6 global interrupt */
  219. DMA2_Channel7_IRQn = 69, /*!< dma2 channel 7 global interrupt */
  220. USART6_IRQn = 71, /*!< usart6 interrupt */
  221. I2C3_EVT_IRQn = 72, /*!< i2c3 event interrupt */
  222. I2C3_ERR_IRQn = 73, /*!< i2c3 error interrupt */
  223. FPU_IRQn = 81, /*!< fpu interrupt */
  224. USART7_IRQn = 82, /*!< usart7 interrupt */
  225. USART8_IRQn = 83, /*!< usart8 interrupt */
  226. DMAMUX_IRQn = 94, /*!< dmamux global interrupt */
  227. ACC_IRQn = 103, /*!< acc interrupt */
  228. } IRQn_Type;
  229. /**
  230. * @}
  231. */
  232. #include "core_cm4.h"
  233. #include "system_at32f423.h"
  234. #include <stdint.h>
  235. /** @addtogroup Exported_types
  236. * @{
  237. */
  238. typedef int32_t INT32;
  239. typedef int16_t INT16;
  240. typedef int8_t INT8;
  241. typedef uint32_t UINT32;
  242. typedef uint16_t UINT16;
  243. typedef uint8_t UINT8;
  244. typedef int32_t s32;
  245. typedef int16_t s16;
  246. typedef int8_t s8;
  247. typedef const int32_t sc32; /*!< read only */
  248. typedef const int16_t sc16; /*!< read only */
  249. typedef const int8_t sc8; /*!< read only */
  250. typedef __IO int32_t vs32;
  251. typedef __IO int16_t vs16;
  252. typedef __IO int8_t vs8;
  253. typedef __I int32_t vsc32; /*!< read only */
  254. typedef __I int16_t vsc16; /*!< read only */
  255. typedef __I int8_t vsc8; /*!< read only */
  256. typedef uint32_t u32;
  257. typedef uint16_t u16;
  258. typedef uint8_t u8;
  259. typedef const uint32_t uc32; /*!< read only */
  260. typedef const uint16_t uc16; /*!< read only */
  261. typedef const uint8_t uc8; /*!< read only */
  262. typedef __IO uint32_t vu32;
  263. typedef __IO uint16_t vu16;
  264. typedef __IO uint8_t vu8;
  265. typedef __I uint32_t vuc32; /*!< read only */
  266. typedef __I uint16_t vuc16; /*!< read only */
  267. typedef __I uint8_t vuc8; /*!< read only */
  268. typedef enum {RESET = 0, SET = !RESET} flag_status;
  269. typedef enum {FALSE = 0, TRUE = !FALSE} confirm_state;
  270. typedef enum {ERROR = 0, SUCCESS = !ERROR} error_status;
  271. /**
  272. * @}
  273. */
  274. /** @addtogroup Exported_macro
  275. * @{
  276. */
  277. #define REG8(addr) *(volatile uint8_t *)(addr)
  278. #define REG16(addr) *(volatile uint16_t *)(addr)
  279. #define REG32(addr) *(volatile uint32_t *)(addr)
  280. #define MAKE_VALUE(reg_offset, bit_num) (((reg_offset) << 16) | (bit_num & 0x1f))
  281. #define PERIPH_REG(periph_base, value) REG32((periph_base + (value >> 16)))
  282. #define PERIPH_REG_BIT(value) (0x1u << (value & 0x1f))
  283. /**
  284. * @}
  285. */
  286. /** @addtogroup Peripheral_memory_map
  287. * @{
  288. */
  289. #define XMC_SDRAM_MEM_BASE ((uint32_t)0xC0000000)
  290. #define QSPI2_MEM_BASE ((uint32_t)0xB0000000)
  291. #define XMC_CARD_MEM_BASE ((uint32_t)0xA8000000)
  292. #define QSPI2_REG_BASE ((uint32_t)0xA0002000)
  293. #define QSPI1_REG_BASE ((uint32_t)0xA0001000)
  294. #define XMC_REG_BASE ((uint32_t)0xA0000000)
  295. #define XMC_BANK1_REG_BASE (XMC_REG_BASE + 0x0000)
  296. #define XMC_BANK2_REG_BASE (XMC_REG_BASE + 0x0060)
  297. #define XMC_BANK3_REG_BASE (XMC_REG_BASE + 0x0080)
  298. #define XMC_BANK4_REG_BASE (XMC_REG_BASE + 0x00A0)
  299. #define XMC_SDRAM_REG_BASE (XMC_REG_BASE + 0x0140)
  300. #define QSPI1_MEM_BASE ((uint32_t)0x90000000)
  301. #define XMC_MEM_BASE ((uint32_t)0x60000000)
  302. #define PERIPH_BASE ((uint32_t)0x40000000)
  303. #define SRAM_BB_BASE ((uint32_t)0x22000000)
  304. #define PERIPH_BB_BASE ((uint32_t)0x42000000)
  305. #define SRAM_BASE ((uint32_t)0x20000000)
  306. #define USD_BASE ((uint32_t)0x1FFFF800)
  307. #define FLASH_BASE ((uint32_t)0x08000000)
  308. #define DEBUG_BASE ((uint32_t)0xE0042000)
  309. #define APB1PERIPH_BASE (PERIPH_BASE)
  310. #define APB2PERIPH_BASE (PERIPH_BASE + 0x10000)
  311. #define AHBPERIPH1_BASE (PERIPH_BASE + 0x20000)
  312. #define AHBPERIPH2_BASE (PERIPH_BASE + 0x10000000)
  313. /* apb1 bus base address */
  314. #define USART8_BASE (APB1PERIPH_BASE + 0x7C00)
  315. #define USART7_BASE (APB1PERIPH_BASE + 0x7800)
  316. #define DAC_BASE (APB1PERIPH_BASE + 0x7400)
  317. #define PWC_BASE (APB1PERIPH_BASE + 0x7000)
  318. #define CAN2_BASE (APB1PERIPH_BASE + 0x6800)
  319. #define CAN1_BASE (APB1PERIPH_BASE + 0x6400)
  320. #define I2C3_BASE (APB1PERIPH_BASE + 0x5C00)
  321. #define I2C2_BASE (APB1PERIPH_BASE + 0x5800)
  322. #define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
  323. #define USART5_BASE (APB1PERIPH_BASE + 0x5000)
  324. #define USART4_BASE (APB1PERIPH_BASE + 0x4C00)
  325. #define USART3_BASE (APB1PERIPH_BASE + 0x4800)
  326. #define USART2_BASE (APB1PERIPH_BASE + 0x4400)
  327. #define SPI3_BASE (APB1PERIPH_BASE + 0x3C00)
  328. #define SPI2_BASE (APB1PERIPH_BASE + 0x3800)
  329. #define WDT_BASE (APB1PERIPH_BASE + 0x3000)
  330. #define WWDT_BASE (APB1PERIPH_BASE + 0x2C00)
  331. #define ERTC_BASE (APB1PERIPH_BASE + 0x2800)
  332. #define TMR14_BASE (APB1PERIPH_BASE + 0x2000)
  333. #define TMR13_BASE (APB1PERIPH_BASE + 0x1C00)
  334. #define TMR12_BASE (APB1PERIPH_BASE + 0x1800)
  335. #define TMR7_BASE (APB1PERIPH_BASE + 0x1400)
  336. #define TMR6_BASE (APB1PERIPH_BASE + 0x1000)
  337. #define TMR4_BASE (APB1PERIPH_BASE + 0x0800)
  338. #define TMR3_BASE (APB1PERIPH_BASE + 0x0400)
  339. #define TMR2_BASE (APB1PERIPH_BASE + 0x0000)
  340. /* apb2 bus base address */
  341. #define ACC_BASE (APB2PERIPH_BASE + 0x7400)
  342. #define TMR11_BASE (APB2PERIPH_BASE + 0x4800)
  343. #define TMR10_BASE (APB2PERIPH_BASE + 0x4400)
  344. #define TMR9_BASE (APB2PERIPH_BASE + 0x4000)
  345. #define EXINT_BASE (APB2PERIPH_BASE + 0x3C00)
  346. #define SCFG_BASE (APB2PERIPH_BASE + 0x3800)
  347. #define SPI1_BASE (APB2PERIPH_BASE + 0x3000)
  348. #define ADC1_BASE (APB2PERIPH_BASE + 0x2000)
  349. #define ADCCOM_BASE (APB2PERIPH_BASE + 0x2300)
  350. #define USART6_BASE (APB2PERIPH_BASE + 0x1400)
  351. #define USART1_BASE (APB2PERIPH_BASE + 0x1000)
  352. #define TMR1_BASE (APB2PERIPH_BASE + 0x0000)
  353. /* ahb bus base address */
  354. #define GPIOF_BASE (AHBPERIPH1_BASE + 0x1400)
  355. #define GPIOE_BASE (AHBPERIPH1_BASE + 0x1000)
  356. #define GPIOD_BASE (AHBPERIPH1_BASE + 0x0C00)
  357. #define GPIOC_BASE (AHBPERIPH1_BASE + 0x0800)
  358. #define GPIOB_BASE (AHBPERIPH1_BASE + 0x0400)
  359. #define GPIOA_BASE (AHBPERIPH1_BASE + 0x0000)
  360. #define DMA1_BASE (AHBPERIPH1_BASE + 0x6000)
  361. #define DMA1_CHANNEL1_BASE (DMA1_BASE + 0x0008)
  362. #define DMA1_CHANNEL2_BASE (DMA1_BASE + 0x001C)
  363. #define DMA1_CHANNEL3_BASE (DMA1_BASE + 0x0030)
  364. #define DMA1_CHANNEL4_BASE (DMA1_BASE + 0x0044)
  365. #define DMA1_CHANNEL5_BASE (DMA1_BASE + 0x0058)
  366. #define DMA1_CHANNEL6_BASE (DMA1_BASE + 0x006C)
  367. #define DMA1_CHANNEL7_BASE (DMA1_BASE + 0x0080)
  368. #define DMA1MUX_BASE (DMA1_BASE + 0x0104)
  369. #define DMA1MUX_CHANNEL1_BASE (DMA1MUX_BASE)
  370. #define DMA1MUX_CHANNEL2_BASE (DMA1MUX_BASE + 0x0004)
  371. #define DMA1MUX_CHANNEL3_BASE (DMA1MUX_BASE + 0x0008)
  372. #define DMA1MUX_CHANNEL4_BASE (DMA1MUX_BASE + 0x000C)
  373. #define DMA1MUX_CHANNEL5_BASE (DMA1MUX_BASE + 0x0010)
  374. #define DMA1MUX_CHANNEL6_BASE (DMA1MUX_BASE + 0x0014)
  375. #define DMA1MUX_CHANNEL7_BASE (DMA1MUX_BASE + 0x0018)
  376. #define DMA1MUX_GENERATOR1_BASE (DMA1_BASE + 0x0120)
  377. #define DMA1MUX_GENERATOR2_BASE (DMA1_BASE + 0x0124)
  378. #define DMA1MUX_GENERATOR3_BASE (DMA1_BASE + 0x0128)
  379. #define DMA1MUX_GENERATOR4_BASE (DMA1_BASE + 0x012C)
  380. #define DMA2_BASE (AHBPERIPH1_BASE + 0x6400)
  381. #define DMA2_CHANNEL1_BASE (DMA2_BASE + 0x0008)
  382. #define DMA2_CHANNEL2_BASE (DMA2_BASE + 0x001C)
  383. #define DMA2_CHANNEL3_BASE (DMA2_BASE + 0x0030)
  384. #define DMA2_CHANNEL4_BASE (DMA2_BASE + 0x0044)
  385. #define DMA2_CHANNEL5_BASE (DMA2_BASE + 0x0058)
  386. #define DMA2_CHANNEL6_BASE (DMA2_BASE + 0x006C)
  387. #define DMA2_CHANNEL7_BASE (DMA2_BASE + 0x0080)
  388. #define DMA2MUX_BASE (DMA2_BASE + 0x0104)
  389. #define DMA2MUX_CHANNEL1_BASE (DMA2MUX_BASE)
  390. #define DMA2MUX_CHANNEL2_BASE (DMA2MUX_BASE + 0x0004)
  391. #define DMA2MUX_CHANNEL3_BASE (DMA2MUX_BASE + 0x0008)
  392. #define DMA2MUX_CHANNEL4_BASE (DMA2MUX_BASE + 0x000C)
  393. #define DMA2MUX_CHANNEL5_BASE (DMA2MUX_BASE + 0x0010)
  394. #define DMA2MUX_CHANNEL6_BASE (DMA2MUX_BASE + 0x0014)
  395. #define DMA2MUX_CHANNEL7_BASE (DMA2MUX_BASE + 0x0018)
  396. #define DMA2MUX_GENERATOR1_BASE (DMA2_BASE + 0x0120)
  397. #define DMA2MUX_GENERATOR2_BASE (DMA2_BASE + 0x0124)
  398. #define DMA2MUX_GENERATOR3_BASE (DMA2_BASE + 0x0128)
  399. #define DMA2MUX_GENERATOR4_BASE (DMA2_BASE + 0x012C)
  400. #define FLASH_REG_BASE (AHBPERIPH1_BASE + 0x3C00)
  401. #define CRM_BASE (AHBPERIPH1_BASE + 0x3800)
  402. #define CRC_BASE (AHBPERIPH1_BASE + 0x3000)
  403. #define OTGFS1_BASE (AHBPERIPH2_BASE + 0x00000)
  404. /**
  405. * @}
  406. */
  407. /**
  408. * @}
  409. */
  410. /**
  411. * @}
  412. */
  413. #include "at32f423_def.h"
  414. #include "at32f423_conf.h"
  415. #ifdef __cplusplus
  416. }
  417. #endif
  418. #endif