cpu_cfg.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /*
  2. *********************************************************************************************************
  3. * uC/CPU
  4. * CPU CONFIGURATION & PORT LAYER
  5. *
  6. * (c) Copyright 2004-2015; Micrium, Inc.; Weston, FL
  7. *
  8. * All rights reserved. Protected by international copyright laws.
  9. *
  10. * uC/CPU is provided in source form to registered licensees ONLY. It is
  11. * illegal to distribute this source code to any third party unless you receive
  12. * written permission by an authorized Micrium representative. Knowledge of
  13. * the source code may NOT be used to develop a similar product.
  14. *
  15. * Please help us continue to provide the Embedded community with the finest
  16. * software available. Your honesty is greatly appreciated.
  17. *
  18. * You can find our product's user manual, API reference, release notes and
  19. * more information at https://doc.micrium.com.
  20. * You can contact us at www.micrium.com.
  21. *********************************************************************************************************
  22. */
  23. /*
  24. *********************************************************************************************************
  25. *
  26. * CPU CONFIGURATION FILE
  27. *
  28. * TEMPLATE
  29. *
  30. * Filename : cpu_cfg.h
  31. * Version : V1.30.02
  32. * Programmer(s) : SR
  33. * ITJ
  34. * JBL
  35. *********************************************************************************************************
  36. */
  37. /*
  38. *********************************************************************************************************
  39. * MODULE
  40. *********************************************************************************************************
  41. */
  42. #ifndef CPU_CFG_MODULE_PRESENT
  43. #define CPU_CFG_MODULE_PRESENT
  44. /*
  45. *********************************************************************************************************
  46. * CPU NAME CONFIGURATION
  47. *
  48. * Note(s) : (1) Configure CPU_CFG_NAME_EN to enable/disable CPU host name feature :
  49. *
  50. * (a) CPU host name storage
  51. * (b) CPU host name API functions
  52. *
  53. * (2) Configure CPU_CFG_NAME_SIZE with the desired ASCII string size of the CPU host name,
  54. * including the terminating NULL character.
  55. *
  56. * See also 'cpu_core.h GLOBAL VARIABLES Note #1'.
  57. *********************************************************************************************************
  58. */
  59. /* Configure CPU host name feature (see Note #1) : */
  60. #define CPU_CFG_NAME_EN DEF_ENABLED
  61. /* DEF_DISABLED CPU host name DISABLED */
  62. /* DEF_ENABLED CPU host name ENABLED */
  63. /* Configure CPU host name ASCII string size ... */
  64. #define CPU_CFG_NAME_SIZE 16 /* ... (see Note #2). */
  65. /*
  66. *********************************************************************************************************
  67. * CPU TIMESTAMP CONFIGURATION
  68. *
  69. * Note(s) : (1) Configure CPU_CFG_TS_xx_EN to enable/disable CPU timestamp features :
  70. *
  71. * (a) CPU_CFG_TS_32_EN enable/disable 32-bit CPU timestamp feature
  72. * (b) CPU_CFG_TS_64_EN enable/disable 64-bit CPU timestamp feature
  73. *
  74. * (2) (a) Configure CPU_CFG_TS_TMR_SIZE with the CPU timestamp timer's word size :
  75. *
  76. * CPU_WORD_SIZE_08 8-bit word size
  77. * CPU_WORD_SIZE_16 16-bit word size
  78. * CPU_WORD_SIZE_32 32-bit word size
  79. * CPU_WORD_SIZE_64 64-bit word size
  80. *
  81. * (b) If the size of the CPU timestamp timer is not a binary multiple of 8-bit octets
  82. * (e.g. 20-bits or even 24-bits), then the next lower, binary-multiple octet word
  83. * size SHOULD be configured (e.g. to 16-bits). However, the minimum supported word
  84. * size for CPU timestamp timers is 8-bits.
  85. *
  86. * See also 'cpu_core.h FUNCTION PROTOTYPES CPU_TS_TmrRd() Note #2a'.
  87. *********************************************************************************************************
  88. */
  89. /* Configure CPU timestamp features (see Note #1) : */
  90. #define CPU_CFG_TS_32_EN DEF_ENABLED
  91. #define CPU_CFG_TS_64_EN DEF_DISABLED
  92. /* DEF_DISABLED CPU timestamps DISABLED */
  93. /* DEF_ENABLED CPU timestamps ENABLED */
  94. /* Configure CPU timestamp timer word size ... */
  95. /* ... (see Note #2) : */
  96. #define CPU_CFG_TS_TMR_SIZE CPU_WORD_SIZE_32
  97. /*
  98. *********************************************************************************************************
  99. * CPU INTERRUPTS DISABLED TIME MEASUREMENT CONFIGURATION
  100. *
  101. * Note(s) : (1) (a) Configure CPU_CFG_INT_DIS_MEAS_EN to enable/disable measuring CPU's interrupts
  102. * disabled time :
  103. *
  104. * (a) Enabled, if CPU_CFG_INT_DIS_MEAS_EN #define'd in 'cpu_cfg.h'
  105. *
  106. * (b) Disabled, if CPU_CFG_INT_DIS_MEAS_EN NOT #define'd in 'cpu_cfg.h'
  107. *
  108. * See also 'cpu_core.h FUNCTION PROTOTYPES Note #1'.
  109. *
  110. * (b) Configure CPU_CFG_INT_DIS_MEAS_OVRHD_NBR with the number of times to measure &
  111. * average the interrupts disabled time measurements overhead.
  112. *
  113. * See also 'cpu_core.c CPU_IntDisMeasInit() Note #3a'.
  114. *********************************************************************************************************
  115. */
  116. #if 1 /* Configure CPU interrupts disabled time ... */
  117. #define CPU_CFG_INT_DIS_MEAS_EN /* ... measurements feature (see Note #1a). */
  118. #endif
  119. /* Configure number of interrupts disabled overhead ... */
  120. #define CPU_CFG_INT_DIS_MEAS_OVRHD_NBR 1u /* ... time measurements (see Note #1b). */
  121. /*
  122. *********************************************************************************************************
  123. * CPU COUNT ZEROS CONFIGURATION
  124. *
  125. * Note(s) : (1) (a) Configure CPU_CFG_LEAD_ZEROS_ASM_PRESENT to define count leading zeros bits
  126. * function(s) in :
  127. *
  128. * (1) 'cpu_a.asm', if CPU_CFG_LEAD_ZEROS_ASM_PRESENT #define'd in 'cpu.h'/
  129. * 'cpu_cfg.h' to enable assembly-optimized function(s)
  130. *
  131. * (2) 'cpu_core.c', if CPU_CFG_LEAD_ZEROS_ASM_PRESENT NOT #define'd in 'cpu.h'/
  132. * 'cpu_cfg.h' to enable C-source-optimized function(s) otherwise
  133. *
  134. * (b) Configure CPU_CFG_TRAIL_ZEROS_ASM_PRESENT to define count trailing zeros bits
  135. * function(s) in :
  136. *
  137. * (1) 'cpu_a.asm', if CPU_CFG_TRAIL_ZEROS_ASM_PRESENT #define'd in 'cpu.h'/
  138. * 'cpu_cfg.h' to enable assembly-optimized function(s)
  139. *
  140. * (2) 'cpu_core.c', if CPU_CFG_TRAIL_ZEROS_ASM_PRESENT NOT #define'd in 'cpu.h'/
  141. * 'cpu_cfg.h' to enable C-source-optimized function(s) otherwise
  142. *********************************************************************************************************
  143. */
  144. #if 1 /* Configure CPU count leading zeros bits ... */
  145. #define CPU_CFG_LEAD_ZEROS_ASM_PRESENT /* ... assembly-version (see Note #1a). */
  146. #endif
  147. #if 0 /* Configure CPU count trailing zeros bits ... */
  148. #define CPU_CFG_TRAIL_ZEROS_ASM_PRESENT /* ... assembly-version (see Note #1b). */
  149. #endif
  150. /*
  151. *********************************************************************************************************
  152. * CPU ENDIAN TYPE OVERRIDE
  153. *
  154. * Note(s) : (1) Configure CPU_CFG_ENDIAN_TYPE to override the default CPU endian type defined in cpu.h.
  155. *
  156. * (a) CPU_ENDIAN_TYPE_BIG Big- endian word order (CPU words' most significant
  157. * octet @ lowest memory address)
  158. * (b) CPU_ENDIAN_TYPE_LITTLE Little-endian word order (CPU words' least significant
  159. * octet @ lowest memory address)
  160. *
  161. * (2) Defining CPU_CFG_ENDIAN_TYPE here is only valid for supported bi-endian architectures.
  162. * See 'cpu.h CPU WORD CONFIGURATION Note #3' for details
  163. *********************************************************************************************************
  164. */
  165. #if 0
  166. #define CPU_CFG_ENDIAN_TYPE CPU_ENDIAN_TYPE_BIG /* Defines CPU data word-memory order (see Note #2). */
  167. #endif
  168. /*
  169. *********************************************************************************************************
  170. * CACHE MANAGEMENT
  171. *
  172. * Note(s) : (1) Configure CPU_CFG_CACHE_MGMT_EN to enable the cache managment API.
  173. *
  174. * (2) Defining CPU_CFG_CACHE_MGMT_EN to DEF_ENABLED only enable the cache management function.
  175. * Cache are assumed to be configured and enabled by the time CPU_init() is called.
  176. *********************************************************************************************************
  177. */
  178. #define CPU_CFG_CACHE_MGMT_EN DEF_DISABLED /* Defines CPU data word-memory order (see Note #1). */
  179. /*
  180. *********************************************************************************************************
  181. * MODULE END
  182. *********************************************************************************************************
  183. */
  184. #endif /* End of CPU cfg module include. */