Adc_CfgDefines.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : ADC
  5. * Dependencies : none
  6. *
  7. * Autosar Version : 4.4.0
  8. * Autosar Revision : ASR_REL_4_4_REV_0000
  9. * Autosar Conf.Variant :
  10. * SW Version : 1.0.0
  11. * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
  12. *
  13. * (c) Copyright 2020-2021 NXP Semiconductors
  14. * All Rights Reserved.
  15. *
  16. * NXP Confidential. This software is owned or controlled by NXP and may only be
  17. * used strictly in accordance with the applicable license terms. By expressly
  18. * accepting such terms or by downloading, installing, activating and/or otherwise
  19. * using the software, you are agreeing that you have read, and that you agree to
  20. * comply with and are bound by, such license terms. If you do not agree to be
  21. * bound by the applicable license terms, then you may not retain, install,
  22. * activate or otherwise use the software.
  23. ==================================================================================================*/
  24. #ifndef ADC_CFGDEFINES_H
  25. #define ADC_CFGDEFINES_H
  26. /**
  27. * @file
  28. *
  29. * @addtogroup adc_driver_config Adc Driver Configuration
  30. * @{
  31. */
  32. #ifdef __cplusplus
  33. extern "C"{
  34. #endif
  35. /*==================================================================================================
  36. * INCLUDE FILES
  37. * 1) system and project includes
  38. * 2) needed interfaces from external units
  39. * 3) internal and external interfaces from this unit
  40. ==================================================================================================*/
  41. /*==================================================================================================
  42. * SOURCE FILE VERSION INFORMATION
  43. ==================================================================================================*/
  44. #define ADC_VENDOR_ID_CFGDEFINES_H 43
  45. #define ADC_AR_RELEASE_MAJOR_VERSION_CFGDEFINES_H 4
  46. #define ADC_AR_RELEASE_MINOR_VERSION_CFGDEFINES_H 4
  47. #define ADC_AR_RELEASE_REVISION_VERSION_CFGDEFINES_H 0
  48. #define ADC_SW_MAJOR_VERSION_CFGDEFINES_H 1
  49. #define ADC_SW_MINOR_VERSION_CFGDEFINES_H 0
  50. #define ADC_SW_PATCH_VERSION_CFGDEFINES_H 0
  51. /*==================================================================================================
  52. * FILE VERSION CHECKS
  53. ==================================================================================================*/
  54. /*==================================================================================================
  55. * CONSTANTS
  56. ==================================================================================================*/
  57. /*==================================================================================================
  58. * DEFINES AND MACROS
  59. ==================================================================================================*/
  60. /**
  61. * @brief CMR register not present on this platform.
  62. */
  63. #define ADC_CMR_REGISTER_NOT_SUPPORTED
  64. /**
  65. * @brief Specifies if Current channel is used
  66. */
  67. #define ADC_CURRENT_CHANNEL_USED
  68. /**
  69. * @brief Multicore feature is disabled on this platform.
  70. */
  71. #define ADC_MULTICORE_SUPPORT (STD_OFF)
  72. /**
  73. * @brief Number of configured partitions.
  74. */
  75. #define ADC_MAX_PARTITIONS (1U)
  76. /**
  77. * @brief ADC unit 0 available
  78. */
  79. #define ADC_UNIT_0 (0U)
  80. /**
  81. * @brief ADC unit 1 available
  82. */
  83. #define ADC_UNIT_1 (1U)
  84. /**
  85. * @brief Adds/removes ((STD_ON)/(STD_OFF)) the services Adc_EnableHardwareTrigger() and Adc_DisableHardwareTrigger() from the code.
  86. */
  87. #define ADC_HW_TRIGGER_API (STD_ON)
  88. /**
  89. * @brief AdcSetHwUnitPowerMode api enabled/disabled ((STD_ON)/(STD_OFF)).
  90. */
  91. #define ADC_SET_HW_UNIT_POWER_MODE_API (STD_OFF)
  92. /**
  93. * @brief Enables or disables limit checking feature in the ADC driver.
  94. */
  95. #define ADC_ENABLE_LIMIT_CHECK (STD_OFF)
  96. /**
  97. * @brief Group notification mechanism is/is not ((STD_ON)/(STD_OFF)) available at runtime.
  98. */
  99. #define ADC_GRP_NOTIF_CAPABILITY (STD_ON)
  100. /**
  101. * @brief Type of prioritization mechanism ADC_PRIORITY_HW, ADC_PRIORITY_HW_SW and ADC_PRIORITY_NONE.
  102. */
  103. /* SWS_Adc_00522 */
  104. #define ADC_PRIORITY_HW (0U)
  105. #define ADC_PRIORITY_HW_SW (1U)
  106. #define ADC_PRIORITY_NONE (2U)
  107. /**
  108. * @brief Priority implementation.
  109. */
  110. #define ADC_PRIORITY_IMPLEMENTATION (ADC_PRIORITY_NONE)
  111. /**
  112. * @brief Type of alignment mechanism ADC_ALIGN_RIGHT, ADC_ALIGN_LEFT.
  113. */
  114. /* SWS_Adc_00525 */
  115. #define ADC_ALIGN_RIGHT (0U)
  116. #define ADC_ALIGN_LEFT (1U)
  117. /**
  118. * @brief Result Alignment.
  119. */
  120. #define ADC_RESULT_ALIGNMENT (ADC_ALIGN_RIGHT)
  121. /**
  122. * @brief This is a timeout value which is used to wait until
  123. * - the conversion is not aborted.
  124. * - ADC hardware is not entered in power down state.
  125. * - ADC hardware is not entered in idle state.
  126. */
  127. #define ADC_TIMEOUT_COUNTER (100000UL)
  128. /**
  129. * @brief Specifies for reducing the number of interrupts for streaming groups
  130. */
  131. #define ADC_OPTIMIZE_DMA_STREAMING_GROUPS (STD_OFF)
  132. /**
  133. * @brief Specifies to optimize conversions for hw triggered, one shot group.
  134. */
  135. #define ADC_OPTIMIZE_ONESHOT_HW_TRIGGER (STD_OFF)
  136. /**
  137. * @brief Specifies to configure BCTU/CTU list at initialization for ctu hardware trigger mode groups.
  138. */
  139. #define ADC_CTU_HW_TRIGGER_OPTIMIZATION (STD_OFF)
  140. /**
  141. * @brief Define the number of maximum hardware unit configured
  142. */
  143. #define ADC_MAX_HW_UNITS_CFG (1U)
  144. /**
  145. * @brief Add/Remove Autosar Extension Adc_EnableChannel() and Adc_DisableChannel() api.
  146. */
  147. #define ADC_ENABLE_CH_DISABLE_CH_NONAUTO_API (STD_OFF)
  148. /**
  149. * @brief Get injected conversion status api enabled/disabled (STD_ON/STD_OFF).
  150. */
  151. #define ADC_GET_INJECTED_CONVERSION_STATUS_API (STD_OFF)
  152. /**
  153. * @brief Adc transfer type.
  154. */
  155. #ifdef ADC_DMA_SUPPORTED
  156. #define ADC_DMA (0U)
  157. #endif /* ADC_DMA_SUPPORTED */
  158. #define ADC_INTERRUPT (1U)
  159. /**
  160. * @brief Add/Remove Autosar Extension Adc_SetClockMode().
  161. */
  162. #define ADC_DUAL_CLOCK_MODE (STD_OFF)
  163. /**
  164. * @brief Add/remove ((STD_ON)/(STD_OFF)) the service Adc_Calibration() from the code.
  165. */
  166. #define ADC_CALIBRATION (STD_ON)
  167. /**
  168. * @brief Add/remove ((STD_ON)/(STD_OFF)) the service Adc_SetChannel() from the code.
  169. */
  170. #define ADC_SETCHANNEL_API (STD_OFF)
  171. /**
  172. * @brief Extra group notification mechanism is/is not ((STD_ON)/(STD_OFF)) available at runtime.
  173. */
  174. #define ADC_ENABLE_INITIAL_NOTIFICATION (STD_OFF)
  175. /**
  176. * @brief Add/remove ((STD_ON)/(STD_OFF)) the service Adc_SelfTest() from the code.
  177. */
  178. #define ADC_SELF_TEST (STD_OFF)
  179. /**
  180. * @brief ADC Configure Threshold enabled/disabled (STD_ON/STD_OFF).
  181. */
  182. #define ADC_ENABLE_CONFIGURE_THRESHOLD_NONAUTO_API (STD_OFF)
  183. /**
  184. * @brief Switch to enable/disable the API for the CPR_RTD_00056, CPR_RTD_00057, CPR_RTD_00058, CPR_RTD_00059 and CPR_RTD_00060.
  185. */
  186. #define ADC_CTU_CONTROL_MODE_EXTRA_APIS (STD_OFF)
  187. /**
  188. * @brief This switch is used to enable the hardware trigger Autosar Extension API for the CPR_RTD_00037, CPR_RTD_00038, CPR_RTD_00039, CPR_RTD_00040, CPR_RTD_00041.
  189. */
  190. #define ADC_ENABLE_CTUTRIG_NONAUTO_API (STD_OFF)
  191. /**
  192. * @brief Switch to enable/disable the API for the CPR-MCAL-726, CPR-MCAL-727, CPR-MCAL-728.
  193. */
  194. #define ADC_ENABLE_CTU_CONTROL_MODE_API (STD_OFF)
  195. /**
  196. * @brief Switch to enable/disable the API for Tempsense.
  197. */
  198. #define ADC_ENABLE_TEMPSENSE_API (STD_OFF)
  199. #define ADC_POWER_ON_TEMPSENSE (STD_OFF)
  200. /**
  201. * @brief Enable the read of raw data API (CPR_RTD_00508).
  202. */
  203. #define ADC_ENABLE_READ_RAW_DATA_API (STD_OFF)
  204. /**
  205. * @brief Enable Group Streaming Result as multiple set.
  206. */
  207. #define ADC_ENABLE_GROUP_STREAMING_RESULTS_REORDER (STD_OFF)
  208. /**
  209. * @brief IRQ definition
  210. */
  211. #define ADC_UNIT_1_ISR_USED
  212. /**
  213. * @brief max queue depth configured across all configset.
  214. */
  215. #define ADC_QUEUE_MAX_DEPTH_MAX (1U)
  216. /**
  217. * @brief max number of groups configured across all configset.
  218. */
  219. #define ADC_MAX_GROUPS (2U)
  220. /**
  221. * @brief Invalid Hardware group ID to determine there is no ongoing hardware group
  222. */
  223. #define ADC_INVALID_HW_GROUP_ID (0xFFFFU)
  224. #ifdef ADC_DMA_SUPPORTED
  225. /**
  226. * @brief Maximum number of channels across all hardware units.
  227. */
  228. #define ADC_MAX_CHANNEL_PER_HW_UNIT (8U)
  229. #endif /* ADC_DMA_SUPPORTED */
  230. /**
  231. * @brief Software injected conversion use
  232. */
  233. #define ADC_SOFTWARE_INJECTED_CONVERSIONS_USED (STD_OFF)
  234. /**
  235. * @brief Configuration Precompile variant.
  236. * @details Configuration Precompile variant.
  237. */
  238. #define ADC_PRECOMPILE_SUPPORT (STD_OFF)
  239. /**
  240. * @brief Development error detection enabled/disabled ((STD_ON)/(STD_OFF)).
  241. */
  242. #define ADC_DEV_ERROR_DETECT (STD_ON)
  243. /**
  244. * @brief Add/remove ((STD_ON)/(STD_OFF)) the service Adc_GetVersionInfo() from the code.
  245. */
  246. #define ADC_VERSION_INFO_API (STD_ON)
  247. /**
  248. * @brief Add/remove ((STD_ON)/(STD_OFF)) the service Adc_DeInit() from the code.
  249. */
  250. #define ADC_DEINIT_API (STD_ON)
  251. /**
  252. * @brief Add/remove ((STD_ON)/(STD_OFF)) the services Adc_StartGroupConversion()and Adc_StopGroupConversion() from the code.
  253. */
  254. #define ADC_ENABLE_START_STOP_GROUP_API (STD_ON)
  255. /**
  256. * @brief Add/Remove the services Adc_ReadGroup() from the code.
  257. */
  258. #define ADC_READ_GROUP_API (STD_ON)
  259. /**
  260. * @brief Add/Remove One time setting of Conversion time registers from Init() function.
  261. */
  262. #define ADC_SET_ADC_CONV_TIME_ONCE (STD_OFF)
  263. /**
  264. * @brief Switch to enable that power state mode is supported
  265. *
  266. */
  267. #define ADC_POWER_STATE_SUPPORTED (STD_OFF)
  268. #if (ADC_POWER_STATE_SUPPORTED == STD_ON)
  269. /**
  270. * @brief Enable/Disable the asynchronous power mode
  271. *
  272. */
  273. #define ADC_POWER_STATE_ASYNCH_MODE_SUPPORTED (STD_OFF)
  274. #endif /* (ADC_POWER_STATE_SUPPORTED == STD_ON) */
  275. /**
  276. * @brief This switch is used to enable the queue.
  277. */
  278. #define ADC_ENABLE_QUEUING (STD_ON)
  279. /**
  280. * @brief This switch is used to enable the Autosar Extension ADC performance optimization feature.
  281. */
  282. #define ADC_BYPASS_ABORT_CHAIN_CHECK (STD_OFF)
  283. /**
  284. * @brief Symbolic names of ADC Hardware units.
  285. * @details Values generated are the ADC Logical Unit ID selected from configurator.
  286. * These defines are recommended to be used with any ADC driver API that takes as input parameter Adc Unit.
  287. */
  288. #define AdcHwUnit_1 (0U)
  289. /**
  290. * @brief Adc channel id.
  291. */
  292. #define ADC_ID_CHANNEL_U8(Id) (Id)
  293. /**
  294. * @brief macros to simplify access to structures.
  295. * @details Streaming number of samples
  296. */
  297. #define ADC_STREAMING_NUM_SAMPLES(num) (num)
  298. /**
  299. * @brief Adc group priority.
  300. */
  301. #define ADC_GROUP_PRIORITY(Priority) (Priority)
  302. /**
  303. * @brief AUTOSAR Symbolic names of channels on all HW units with encoded value.
  304. * @details Bit fields [12-15]: HW unit physical id
  305. * Bit fields [0-11]: Logical id of channel in HW unit (used in Adc_EnableChannel()/Adc_DisableChannel())
  306. */
  307. #define Adc1_VREFH (0x1000U)
  308. #define Adc1_BANDGAP (0x1001U)
  309. #define Adc1_VREFL (0x1002U)
  310. #define PTB12_ADC1_SE7_MCU_TP1 (0x1003U)
  311. #define PTD4_ADC1_SE6_MCU_TP2 (0x1004U)
  312. #define PTC7_ADC1_SE5_MCU_TP3 (0x1005U)
  313. #define PTC6_ADC1_SE4_MCU_TP4 (0x1006U)
  314. #define PTE6_ADC1_SE11_MCU_SYS_TP (0x1007U)
  315. /**
  316. * @brief Definitions used for extracting the ADC Logical Unit Id and logical id of channels in each unit from equivalent channel symbolic name
  317. */
  318. #if (ADC_ENABLE_CH_DISABLE_CH_NONAUTO_API == STD_ON)
  319. #define ADC_CHANNEL_SYMBOLIC_NAME_MASK_CHANNEL_ID_U16 (0xFFFU)
  320. #define ADC_CHANNEL_SYMBOLIC_NAME_SHIFT_HW_UNIT_ID_U16 (12U)
  321. #endif /* (ADC_ENABLE_CH_DISABLE_CH_NONAUTO_API == STD_ON) */
  322. /**
  323. * @brief Autosar Extension symbolic names of channels per groups, on all HW units, with value set to channel index in the group.
  324. */
  325. #define AdcGroupSoftwareOneShot_Adc1_VREFH (0U)
  326. #define AdcGroupSoftwareOneShot_Adc1_BANDGAP (1U)
  327. #define AdcGroupSoftwareOneShot_Adc1_VREFL (2U)
  328. #define AdcGroupSoftwareOneShot_PTB12_ADC1_SE7_MCU_TP1 (3U)
  329. #define AdcGroupSoftwareOneShot_PTD4_ADC1_SE6_MCU_TP2 (4U)
  330. #define AdcGroupSoftwareOneShot_PTC7_ADC1_SE5_MCU_TP3 (5U)
  331. #define AdcGroupSoftwareOneShot_PTC6_ADC1_SE4_MCU_TP4 (6U)
  332. #define AdcGroupSoftwareOneShot_PTE6_ADC1_SE11_MCU_SYS_TP (7U)
  333. #define AdcGroupHardwareOneShot_Adc1_VREFH (0U)
  334. #define AdcGroupHardwareOneShot_Adc1_BANDGAP (1U)
  335. #define AdcGroupHardwareOneShot_Adc1_VREFL (2U)
  336. #define AdcGroupHardwareOneShot_PTB12_ADC1_SE7_MCU_TP1 (3U)
  337. #define AdcGroupHardwareOneShot_PTD4_ADC1_SE6_MCU_TP2 (4U)
  338. #define AdcGroupHardwareOneShot_PTC7_ADC1_SE5_MCU_TP3 (5U)
  339. #define AdcGroupHardwareOneShot_PTC6_ADC1_SE4_MCU_TP4 (6U)
  340. #define AdcGroupHardwareOneShot_PTE6_ADC1_SE11_MCU_SYS_TP (7U)
  341. /**
  342. * @brief Symbolic names of groups.
  343. */
  344. #define AdcGroupSoftwareOneShot (0U)
  345. #define AdcGroupHardwareOneShot (1U)
  346. /**
  347. * @brief Symbolic names of groups - ecuc 2108 compliant.
  348. */
  349. #define AdcConf_AdcGroup_AdcGroupSoftwareOneShot (0U)
  350. #define AdcConf_AdcGroup_AdcGroupHardwareOneShot (1U)
  351. /**
  352. * @brief ADC Global Validation.
  353. */
  354. #define ADC_VALIDATE_GLOBAL_CALL (ADC_DEV_ERROR_DETECT)
  355. #define ADC_VALIDATE_CALL_AND_GROUP (ADC_DEV_ERROR_DETECT)
  356. #define ADC_VALIDATE_CALL_AND_UNIT (ADC_DEV_ERROR_DETECT)
  357. #define ADC_VALIDATE_PARAMS (ADC_DEV_ERROR_DETECT)
  358. #define ADC_VALIDATE_NOTIFY_CAPABILITY (ADC_DEV_ERROR_DETECT)
  359. /*==================================================================================================
  360. * ENUMS
  361. ==================================================================================================*/
  362. /*==================================================================================================
  363. * STRUCTURES AND OTHER TYPEDEFS
  364. ==================================================================================================*/
  365. /*==================================================================================================
  366. * GLOBAL VARIABLE DECLARATIONS
  367. ==================================================================================================*/
  368. /*==================================================================================================
  369. * FUNCTION PROTOTYPES
  370. ==================================================================================================*/
  371. #ifdef __cplusplus
  372. }
  373. #endif
  374. /** @} */
  375. #endif /* ADC_CFGDEFINES_H */