at91sam7se.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. #ifndef _ARCH_ARM_SAM7SE_H_
  2. #define _ARCH_ARM_SAM7SE_H_
  3. /*
  4. * Copyright (C) 2006-2008 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. */
  34. /*!
  35. * \file arch/arm/at91sam7se.h
  36. * \brief AT91 peripherals.
  37. *
  38. * \verbatim
  39. * $Id: at91sam7se.h 5459 2013-11-26 08:58:16Z haraldkipp $
  40. * \endverbatim
  41. */
  42. #define FLASH_BASE 0x100000UL
  43. #define RAM_BASE 0x200000UL
  44. #define TC_BASE 0xFFFA0000 /*!< \brief Timer/counter base address. */
  45. #define UDP_BASE 0xFFFB0000 /*!< \brief USB device port base address. */
  46. #define TWI_BASE 0xFFFB8000 /*!< \brief Two-wire interface base address. */
  47. #define USART0_BASE 0xFFFC0000 /*!< \brief USART 0 base address. */
  48. #define USART1_BASE 0xFFFC4000 /*!< \brief USART 1 base address. */
  49. #define PWMC_BASE 0xFFFCC000 /*!< \brief PWM controller base address. */
  50. #define SSC_BASE 0xFFFD4000 /*!< \brief Serial synchronous controller base address. */
  51. #define ADC_BASE 0xFFFD8000 /*!< \brief ADC base address. */
  52. #define SPI0_BASE 0xFFFE0000 /*!< \brief SPI0 base address. */
  53. #define AIC_BASE 0xFFFFF000 /*!< \brief AIC base address. */
  54. #define DBGU_BASE 0xFFFFF200 /*!< \brief DBGU base address. */
  55. #define PIOA_BASE 0xFFFFF400 /*!< \brief PIO A base address. */
  56. #define PIOB_BASE 0xFFFFF600 /*!< \brief PIO B base address. */
  57. #define PIOC_BASE 0xFFFFF800 /*!< \brief PIO C base address. */
  58. #define PMC_BASE 0xFFFFFC00 /*!< \brief PMC base address. */
  59. #define RSTC_BASE 0xFFFFFD00 /*!< \brief Resect controller register base address. */
  60. #define RTT_BASE 0xFFFFFD20 /*!< \brief Realtime timer base address. */
  61. #define PIT_BASE 0xFFFFFD30 /*!< \brief Periodic interval timer base address. */
  62. #define WDT_BASE 0xFFFFFD40 /*!< \brief Watch Dog register base address. */
  63. #define VREG_BASE 0xFFFFFD60 /*!< \brief Voltage regulator mode controller base address. */
  64. #define MC_BASE 0xFFFFFF00 /*!< \brief Memory controller base address. */
  65. #define EFC0_BASE 0xFFFFFF60 /*!< \brief EFC0 base address. */
  66. #define EFC1_BASE 0xFFFFFF70 /*!< \brief EFC1 base address. */
  67. #define EBI_BASE 0xFFFFFF80 /*!< \brief External bus interface base address. */
  68. #define SMC_BASE 0xFFFFFF90 /*!< \brief SMC base address. */
  69. #define SDRAMC_BASE 0xFFFFFFB0 /*!< \brief SDRAMC base address. */
  70. #define ECC_BASE 0xFFFFFFDC /*!< \brief ECC base address. */
  71. #define PERIPH_RPR_OFF 0x00000100 /*!< \brief Receive pointer register offset. */
  72. #define PERIPH_RCR_OFF 0x00000104 /*!< \brief Receive counter register offset. */
  73. #define PERIPH_TPR_OFF 0x00000108 /*!< \brief Transmit pointer register offset. */
  74. #define PERIPH_TCR_OFF 0x0000010C /*!< \brief Transmit counter register offset. */
  75. #define PERIPH_RNPR_OFF 0x00000110 /*!< \brief Receive next pointer register offset. */
  76. #define PERIPH_RNCR_OFF 0x00000114 /*!< \brief Receive next counter register offset. */
  77. #define PERIPH_TNPR_OFF 0x00000118 /*!< \brief Transmit next pointer register offset. */
  78. #define PERIPH_TNCR_OFF 0x0000011C /*!< \brief Transmit next counter register offset. */
  79. #define PERIPH_PTCR_OFF 0x00000120 /*!< \brief PDC transfer control register offset. */
  80. #define PERIPH_PTSR_OFF 0x00000124 /*!< \brief PDC transfer status register offset. */
  81. #define PDC_RXTEN 0x00000001 /*!< \brief Receiver transfer enable. */
  82. #define PDC_RXTDIS 0x00000002 /*!< \brief Receiver transfer disable. */
  83. #define PDC_TXTEN 0x00000100 /*!< \brief Transmitter transfer enable. */
  84. #define PDC_TXTDIS 0x00000200 /*!< \brief Transmitter transfer disable. */
  85. #define EBI_HAS_CSA
  86. #define SMC_HAS_CSR
  87. #define DBGU_HAS_PDC
  88. #define SPI_HAS_PDC
  89. #define SSC_HAS_PDC
  90. #define USART_HAS_PDC
  91. #define USART_HAS_MODE
  92. #define ADC_HAS_PDC
  93. #define PIO_HAS_MULTIDRIVER
  94. #define PIO_HAS_PULLUP
  95. #define PIO_HAS_PERIPHERALSELECT
  96. #define PIO_HAS_OUTPUTWRITEENABLE
  97. #include <arch/arm/atmel/at91_tc.h>
  98. #include <arch/arm/atmel/at91_us.h>
  99. #include <arch/arm/atmel/at91_dbgu.h>
  100. #include <arch/arm/atmel/at91_spi.h>
  101. #include <arch/arm/atmel/at91_aic.h>
  102. #include <arch/arm/atmel/at91_pio.h>
  103. #include <arch/arm/atmel/at91_pmc.h>
  104. #include <arch/arm/atmel/at91_rstc.h>
  105. #include <arch/arm/atmel/at91_wdt.h>
  106. #include <arch/arm/atmel/at91_pit.h>
  107. #include <arch/arm/atmel/at91_mc.h>
  108. #include <arch/arm/atmel/at91_ebi.h>
  109. #include <arch/arm/atmel/at91_smc.h>
  110. #include <arch/arm/atmel/at91_sdramc.h>
  111. #include <arch/arm/atmel/at91_ssc.h>
  112. #include <arch/arm/atmel/at91_twi.h>
  113. #include <arch/arm/atmel/at91_udp.h>
  114. #include <arch/arm/atmel/at91_adc.h>
  115. #include <arch/arm/atmel/at91_pwmc.h>
  116. /*! \addtogroup xgNutArchArmAt91Sam7se */
  117. /*@{*/
  118. /*! \name Peripheral Identifiers and Interrupts */
  119. /*@{*/
  120. #define FIQ_ID 0 /*!< \brief Fast interrupt ID. */
  121. #define SYSC_ID 1 /*!< \brief System interrupt ID. */
  122. #define PIOA_ID 2 /*!< \brief Parallel I/O controller A ID. */
  123. #define PIOB_ID 3 /*!< \brief Parallel I/O controller B ID. */
  124. #define PIOC_ID 4 /*!< \brief Parallel I/O controller C ID. */
  125. #define SPI0_ID 5 /*!< \brief Serial peripheral interface 0 ID. */
  126. #define US0_ID 6 /*!< \brief USART 0 ID. */
  127. #define US1_ID 7 /*!< \brief USART 1 ID. */
  128. #define SSC_ID 8 /*!< \brief Synchronous serial controller ID. */
  129. #define TWI_ID 9 /*!< \brief Two-wire interface ID. */
  130. #define PWMC_ID 10 /*!< \brief PWM controller ID. */
  131. #define UDP_ID 11 /*!< \brief USB device port ID. */
  132. #define TC0_ID 12 /*!< \brief Timer 0 ID. */
  133. #define TC1_ID 13 /*!< \brief Timer 1 ID. */
  134. #define TC2_ID 14 /*!< \brief Timer 2 ID. */
  135. #define ADC_ID 15 /*!< \brief Analog to digital converter ID. */
  136. /* Reserved 16-28*/
  137. #define IRQ0_ID 29 /*!< \brief External interrupt 0 ID. */
  138. #define IRQ1_ID 30 /*!< \brief External interrupt 1 ID. */
  139. /*@}*/
  140. /*! \name Historical SPI0 Peripheral Multiplexing Names */
  141. /*@{*/
  142. #define SPI0_NPCS0_PA11A 11 /*!< \brief Port bit number on PIO-A Perpheral A. */
  143. #define SPI0_NPCS1_PA09B 9 /*!< \brief Port bit number on PIO-A Perpheral B. */
  144. #define SPI0_NPCS1_PA31A 31 /*!< \brief Port bit number on PIO-A Perpheral A. */
  145. #define SPI0_NPCS2_PA10B 10 /*!< \brief Port bit number on PIO-A Perpheral B. */
  146. #define SPI0_NPCS2_PA30B 30 /*!< \brief Port bit number on PIO-A Perpheral B. */
  147. #define SPI0_NPCS3_PA03B 3 /*!< \brief Port bit number on PIO-A Perpheral B. */
  148. #define SPI0_NPCS3_PA05B 5 /*!< \brief Port bit number on PIO-A Perpheral B. */
  149. #define SPI0_NPCS3_PA22B 22 /*!< \brief Port bit number on PIO-A Perpheral B. */
  150. #define SPI0_MISO_PA12A 12 /*!< \brief Port bit number on PIO-A Perpheral A. */
  151. #define SPI0_MOSI_PA13A 13 /*!< \brief Port bit number on PIO-A Perpheral A. */
  152. #define SPI0_SPCK_PA14A 14 /*!< \brief Port bit number on PIO-A Perpheral A. */
  153. /*@}*/
  154. /*! \name USART Peripheral Multiplexing */
  155. /*@{*/
  156. #define PA5_RXD0_A 5
  157. #define PA6_TXD0_A 6
  158. #define PB2_SCK0_A 2
  159. #define PA7_RTS0_A 7
  160. #define PA8_CTS0_A 8
  161. #define PA21_RXD1_A 21
  162. #define PA22_TXD1_A 22
  163. #define PA23_SCK1_A 23
  164. #define PA24_RTS1_A 24
  165. #define PC8_RTS1_B 8
  166. #define PA25_CTS1_A 25
  167. #define PA26_DCD1_A 26
  168. #define PA27_DTR1_A 27
  169. #define PC9_DTR1_B 9
  170. #define PA28_DSR1_A 28
  171. #define PA29_RI1_A 29
  172. /*@}*/
  173. /*! \name SPI Peripheral Multiplexing */
  174. /*@{*/
  175. #define PA12_SPI0_MISO_A 12
  176. #define PA13_SPI0_MOSI_A 13
  177. #define PA14_SPI0_SPCK_A 14
  178. #define PA11_SPI0_NPCS0_A 11
  179. #define PA31_SPI0_NPCS1_A 31
  180. #define PB9_SPI0_NPCS1_A 9
  181. #define PB10_SPI0_NPCS2_A 10
  182. #define PC14_SPI0_NPCS1_B 14
  183. #define PB30_SPI0_NPCS2_A 30
  184. #define PB3_SPI0_NPCS3_A 3
  185. #define PB5_SPI0_NPCS3_A 5
  186. #define PB22_SPI0_NPCS3_A 22
  187. #define SPI0_PINS _BV(PA12_SPI0_MISO_A) | _BV(PA13_SPI0_MOSI_A) | _BV(PA14_SPI0_SPCK_A)
  188. #define SPI0_PIO_BASE PIOA_BASE
  189. #define SPI0_PSR_OFF PIO_ASR_OFF
  190. #define SPI0_CS0_PIN _BV(PA11_SPI0_NPCS0_A)
  191. #define SPI0_CS0_PIO_BASE PIOA_BASE
  192. #define SPI0_CS0_PSR_OFF PIO_ASR_OFF
  193. #ifndef SPI0_CS1_PIN
  194. #define SPI0_CS1_PIN _BV(PA31_SPI0_NPCS1_A)
  195. #define SPI0_CS1_PIO_BASE PIOA_BASE
  196. #define SPI0_CS1_PSR_OFF PIO_ASR_OFF
  197. #endif
  198. /*@}*/
  199. /*! \name External Bus Interface Multiplexing */
  200. /*@{*/
  201. #define PA0_A0_B 0
  202. #define PB0_A0_B 0
  203. #define PA1_A1_B 1
  204. #define PB1_A1_B 1
  205. #define PA2_A2_B 2
  206. #define PB2_A2_B 2
  207. #define PA3_A3_B 3
  208. #define PB3_A3_B 3
  209. #define PA4_A4_B 4
  210. #define PB4_A4_B 4
  211. #define PA5_A5_B 5
  212. #define PB5_A5_B 5
  213. #define PA6_A6_B 6
  214. #define PB6_A6_B 6
  215. #define PA7_A7_B 7
  216. #define PB7_A7_B 7
  217. #define PA8_A8_B 8
  218. #define PB8_A8_B 8
  219. #define PA9_A9_B 9
  220. #define PB9_A9_B 9
  221. #define PA10_A10_B 10
  222. #define PB10_A10_B 10
  223. #define PA11_A11_B 11
  224. #define PB11_A11_B 11
  225. #define PA12_A12_B 12
  226. #define PB12_A12_B 12
  227. #define PA13_A13_B 13
  228. #define PB13_A13_B 13
  229. #define PA14_A14_B 14
  230. #define PB14_A14_B 14
  231. #define PA15_A15_B 15
  232. #define PB15_A15_B 15
  233. #define PA16_A16_B 16
  234. #define PB16_A16_B 16
  235. #define PA17_A17_B 17
  236. #define PB17_A17_B 17
  237. #define PC16_A18_A 16
  238. #define PC17_A19_A 17
  239. #define PC18_A20_A 18
  240. #define PC19_A21_A 19
  241. #define PC20_A22_A 20
  242. #define PC0_D0_A 0
  243. #define PC1_D1_A 1
  244. #define PC2_D2_A 2
  245. #define PC3_D3_A 3
  246. #define PC4_D4_A 4
  247. #define PC5_D5_A 5
  248. #define PC6_D6_A 6
  249. #define PC7_D7_A 7
  250. #define PC8_D8_A 8
  251. #define PC9_D9_A 9
  252. #define PC10_D10_A 10
  253. #define PC11_D11_A 11
  254. #define PC12_D12_A 12
  255. #define PC13_D13_A 13
  256. #define PC14_D14_A 14
  257. #define PC15_D15_A 15
  258. #define PB18_D16_B 18
  259. #define PB19_D17_B 19
  260. #define PB20_D18_B 20
  261. #define PB21_D19_B 21
  262. #define PB22_D20_B 22
  263. #define PB23_D21_B 23
  264. #define PB24_D22_B 24
  265. #define PB25_D23_B 25
  266. #define PB26_D24_B 26
  267. #define PB27_D25_B 27
  268. #define PB28_D26_B 28
  269. #define PB29_D27_B 29
  270. #define PB30_D28_B 30
  271. #define PB31_D29_B 31
  272. #define PA30_D30_B 30
  273. #define PA31_D31_B 31
  274. #define PA19_NCS4_B 19
  275. #define PA20_NCS2_B 20
  276. #define PA21_NCS6_B 21
  277. #define PA22_NCS5_B 22
  278. #define PA26_NCS1_B 26
  279. #define PC15_NCS3_B 15
  280. #define PC20_NCS7_B 20
  281. #define PC23_NCS0_B 23
  282. #define PA18_NBS3_B 18
  283. #define PA23_NWR1_B 23
  284. #define PA24_SDA10_B 24
  285. #define PA25_SDCKE_B 25
  286. #define PA27_SDWE_B 27
  287. #define PA28_CAS_B 28
  288. #define PA29_RAS_B 29
  289. #define PC16_NWAIT_B 16
  290. #define PC17_NANDOE_B 17
  291. #define PC18_NANDWE_B 18
  292. #define PC21_NWR0_B 21
  293. #define PC22_NRD_B 22
  294. #define PC23_CFRNW_A 23
  295. /*@}*/
  296. /*! \name Debug Unit Peripheral Multiplexing */
  297. /*@{*/
  298. #define PA9_DRXD_A 9
  299. #define PA10_DTXD_A 10
  300. /*@}*/
  301. /*! \name Synchronous Serial Controller Peripheral Multiplexing */
  302. /*@{*/
  303. #define PA17_TD_A 17 /*!< \brief Transmit data pin. */
  304. #define PA18_RD_A 18 /*!< \brief Receive data pin. */
  305. #define PA16_TK_A 16 /*!< \brief Transmit clock pin. */
  306. #define PA19_RK_A 19 /*!< \brief Receive clock pin. */
  307. #define PA15_TF_A 15 /*!< \brief Transmit frame sync. pin. */
  308. #define PA20_RF_A 20 /*!< \brief Receive frame sync. pin. */
  309. /*@}*/
  310. /*! \name Two Wire Interface Peripheral Multiplexing */
  311. /*@{*/
  312. #define PA3_TWD_A 3 /*!< \brief Two wire serial data pin. */
  313. #define PA4_TWCK_A 4 /*!< \brief Two wire serial clock pin. */
  314. /*@}*/
  315. /*! \name Timer/Counter Peripheral Multiplexing */
  316. /*@{*/
  317. #define PB0_TIOA0_A 0
  318. #define PB1_TIOB0_A 1
  319. #define PB4_TCLK0_A 4
  320. #define PB15_TIOA1_A 15
  321. #define PB16_TIOB1_A 16
  322. #define PB28_TCLK1_A 28
  323. #define PB26_TIOA2_A 26
  324. #define PB27_TIOB2_A 27
  325. #define PB29_TCLK2_A 29
  326. /*@}*/
  327. /*! \name Clocks, Oscillators and PLLs Peripheral Multiplexing */
  328. /*@{*/
  329. #define PB6_PCK0_A 6
  330. #define PC10_PCK0_B 10
  331. #define PB17_PCK1_A 17
  332. #define PB21_PCK1_A 21
  333. #define PC11_PCK1_B 11
  334. #define PB18_PCK2_A 18
  335. #define PB31_PCK2_A 31
  336. #define PC12_PCK2_B 12
  337. /*@}*/
  338. /*! \name Advanced Interrupt Controller Peripheral Multiplexing */
  339. /*@{*/
  340. #define PB19_FIQ_A 19
  341. #define PB20_IRQ0_A 20
  342. #define PA30_IRQ1_A 30
  343. /*@}*/
  344. /*! \name ADC Interface Peripheral Multiplexing */
  345. /*@{*/
  346. #define PB8_ADTRG_A 8 /*!< \brief ADC trigger pin. */
  347. /*@}*/
  348. /*! \name PWM Peripheral Multiplexing */
  349. /*@{*/
  350. #define PA0_PWM0_A 0
  351. #define PB11_PWM0_A 11
  352. #define PB23_PWM0_A 23
  353. #define PA1_PWM1_A 1
  354. #define PB12_PWM1_A 12
  355. #define PB24_PWM1_A 24
  356. #define PA2_PWM2_A 2
  357. #define PB13_PWM2_A 13
  358. #define PB25_PWM2_A 25
  359. #define PB7_PWM3_A 7
  360. #define PB14_PWM3_A 14
  361. /*@}*/
  362. /*@} xgNutArchArmAt91se */
  363. #endif /* _ARCH_ARM_AT91SAM7SE_H_ */