cstart.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. /**************************************************************************
  2. ** *
  3. ** FILE : cstart.h *
  4. ** *
  5. ** DESCRIPTION : *
  6. ** Header file to control the system startup code's general settings *
  7. ** and register initializations. The cstart.c file must be part of *
  8. ** your project to make use of this cstart.h. *
  9. ** *
  10. ** In the Eclipse environment this file can be modified using the *
  11. ** C startup code editor, which provides a GUI to modify the *
  12. ** Configuration settings and register initialization. *
  13. ** *
  14. ** Copyright 1996-2015 Altium BV *
  15. ** *
  16. **************************************************************************/
  17. #ifndef CSTART_H
  18. #define CSTART_H
  19. /*
  20. * These items are shown on in Eclipse on the C Start Configuration page
  21. */
  22. #ifndef __NO_CSTART_DEFAULT_CONFIG
  23. /* C Startup settings */
  24. #define __BIV_INIT 1 /* Initialize base address of interrupt vector table */
  25. #define __BIV_SINGLE_INIT 0 /* Initialize single entry interrupt vector table */
  26. #define __BIV_8BYTE_INIT 0 /* Initialize 8 byte spacing interrupt vector table */
  27. #define __BTV_INIT 1 /* Initialize base address of trap vector table */
  28. #define __CSA_INIT 1 /* Initialize CSA lists */
  29. #define __C_INIT 1 /* Initialize and clear C variables */
  30. #define __USP_INIT 1 /* Initialize user stack pointer */
  31. #define __ISP_INIT 1 /* Initialize interrupt stack pointer */
  32. #define __A0A1_INIT 1 /* Initialize a0 and a1 for _a0/_a1 addressing */
  33. #define __A8A9_INIT 1 /* Initialize a8 and a9 for _a8/_a9 addressing (OS support) */
  34. #define __CDC 0x0 /* Call Depth Counter (set PSW.CDC) */
  35. #define __USER_STACK 1 /* Use the user stack (clear PSW.IS) */
  36. #define __WATCHDOG_DISABLE 1 /* Watchdog disable */
  37. #define __SAFETY_WATCHDOG_DISABLE 1 /* Safety watchdog disable */
  38. #define __USE_ARGC_ARGV 0 /* Enable passing argc/argv to main() */
  39. #define __ARGCV_BUFSIZE 256 /* Buffer size for argv */
  40. #define __CLOCKS_PER_SEC_INIT 1 /* Initialize clocks per sec */
  41. #define __fOSC 20000000 /* Oscillator frequency Hz */
  42. #define __PLL_K2_RAMPUP 1 /* PLL K2 rampup */
  43. #define __START_INIT_TC1 1 /* Start TC1 */
  44. #define __START_INIT_TC2 0 /* Start TC2 */
  45. /* Trap Vectors */
  46. #define __RESOLVE_TRAP_0 1 /* Class 0: MMU */
  47. #define __RESOLVE_TRAP_1 1 /* Class 1: Internal protection */
  48. #define __RESOLVE_TRAP_2 1 /* Class 2: Instruction error */
  49. #define __RESOLVE_TRAP_3 1 /* Class 3: Context management */
  50. #define __RESOLVE_TRAP_4 1 /* Class 4: System bus and peripheral errors */
  51. #define __RESOLVE_TRAP_5 1 /* Class 5: Assertion */
  52. #define __RESOLVE_TRAP_6 1 /* Class 6: System call */
  53. #define __RESOLVE_TRAP_7 1 /* Class 7: Non-maskable interrupt */
  54. #define __XC800_INIT 0 /* Download XC800 image to XRAM */
  55. #endif /* __NO_CSTART_DEFAULT_CONFIG */
  56. /*
  57. * Control of initialization registers
  58. *
  59. * The *_VALUE macros define the value of the register
  60. * The *_INIT macros must be defined to 0 or 1, specifying whether
  61. * or not it will be intialized by the cstart.c code.
  62. *
  63. * Most registers are not set to be initialized, which means that
  64. * the CPU's defaults are used. The bus configuration registers will be
  65. * set by running the 'Target Board Configuration' wizard.
  66. * The Eclipse environment will automatically apply the CPU default
  67. * values to the registers. These defaults are defined in the SFR files
  68. * from the include/sfr directory of the product.
  69. *
  70. */
  71. #define __EBU_BOOTCFG_INIT 1
  72. #define __EBU_BOOTCFG_VALUE 0x800C
  73. #ifndef __NO_CSTART_REGISTER_CONFIG
  74. /* Non-bus configuration: */
  75. #define __PMI_CON0_INIT 1
  76. #define __PMI_CON0_VALUE 0x00000000
  77. #define __PMI_CON1_INIT 0
  78. #define __PMI_CON1_VALUE 0x00000000
  79. #define __PMI_CON2_INIT 1
  80. #define __PMI_CON2_VALUE 0x00000000
  81. #define __PMU_EIFCON_INIT 0
  82. #define __PMU_EIFCON_VALUE 0x00000000
  83. #define __DMI_CON_INIT 1
  84. #define __DMI_CON_VALUE 0x00000000
  85. #define __PLL_CLC_INIT 0
  86. #define __PLL_CLC_VALUE 0x00000000
  87. #define __SCU_PLLCON0_INIT 0
  88. #define __SCU_PLLCON0_VALUE 0x0001c600
  89. #define __SCU_PLLCON1_INIT 0
  90. #define __SCU_PLLCON1_VALUE 0x0002020f
  91. #define __SCU_OSCCON_INIT 0
  92. #define __SCU_OSCCON_VALUE 0x10
  93. #define __SCU_CCUCON0_INIT 0
  94. #define __SCU_CCUCON0_VALUE 0x01120148
  95. #define __SCU_CCUCON1_INIT 0
  96. #define __SCU_CCUCON1_VALUE 0x00002211
  97. #define __SCU_CCUCON2_INIT 0
  98. #define __SCU_CCUCON2_VALUE 0x00000002
  99. #define __STM_CLC_INIT 0
  100. #define __STM_CLC_VALUE 0x00000000
  101. #define __GTM_CLC_INIT 1
  102. #define __GTM_CLC_VALUE 0x00000000
  103. #define __FLASH0_FCON_INIT 0
  104. #define __FLASH0_FCON_VALUE 0x00910000
  105. #define __FLASH1_FCON_INIT 0
  106. #define __FLASH1_FCON_VALUE 0x00000000
  107. /* Bus configuration: (set by 'Target Board Configuration' wizard) */
  108. #define __EBU_ADDRSEL0_INIT 0
  109. #define __EBU_ADDRSEL0_VALUE 0x00000000
  110. #define __EBU_ADDRSEL1_INIT 0
  111. #define __EBU_ADDRSEL1_VALUE 0x00000000
  112. #define __EBU_ADDRSEL2_INIT 0
  113. #define __EBU_ADDRSEL2_VALUE 0x00000000
  114. #define __EBU_ADDRSEL3_INIT 0
  115. #define __EBU_ADDRSEL3_VALUE 0x00000000
  116. #define __EBU_ADDRSEL4_INIT 0
  117. #define __EBU_ADDRSEL4_VALUE 0x00000000
  118. #define __EBU_ADDRSEL5_INIT 0
  119. #define __EBU_ADDRSEL5_VALUE 0x00000000
  120. #define __EBU_ADDRSEL6_INIT 0
  121. #define __EBU_ADDRSEL6_VALUE 0x00000000
  122. #define __EBU_BFCON_INIT 0
  123. #define __EBU_BFCON_VALUE 0x00000000
  124. #define __EBU_BUSAP0_INIT 0
  125. #define __EBU_BUSAP0_VALUE 0x00000000
  126. #define __EBU_BUSAP1_INIT 0
  127. #define __EBU_BUSAP1_VALUE 0x00000000
  128. #define __EBU_BUSAP2_INIT 0
  129. #define __EBU_BUSAP2_VALUE 0x00000000
  130. #define __EBU_BUSAP3_INIT 0
  131. #define __EBU_BUSAP3_VALUE 0x00000000
  132. #define __EBU_BUSAP4_INIT 0
  133. #define __EBU_BUSAP4_VALUE 0x00000000
  134. #define __EBU_BUSAP5_INIT 0
  135. #define __EBU_BUSAP5_VALUE 0x00000000
  136. #define __EBU_BUSAP6_INIT 0
  137. #define __EBU_BUSAP6_VALUE 0x00000000
  138. #define __EBU_BUSCON0_INIT 0
  139. #define __EBU_BUSCON0_VALUE 0x00000000
  140. #define __EBU_BUSCON1_INIT 0
  141. #define __EBU_BUSCON1_VALUE 0x00000000
  142. #define __EBU_BUSCON2_INIT 0
  143. #define __EBU_BUSCON2_VALUE 0x00000000
  144. #define __EBU_BUSCON3_INIT 0
  145. #define __EBU_BUSCON3_VALUE 0x00000000
  146. #define __EBU_BUSCON4_INIT 0
  147. #define __EBU_BUSCON4_VALUE 0x00000000
  148. #define __EBU_BUSCON5_INIT 0
  149. #define __EBU_BUSCON5_VALUE 0x00000000
  150. #define __EBU_BUSCON6_INIT 0
  151. #define __EBU_BUSCON6_VALUE 0x00000000
  152. #define __EBU_CLC_INIT 0
  153. #define __EBU_CLC_VALUE 0x00000000
  154. #define __EBU_CON_INIT 0
  155. #define __EBU_CON_VALUE 0x00000000
  156. #define __EBU_EMUAS_INIT 0
  157. #define __EBU_EMUAS_VALUE 0x00000000
  158. #define __EBU_EMUBAP_INIT 0
  159. #define __EBU_EMUBAP_VALUE 0x00000000
  160. #define __EBU_EMUBC_INIT 0
  161. #define __EBU_EMUBC_VALUE 0x00000000
  162. #define __EBU_EMUCON_INIT 0
  163. #define __EBU_EMUCON_VALUE 0x00000000
  164. #define __EBU_EMUOVL_INIT 0
  165. #define __EBU_EMUOVL_VALUE 0x00000000
  166. #define __EBU_SDRMCON0_INIT 0
  167. #define __EBU_SDRMCON0_VALUE 0x00000000
  168. #define __EBU_SDRMCON1_INIT 0
  169. #define __EBU_SDRMCON1_VALUE 0x00000000
  170. #define __EBU_SDRMOD0_INIT 0
  171. #define __EBU_SDRMOD0_VALUE 0x00000000
  172. #define __EBU_SDRMOD1_INIT 0
  173. #define __EBU_SDRMOD1_VALUE 0x00000000
  174. #define __EBU_SDRMREF0_INIT 0
  175. #define __EBU_SDRMREF0_VALUE 0x00000000
  176. #define __EBU_SDRMREF1_INIT 0
  177. #define __EBU_SDRMREF1_VALUE 0x00000000
  178. #define __CBS_MCDBBS_INIT 0
  179. #define __CBS_MCDBBS_VALUE 0x00000000
  180. #define __SBCU_CON_INIT 0
  181. #define __SBCU_CON_VALUE 0xff09ffff
  182. #define __EBU_BUSRAP1_INIT 0
  183. #define __EBU_BUSRAP1_VALUE 0x00000000
  184. #define __EBU_BUSRAP0_INIT 0
  185. #define __EBU_BUSRAP0_VALUE 0x00000000
  186. #define __EBU_BUSRAP2_INIT 0
  187. #define __EBU_BUSRAP2_VALUE 0x00000000
  188. #define __EBU_BUSRAP3_INIT 0
  189. #define __EBU_BUSRAP3_VALUE 0x00000000
  190. #define __EBU_BUSRCON0_INIT 0
  191. #define __EBU_BUSRCON0_VALUE 0x00000000
  192. #define __EBU_BUSRCON1_INIT 0
  193. #define __EBU_BUSRCON1_VALUE 0x00000000
  194. #define __EBU_BUSRCON2_INIT 0
  195. #define __EBU_BUSRCON2_VALUE 0x00000000
  196. #define __EBU_BUSRCON3_INIT 0
  197. #define __EBU_BUSRCON3_VALUE 0x00000000
  198. #define __EBU_BUSWAP0_INIT 0
  199. #define __EBU_BUSWAP0_VALUE 0x00000000
  200. #define __EBU_BUSWAP1_INIT 0
  201. #define __EBU_BUSWAP1_VALUE 0x00000000
  202. #define __EBU_BUSWAP2_INIT 0
  203. #define __EBU_BUSWAP2_VALUE 0x00000000
  204. #define __EBU_BUSWAP3_INIT 0
  205. #define __EBU_BUSWAP3_VALUE 0x00000000
  206. #define __EBU_BUSWCON0_INIT 0
  207. #define __EBU_BUSWCON0_VALUE 0x00000000
  208. #define __EBU_BUSWCON1_INIT 0
  209. #define __EBU_BUSWCON1_VALUE 0x00000000
  210. #define __EBU_BUSWCON2_INIT 0
  211. #define __EBU_BUSWCON2_VALUE 0x00000000
  212. #define __EBU_BUSWCON3_INIT 0
  213. #define __EBU_BUSWCON3_VALUE 0x00000000
  214. #define __EBU_EXTBOOT_INIT 0
  215. #define __EBU_EXTBOOT_VALUE 0x00000000
  216. #define __EBU_MODCON_INIT 0
  217. #define __EBU_MODCON_VALUE 0x00000000
  218. #define __EBU_DDRNCON_INIT 0
  219. #define __EBU_DDRNCON_VALUE 0x00000000
  220. #define __EBU_DDRNMOD_INIT 0
  221. #define __EBU_DDRNMOD_VALUE 0x00000000
  222. #define __EBU_DDRNMOD2_INIT 0
  223. #define __EBU_DDRNMOD2_VALUE 0x00000000
  224. #define __EBU_DDRNPRLD_INIT 0
  225. #define __EBU_DDRNPRLD_VALUE 0x00000000
  226. #define __EBU_DDRNTAG0_INIT 0
  227. #define __EBU_DDRNTAG0_VALUE 0x00000000
  228. #define __EBU_DDRNTAG1_INIT 0
  229. #define __EBU_DDRNTAG1_VALUE 0x00000000
  230. #define __EBU_DDRNTAG2_INIT 0
  231. #define __EBU_DDRNTAG2_VALUE 0x00000000
  232. #define __EBU_DDRNTAG3_INIT 0
  233. #define __EBU_DDRNTAG3_VALUE 0x00000000
  234. #define __EBU_DLLCON_INIT 0
  235. #define __EBU_DLLCON_VALUE 0x00000000
  236. #define __EBU_SDRMCON_INIT 0
  237. #define __EBU_SDRMCON_VALUE 0x00000000
  238. #define __EBU_SDRMOD_INIT 0
  239. #define __EBU_SDRMOD_VALUE 0x00000000
  240. #define __EBU_SDRMREF_INIT 0
  241. #define __EBU_SDRMREF_VALUE 0x00000000
  242. #define __EBU_SDRSTAT_INIT 0
  243. #define __EBU_SDRSTAT_VALUE 0x00000000
  244. #define __P24_PDR0_INIT 0
  245. #define __P24_PDR0_VALUE 0x00000000
  246. #define __P24_PDR1_INIT 0
  247. #define __P24_PDR1_VALUE 0x00000000
  248. #define __P25_PDR0_INIT 0
  249. #define __P25_PDR0_VALUE 0x00000000
  250. #define __P25_PDR1_INIT 0
  251. #define __P25_PDR1_VALUE 0x00000000
  252. #define __P30_PDR0_INIT 0
  253. #define __P30_PDR0_VALUE 0x00000000
  254. #define __P30_PDR1_INIT 0
  255. #define __P30_PDR1_VALUE 0x00000000
  256. #define __P31_PDR0_INIT 0
  257. #define __P31_PDR0_VALUE 0x00000000
  258. #define __P31_PDR1_INIT 0
  259. #define __P31_PDR1_VALUE 0x00000000
  260. #define __PCON0_INIT 1
  261. #define __PCON0_VALUE 0x00000000
  262. #define __DCON0_INIT 1
  263. #define __DCON0_VALUE 0x00000000
  264. #endif /*__NO_CSTART_REGISTER_CONFIG */
  265. #endif /* CSTART_H */