config.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. #ifndef CORE_CONFIG_H
  2. #define CORE_CONFIG_H
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. // DO NOT CHANGE THIS BLOCK!
  5. #define CONFIG_YES 1
  6. #define CONFIG_NO 0
  7. #define CONFIG_SYSCLOCK_HIGH 2
  8. #define CONFIG_SYSCLOCK_NORMAL 1
  9. #define CONFIG_SYSCLOCK_LOW 0
  10. #define CONFIG_SYSTICK_NORMAL 1
  11. #define CONFIG_SYSTICK_LOW 0
  12. #define CONFIG_MSI_FREQ_DEFAULT 0
  13. #define CONFIG_MSI_FREQ_4MHZ 4
  14. #define CONFIG_MSI_FREQ_2MHZ 2
  15. #define CONFIG_MSI_FREQ_1MHZ 1
  16. #define CONFIG_CRYSTAL_12MHZ 0
  17. #define CONFIG_CRYSTAL_16MHZ 1
  18. #define CONFIG_CRYSTAL_8MHZ 2
  19. #define CONFIG_CRYSTAL_4MHZ 3
  20. // DO NOT CHANGE THIS BLOCK!
  21. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  22. //----------------------------------------------------------------
  23. // CONFIG_CRYSTAL
  24. // Specifies the external crystal oscillator frequency
  25. // Default: CONFIG_CRYSTAL_12MHZ
  26. // WARNING: DO NOT FOFGET TO CHANGE "HSE_VALUE" macro in "stm32lxx_hal_conf.h"
  27. #define CONFIG_CRYSTAL CONFIG_CRYSTAL_16MHZ
  28. //----------------------------------------------------------------
  29. // CONFIG_SYSCLOCK
  30. // Default system clock source when USB is active
  31. // Possible values: CONFIG_SYSCLOCK_HIGH, CONFIG_SYSCLOCK_NORMAL, CONFIG_SYSCLOCK_LOW
  32. // Default: CONFIG_SYSCLOCK_NORMAL
  33. #define CONFIG_SYSCLOCK CONFIG_SYSCLOCK_HIGH /// !!!!!!
  34. //----------------------------------------------------------------
  35. // CONFIG_SYSTICK
  36. // Default SysTick timer tick interval
  37. // Default: CONFIG_SYSTICK_NORMAL
  38. #define CONFIG_SYSTICK CONFIG_SYSTICK_NORMAL
  39. //----------------------------------------------------------------
  40. // CONFIG_SYSTICK_BOOST_MULTIPLIER
  41. // Requires: CONFIG_SYSTICK=CONFIG_SYSTICK_NORMAL
  42. // Default: 1 (No boost)
  43. #define CONFIG_SYSTICK_BOOST_MULTIPLIER 1
  44. //----------------------------------------------------------------
  45. // CONFIG_SLEEPMANAGER
  46. // Enable sleep/wakeup power-, clock- and usb- control
  47. // Default: CONFIG_NO
  48. #define CONFIG_SLEEPMANAGER CONFIG_NO
  49. #define CONFIG_SLEEPMANAGER_EXTRASLEEP CONFIG_NO
  50. //----------------------------------------------------------------
  51. // CONFIG_EXTMEM
  52. // Use external memory
  53. // Default: CONFIG_YES
  54. #define CONFIG_EXTMEM CONFIG_YES
  55. //----------------------------------------------------------------
  56. // CONFIG_TSENSOR_INTERVAL
  57. // Temperature sensor measure interval, ms
  58. // Default: 1000
  59. #define CONFIG_TSENSOR_INTERVAL 1000
  60. #if I2CSTRESS
  61. #undef CONFIG_TSENSOR_INTERVAL
  62. #define CONFIG_TSENSOR_INTERVAL 50
  63. #warning I2C Stress test activated
  64. #endif
  65. //----------------------------------------------------------------
  66. // CONFIG_LEDS
  67. // Use LED-indication
  68. // Default: CONFIG_YES
  69. #define CONFIG_LEDS CONFIG_YES
  70. //----------------------------------------------------------------
  71. // CONFIG_ADC
  72. // Use ADC external power control
  73. // Default: CONFIG_YES
  74. #define CONFIG_ADC CONFIG_NO
  75. //----------------------------------------------------------------
  76. // CONFIG_POWER_MANAGEMENT
  77. // Use power management for control power on usb or external voltage source
  78. // Default: CONFIG_YES
  79. #define CONFIG_PM CONFIG_YES
  80. #define CONFIG_PM_INTERVAL 300
  81. //----------------------------------------------------------------
  82. // CONFIG_TABLE_CONTROL_MANAGEMENT
  83. // Use table management for control device switching plan
  84. // Default: CONFIG_YES
  85. #define CONFIG_TABLE CONFIG_YES
  86. //----------------------------------------------------------------
  87. // CONFIG_LED_LOWBAT_FLASH_INTERVAL
  88. // Low Battery Voltage Indication interval, ms
  89. // Default: 5000
  90. #define CONFIG_LED_LOWBAT_FLASH_INTERVAL 2000
  91. //----------------------------------------------------------------
  92. // CONFIG_LED_LOWBAT_FLASH_TIME
  93. // Low Battery Voltage Indication time (LED ON), ms
  94. // Default: 10
  95. #define CONFIG_LED_LOWBAT_FLASH_TIME 40
  96. //----------------------------------------------------------------
  97. // CONFIG_LED_OKBAT_FLASH_INTERVAL
  98. // Normal Battery Voltage Indication interval, ms
  99. // Default: 5000
  100. // Depends on CONFIG_LED_OKBAT_FLASH_ENABLE
  101. #define CONFIG_LED_OKBAT_FLASH_INTERVAL 2000
  102. //----------------------------------------------------------------
  103. // CONFIG_LED_OKWBAT_FLASH_TIME
  104. // Normal Battery Voltage Indication time (LED ON), ms
  105. // Default: 1
  106. // Depends on CONFIG_LED_OKBAT_FLASH_ENABLE
  107. #define CONFIG_LED_OKBAT_FLASH_TIME 40
  108. //----------------------------------------------------------------
  109. // CONFIG_LED_SIGNALING_PERIOD
  110. // Period of changing the LED signals (RED -> GREED -> RED .. ) during
  111. // LED-signaling state, ms
  112. // Default: 50
  113. #define CONFIG_LED_SIGNALING_PERIOD 50
  114. //----------------------------------------------------------------
  115. // CONFIG_LED_SIGNALING_TIME
  116. // Duration of LED-signaling phase on startup, ms
  117. // Default: 2000
  118. #define CONFIG_LED_SIGNALING_TIME 1500
  119. //----------------------------------------------------------------
  120. // CONFIG_LED_OKBAT_FLASH_ENABLE
  121. // Normal Battery Voltage Indication
  122. // Default: CONFIG_YES
  123. #define CONFIG_LED_OKBAT_FLASH_ENABLE CONFIG_YES
  124. //----------------------------------------------------------------
  125. // CONFIG_BATTERY_LOW_VOLTAGE
  126. // Discharged battery voltage level
  127. // Default: 1000
  128. #define CONFIG_BATTERY_LOW_VOLTAGE 1000
  129. //----------------------------------------------------------------
  130. // CONFIG_LED_POLARITY_INVERTED
  131. // Invered LED-control polarity (Active Low)
  132. // Default: CONFIG_NO
  133. #define CONFIG_LED_POLARITY_INVERTED CONFIG_NO
  134. //----------------------------------------------------------------
  135. // CONFIG_USB
  136. // Use USB interface
  137. // Default: CONFIG_YES
  138. #define CONFIG_USB CONFIG_YES
  139. //----------------------------------------------------------------
  140. // CONFIG_USB_DYNAMIC_CLOCK_ADOPT
  141. // Use dynamic system clock depending on if USB is connected or not
  142. // Depends on: CONFIG_SLEEPMANAGER
  143. // Default: CONFIG_NO
  144. #define CONFIG_USB_DYNAMIC_CLOCK_ADOPT CONFIG_NO
  145. //----------------------------------------------------------------
  146. // CONFIG_USB_INTERNAL_WKUP_SUPPORT
  147. // Enables internal USB wakeup-event support
  148. // Default: CONFIG_NO
  149. #define CONFIG_USB_INTERNAL_WKUP_SUPPORT CONFIG_NO
  150. //----------------------------------------------------------------
  151. // CONFIG_AUTOMAT_MODE
  152. // Enables "Automat Mode" - automatic switch control for remote measurement.
  153. // Requires: CONFIG_KEYSW
  154. // Default: CONFIG_NO
  155. #define CONFIG_AUTOMAT_MODE CONFIG_NO
  156. //----------------------------------------------------------------
  157. // CONFIG_MSI_FREQ
  158. // Set internal clock generator frequency (MSI)
  159. // Available values: CONFIG_MSI_FREQ_4MHZ, CONFIG_MSI_FREQ_2MHZ, CONFIG_MSI_FREQ_1MHZ
  160. // Default: CONFIG_MSI_FREQ_2MHZ
  161. #define CONFIG_MSI_FREQ CONFIG_MSI_FREQ_2MHZ // !!!!!! , CONFIG_MSI_FREQ_2MHZ
  162. //----------------------------------------------------------------
  163. // CONFIG_FLASHMEM_CACHE_SIZE
  164. // File: acm_base_mem.c
  165. // Flash-memory cache RAM-size, in bytes
  166. // Default: 1024
  167. #define CONFIG_FLASHMEM_CACHE_SIZE 1024
  168. //----------------------------------------------------------------
  169. // CONFIG_ACMBASECLASS
  170. // File: acm_base.c
  171. // Initialize ACM-Base class in main()
  172. // Default: CONFIG_YES
  173. // Note: can not be used together with CONFIG_KEYSW
  174. #define CONFIG_NFMBASECLASS CONFIG_YES
  175. #define CONFIG_NFMBASECLASS_TEST CONFIG_NO
  176. //----------------------------------------------------------------
  177. // CONFIG_ACMCLASS_AUTOPROTECT_MEMORY
  178. // File: acm_base.c
  179. // Enable memory write-protection automatically on AcmClass initialize
  180. // Default: CONFIG_YES (need to send disable-command to assign S/N)
  181. #define CONFIG_NFMCLASS_AUTOPROTECT_MEMORY CONFIG_YES
  182. //----------------------------------------------------------------
  183. // CONFIG_AUTOMAT_MODE_USB_POWERBANK
  184. // File: usb_application_enumspy.c
  185. // Allows to enable ACM Automat mode while the device is connected
  186. // to the USB Power Bank.
  187. // Default: CONFIG_NO
  188. // Note: the config CONFIG_AUTOMAT_MODE must be enabled
  189. #define CONFIG_AUTOMAT_MODE_USB_POWERBANK CONFIG_NO
  190. //----------------------------------------------------------------
  191. // CONFIG_AUTOMAT_MODE_USB_POWERBANK_ENUMTIMEOUT
  192. // File: usb_application_enumspy.c
  193. // Specifies the USB enumeration timeout before returting to AUTOMAT mode
  194. // after detecting USB VBUS in case the host does not enumerate the device.
  195. // Default: 3000
  196. // Note: the config CONFIG_AUTOMAT_MODE must be enabled
  197. // Note: the config CONFIG_AUTOMAT_MODE_USB_POWERBANK must be enabled
  198. #define CONFIG_AUTOMAT_MODE_USB_POWERBANK_ENUMTIMEOUT 3000
  199. //----------------------------------------------------------------
  200. // CONFIG_HARMUP_INTERVAL - the harming up duration since startup in seconds
  201. // To disable feature set 0.
  202. #define CONFIG_HARMUP_INTERVAL 0
  203. //----------------------------------------------------------------
  204. #define CONFIG_USB_USBTMC_ENABLE CONFIG_YES
  205. //----------------------------------------------------------------
  206. // DEBUG FEATURES:
  207. //----------------------------------------------------------------
  208. // CONFIG_USB_OVERRIDE_IFACE_USBTMC
  209. // Force enable USBTMC interface
  210. // Default: CONFIG_NO
  211. #define CONFIG_USB_OVERRIDE_IFACE_USBTMC CONFIG_YES
  212. //----------------------------------------------------------------
  213. // CONFIG_USB_OVERRIDE_IFACE_VENDOR
  214. // Force enable VENDOR interface
  215. // Default: CONFIG_NO
  216. #define CONFIG_USB_OVERRIDE_IFACE_VENDOR CONFIG_NO
  217. //----------------------------------------------------------------
  218. // CONFIG_EXTREME_LOWPOWTEST
  219. // Extreme low-power test for debug (DEBUG)
  220. // Default: CONFIG_NO
  221. #define CONFIG_EXTREME_LOWPOWTEST CONFIG_NO
  222. //----------------------------------------------------------------
  223. // CONFIG_USBIRQ_TEST
  224. // USB IRQ test: disable USB IRQ for some time to test stability (DEBUG)
  225. // Default: CONFIG_NO
  226. #define CONFIG_USBIRQ_TEST CONFIG_NO
  227. //----------------------------------------------------------------
  228. // CONFIG_DEBUG_USB_SUPRESS_VBUS_WKUP
  229. // Debug: do not wakeup on VBUS line changing (DEBUG)
  230. // Default: CONFIG_NO
  231. #define CONFIG_DEBUG_USB_SUPRESS_VBUS_WKUP CONFIG_NO
  232. //----------------------------------------------------------------
  233. // CONFIG_USB_VENDOR_DUMMYREAD
  234. // Debug: do not call user handler on USB Vendor IN request (DEBUG)
  235. // Default: CONFIG_NO
  236. #define CONFIG_USB_VENDOR_DUMMYREAD CONFIG_NO
  237. //----------------------------------------------------------------
  238. // CONFIG_TSENSOR_EMULATE_FOR_USB
  239. // Emulate the thermosensor presence for USB requests (DEBUG)
  240. // Default: CONFIG_NO
  241. #define CONFIG_TSENSOR_EMULATE_FOR_USB CONFIG_NO
  242. //----------------------------------------------------------------
  243. // CONFIG_EXTMEM_EMULATEREAD
  244. // Emulate reading of external memory instead of real reading (DEBUG)
  245. // Default: CONFIG_NO
  246. #define CONFIG_EXTMEM_EMULATEREAD CONFIG_NO
  247. //----------------------------------------------------------------
  248. // CONFIG_EXTMEM_EMULATEWRITE
  249. // Emulate writing of external memory instead of real writing (DEBUG)
  250. // Default: CONFIG_NO
  251. #define CONFIG_EXTMEM_EMULATEWRITE CONFIG_NO
  252. //----------------------------------------------------------------
  253. // CONFIG_REBOOT_FEATURE
  254. // Enables automatic reboot by request
  255. // Default: CONFIG_YES
  256. #define CONFIG_REBOOT_FEATURE CONFIG_YES
  257. //----------------------------------------------------------------
  258. // CONFIG_AMP_ENABLE
  259. // Enables amplifiers on device start
  260. // Default: CONFIG_YES
  261. #define CONFIG_AMP_ENABLE CONFIG_YES
  262. //----------------------------------------------------------------
  263. // CONFIG_REBOOT_FEATURE_DELAY
  264. // Set the delay before system restart after the request is received.
  265. // Valid only if CONFIG_REBOOT_FEATURE is enabled.
  266. // Default: 1000
  267. #define CONFIG_REBOOT_FEATURE_DELAY 1000
  268. //----------------------------------------------------------------
  269. // CONFIG_NOIRQ_SNPRINTF
  270. // Disables interrupts during @snprintf call to minimalize stack usage
  271. // Default: CONFIG_YES
  272. #define CONFIG_NOIRQ_SNPRINTF CONFIG_YES
  273. //----------------------------------------------------------------
  274. // CONFIG_STACKOVERFLOW_CONTROL_SECTION
  275. // CSTACK overflow protection/notification section
  276. // Place specially prepared signature into the area before CSTACK block in RAM
  277. // to provide easy control of stack overflow.
  278. // It is required to modify your ICF (Linker Configuration) to support this feature.
  279. // Default: CONFIG_YES
  280. #define CONFIG_STACKOVERFLOW_CONTROLSECTION CONFIG_YES
  281. //----------------------------------------------------------------
  282. // CONFIG_SLEEPMANAGER_DEBUG_NOSLEEP
  283. // Do not sleep at all (DEBUG)
  284. // Default: CONFIG_NO
  285. #define CONFIG_SLEEPMANAGER_DEBUG_NOSLEEP CONFIG_NO
  286. #if DEBUGMODE // see Project Options
  287. #undef CONFIG_SLEEPMANAGER_DEBUG_NOSLEEP
  288. #define CONFIG_SLEEPMANAGER_DEBUG_NOSLEEP CONFIG_YES
  289. #if CONFIG_SLEEPMANAGER
  290. #pragma message("In DEBUGMODE MCU does not sleep!")
  291. #endif
  292. #endif
  293. //----------------------------------------------------------------
  294. // CONFIG_SLEEPMANAGER_KEEPDEBUGCLK
  295. // Keep debugger clocking enabled during sleep modes (DEBUG)
  296. // Default: CONFIG_NO
  297. #define CONFIG_SLEEPMANAGER_KEEPDEBUGCLK CONFIG_NO
  298. //----------------------------------------------------------------
  299. // CONFIG_MAINC_DEBUGPIN_1
  300. // Initialize DEBUG GPIO Pin #1 (DEBUG)
  301. // Default: CONFIG_NO
  302. #define CONFIG_MAINC_DEBUGPIN_1 CONFIG_NO
  303. //----------------------------------------------------------------
  304. // CONFIG_MAINC_DEBUGPIN_2
  305. // Initialize DEBUG GPIO Pin #2 (DEBUG)
  306. // Default: CONFIG_NO
  307. #define CONFIG_MAINC_DEBUGPIN_2 CONFIG_NO
  308. //----------------------------------------------------------------
  309. // CONFIG_MAINC_DEBUGPIN_3
  310. // Initialize DEBUG GPIO Pin #3 (DEBUG)
  311. // Default: CONFIG_NO
  312. #define CONFIG_MAINC_DEBUGPIN_3 CONFIG_NO
  313. //----------------------------------------------------------------
  314. // CONFIG_AUTOMAT_DEBUGPIN_1
  315. // CONFIG_AUTOMAT_DEBUGPIN_2
  316. // Use debug pin in "Automat" module (DEBUG)
  317. #define CONFIG_AUTOMAT_DEBUGPIN_1 CONFIG_NO
  318. #define CONFIG_AUTOMAT_DEBUGPIN_2 CONFIG_NO
  319. //----------------------------------------------------------------
  320. // CONFIG_CSECT_DEBUG
  321. // Use debug pin in "CSect" (critical sections) module (DEBUG)
  322. #define CONFIG_CSECT_DEBUG CONFIG_NO
  323. //----------------------------------------------------------------
  324. // CONFIG_SYSTICK_DEBUG
  325. // Use debug pin in "SysTick" module (SysTick IRQ) (DEBUG)
  326. #define CONFIG_SYSTICK_DEBUG CONFIG_NO
  327. //----------------------------------------------------------------
  328. // CONFIG_HALTICK_DEBUG
  329. // Use debug pin in "HAL" module (Tick IRQ) (DEBUG)
  330. #define CONFIG_HALTICK_DEBUG CONFIG_NO
  331. //----------------------------------------------------------------
  332. // CONFIG_USB_DEBUGPIN
  333. // Use debug pin in "USB" module (USB IRQ) (DEBUG)
  334. #define CONFIG_USB_DEBUGPIN CONFIG_NO
  335. //----------------------------------------------------------------
  336. // CONFIG_SLEEPMANAGER_DEBUGPIN
  337. // Use debug pin in sleep manager driver (DEBUG)
  338. // Default: CONFIG_NO
  339. #define CONFIG_SLEEPMANAGER_DEBUGPIN CONFIG_NO
  340. //----------------------------------------------------------------
  341. // Debug Pin Routing
  342. #include "core/debugpinsapi.h" // debugpin_X_set / debugpin_X_clr
  343. // CONFIG_CSECT_DEBUG_SETPIN / CONFIG_CSECT_DEBUG_CLRPIN
  344. // Set and Clear macro for CSect debug pin, use debugpin_X_set / debugpin_X_clr functions
  345. #define CONFIG_CSECT_DEBUG_SETPIN debugpin_2_set();
  346. #define CONFIG_CSECT_DEBUG_CLRPIN debugpin_2_clr();
  347. // CONFIG_SYSTICK_DEBUG_SETPIN / CONFIG_SYSTICK_DEBUG_CLRPIN
  348. // Set and Clear macro for Systick debug pin, use debugpin_X_set / debugpin_X_clr functions
  349. #define CONFIG_SYSTICK_DEBUG_SETPIN debugpin_2_set();
  350. #define CONFIG_SYSTICK_DEBUG_CLRPIN debugpin_2_clr();
  351. // CONFIG_HALTICK_DEBUG_SETPIN / CONFIG_HALTICK_DEBUG_CLRPIN
  352. // Set and Clear macro for Systick debug pin, use debugpin_X_set / debugpin_X_clr functions
  353. #define CONFIG_HALTICK_DEBUG_SETPIN debugpin_2_set();
  354. #define CONFIG_HALTICK_DEBUG_CLRPIN debugpin_2_clr();
  355. // CONFIG_AUTOMAT_DEBUGPIN_SETPIN_1 / CONFIG_AUTOMAT_DEBUGPIN_CLRPIN_1
  356. // Set and Clear macro for Automat debug pin, use debugpin_X_set / debugpin_X_clr functions
  357. #define CONFIG_AUTOMAT_DEBUGPIN_SETPIN_1 debugpin_2_set();
  358. #define CONFIG_AUTOMAT_DEBUGPIN_CLRPIN_1 debugpin_2_clr();
  359. // CONFIG_AUTOMAT_DEBUGPIN_SETPIN_2 / CONFIG_AUTOMAT_DEBUGPIN_CLRPIN_2
  360. // Set and Clear macro for Automat debug pin, use debugpin_X_set / debugpin_X_clr functions
  361. #define CONFIG_AUTOMAT_DEBUGPIN_SETPIN_2 debugpin_1_set();
  362. #define CONFIG_AUTOMAT_DEBUGPIN_CLRPIN_2 debugpin_1_clr();
  363. // CONFIG_AUTOMAT_DEBUGPIN_SETPIN_3 / CONFIG_AUTOMAT_DEBUGPIN_CLRPIN_3
  364. // Set and Clear macro for Automat debug pin, use debugpin_X_set / debugpin_X_clr functions
  365. #define CONFIG_AUTOMAT_DEBUGPIN_SETPIN_3 debugpin_2_set();
  366. #define CONFIG_AUTOMAT_DEBUGPIN_CLRPIN_3 debugpin_2_clr();
  367. // CONFIG_USB_DEBUGPIN_SETPIN / CONFIG_USB_DEBUGPIN_CLRPIN
  368. // Set and Clear macro for USB debug pin, use debugpin_X_set / debugpin_X_clr functions
  369. #define CONFIG_USB_DEBUGPIN_SETPIN debugpin_2_set();
  370. #define CONFIG_USB_DEBUGPIN_CLRPIN debugpin_2_clr();
  371. // CONFIG_SLEEPMANAGER_DEBUGPIN_SETPIN / CONFIG_SLEEPMANAGER_DEBUGPIN_SETPIN
  372. #define CONFIG_SLEEPMANAGER_DEBUGPIN_SETPIN debugpin_1_set();
  373. #define CONFIG_SLEEPMANAGER_DEBUGPIN_CLRPIN debugpin_1_clr();
  374. //----------------------------------------------------------------
  375. #define CONFIG_SCPI_TEST CONFIG_NO
  376. //----------------------------------------------------------------
  377. #endif