cpu_cfg.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*
  2. *********************************************************************************************************
  3. * uC/CPU
  4. * CPU CONFIGURATION & PORT LAYER
  5. *
  6. * (c) Copyright 2004-2011; 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 contact us at www.micrium.com.
  19. *********************************************************************************************************
  20. */
  21. /*
  22. *********************************************************************************************************
  23. *
  24. * CPU CONFIGURATION FILE
  25. *
  26. * TEMPLATE
  27. *
  28. * Filename : cpu_cfg.h
  29. * Version : V1.28.01
  30. * Programmer(s) : SR
  31. * ITJ
  32. *********************************************************************************************************
  33. */
  34. /*
  35. *********************************************************************************************************
  36. * MODULE
  37. *********************************************************************************************************
  38. */
  39. #ifndef CPU_CFG_MODULE_PRESENT
  40. #define CPU_CFG_MODULE_PRESENT
  41. /*
  42. *********************************************************************************************************
  43. * CPU NAME CONFIGURATION
  44. *
  45. * Note(s) : (1) Configure CPU_CFG_NAME_EN to enable/disable CPU host name feature :
  46. *
  47. * (a) CPU host name storage
  48. * (b) CPU host name API functions
  49. *
  50. * (2) Configure CPU_CFG_NAME_SIZE with the desired ASCII string size of the CPU host name,
  51. * including the terminating NULL character.
  52. *
  53. * See also 'cpu_core.h GLOBAL VARIABLES Note #1'.
  54. *********************************************************************************************************
  55. */
  56. /* Configure CPU host name feature (see Note #1) : */
  57. #define CPU_CFG_NAME_EN DEF_DISABLED
  58. /* DEF_DISABLED CPU host name DISABLED */
  59. /* DEF_ENABLED CPU host name ENABLED */
  60. /* Configure CPU host name ASCII string size ... */
  61. #define CPU_CFG_NAME_SIZE 16 /* ... (see Note #2). */
  62. /*$PAGE*/
  63. /*
  64. *********************************************************************************************************
  65. * CPU TIMESTAMP CONFIGURATION
  66. *
  67. * Note(s) : (1) Configure CPU_CFG_TS_xx_EN to enable/disable CPU timestamp features :
  68. *
  69. * (a) CPU_CFG_TS_32_EN enable/disable 32-bit CPU timestamp feature
  70. * (b) CPU_CFG_TS_64_EN enable/disable 64-bit CPU timestamp feature
  71. *
  72. * (2) (a) Configure CPU_CFG_TS_TMR_SIZE with the CPU timestamp timer's word size :
  73. *
  74. * CPU_WORD_SIZE_08 8-bit word size
  75. * CPU_WORD_SIZE_16 16-bit word size
  76. * CPU_WORD_SIZE_32 32-bit word size
  77. * CPU_WORD_SIZE_64 64-bit word size
  78. *
  79. * (b) If the size of the CPU timestamp timer is not a binary multiple of 8-bit octets
  80. * (e.g. 20-bits or even 24-bits), then the next lower, binary-multiple octet word
  81. * size SHOULD be configured (e.g. to 16-bits). However, the minimum supported word
  82. * size for CPU timestamp timers is 8-bits.
  83. *
  84. * See also 'cpu_core.h FUNCTION PROTOTYPES CPU_TS_TmrRd() Note #2a'.
  85. *********************************************************************************************************
  86. */
  87. /* Configure CPU timestamp features (see Note #1) : */
  88. #define CPU_CFG_TS_32_EN DEF_ENABLED
  89. #define CPU_CFG_TS_64_EN DEF_DISABLED
  90. /* DEF_DISABLED CPU timestamps DISABLED */
  91. /* DEF_ENABLED CPU timestamps ENABLED */
  92. /* Configure CPU timestamp timer word size ... */
  93. /* ... (see Note #2) : */
  94. #define CPU_CFG_TS_TMR_SIZE CPU_WORD_SIZE_32
  95. /*
  96. *********************************************************************************************************
  97. * CPU INTERRUPTS DISABLED TIME MEASUREMENT CONFIGURATION
  98. *
  99. * Note(s) : (1) (a) Configure CPU_CFG_INT_DIS_MEAS_EN to enable/disable measuring CPU's interrupts
  100. * disabled time :
  101. *
  102. * (a) Enabled, if CPU_CFG_INT_DIS_MEAS_EN #define'd in 'cpu_cfg.h'
  103. *
  104. * (b) Disabled, if CPU_CFG_INT_DIS_MEAS_EN NOT #define'd in 'cpu_cfg.h'
  105. *
  106. * See also 'cpu_core.h FUNCTION PROTOTYPES Note #1'.
  107. *
  108. * (b) Configure CPU_CFG_INT_DIS_MEAS_OVRHD_NBR with the number of times to measure &
  109. * average the interrupts disabled time measurements overhead.
  110. *
  111. * Recommend a single (1) overhead time measurement, even for instruction-cache-enabled
  112. * CPUs, since critical sections are NOT typically called within instruction-cached loops.
  113. * Thus, a single non-cached/non-averaged time measurement is a more realistic overhead
  114. * for the majority of non-cached interrupts disabled time measurements.
  115. *
  116. * See also 'cpu_core.c CPU_IntDisMeasInit() Note #3a'.
  117. *********************************************************************************************************
  118. */
  119. #if 0 /* Configure CPU interrupts disabled time ... */
  120. #define CPU_CFG_INT_DIS_MEAS_EN /* ... measurements feature (see Note #1a). */
  121. #endif
  122. /* Configure number of interrupts disabled overhead ... */
  123. #define CPU_CFG_INT_DIS_MEAS_OVRHD_NBR 1u /* ... time measurements (see Note #1b). */
  124. /*$PAGE*/
  125. /*
  126. *********************************************************************************************************
  127. * CPU COUNT LEADING ZEROS CONFIGURATION
  128. *
  129. * Note(s) : (1) Configure CPU_CFG_LEAD_ZEROS_ASM_PRESENT to prototype/define count leading zeros bits
  130. * function(s) in :
  131. *
  132. * (a) 'cpu.h'/'cpu_a.asm', if CPU_CFG_LEAD_ZEROS_ASM_PRESENT #define'd in 'cpu.h'/
  133. * 'cpu_cfg.h' to enable assembly-version function
  134. *
  135. * (b) 'cpu_core.h'/'cpu_core.c', if CPU_CFG_LEAD_ZEROS_ASM_PRESENT NOT #define'd in 'cpu.h'/
  136. * 'cpu_cfg.h' to enable C-source-version function otherwise
  137. *
  138. * See also 'cpu_core.h FUNCTION PROTOTYPES Note #2'.
  139. *********************************************************************************************************
  140. */
  141. #if 0 /* Configure CPU count leading zeros bits ... */
  142. #define CPU_CFG_LEAD_ZEROS_ASM_PRESENT /* ... assembly-version (see Note #1). */
  143. #endif
  144. /*$PAGE*/
  145. /*
  146. *********************************************************************************************************
  147. * MODULE END
  148. *********************************************************************************************************
  149. */
  150. #endif /* End of CPU cfg module include. */