1 /* 2 * Copyright 1997-2016 Freescale Semiconductor, Inc. 3 * Copyright 2016-2022 NXP 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 /*! 9 * @file S32K146_SIM.h 10 * @version 1.1 11 * @date 2022-01-31 12 * @brief Peripheral Access Layer for S32K146_SIM 13 * 14 * This file contains register definitions and macros for easy access to their 15 * bit fields. 16 * 17 * This file assumes LITTLE endian system. 18 */ 19 20 /** 21 * @page misra_violations MISRA-C:2012 violations 22 * 23 * @section [global] 24 * Violates MISRA 2012 Advisory Rule 2.3, local typedef not referenced 25 * The SoC header defines typedef for all modules. 26 * 27 * @section [global] 28 * Violates MISRA 2012 Advisory Rule 2.5, local macro not referenced 29 * The SoC header defines macros for all modules and registers. 30 * 31 * @section [global] 32 * Violates MISRA 2012 Advisory Directive 4.9, Function-like macro 33 * These are generated macros used for accessing the bit-fields from registers. 34 * 35 * @section [global] 36 * Violates MISRA 2012 Required Rule 5.1, identifier clash 37 * The supported compilers use more than 31 significant characters for identifiers. 38 * 39 * @section [global] 40 * Violates MISRA 2012 Required Rule 5.2, identifier clash 41 * The supported compilers use more than 31 significant characters for identifiers. 42 * 43 * @section [global] 44 * Violates MISRA 2012 Required Rule 5.4, identifier clash 45 * The supported compilers use more than 31 significant characters for identifiers. 46 * 47 * @section [global] 48 * Violates MISRA 2012 Required Rule 5.5, identifier clash 49 * The supported compilers use more than 31 significant characters for identifiers. 50 * 51 * @section [global] 52 * Violates MISRA 2012 Required Rule 21.1, defined macro '__I' is reserved to the compiler 53 * This type qualifier is needed to ensure correct I/O access and addressing. 54 */ 55 56 /* Prevention from multiple including the same memory map */ 57 #if !defined(S32K146_SIM_H_) /* Check if memory map has not been already included */ 58 #define S32K146_SIM_H_ 59 60 #include "S32K146_COMMON.h" 61 62 /* ---------------------------------------------------------------------------- 63 -- SIM Peripheral Access Layer 64 ---------------------------------------------------------------------------- */ 65 66 /*! 67 * @addtogroup SIM_Peripheral_Access_Layer SIM Peripheral Access Layer 68 * @{ 69 */ 70 71 /** SIM - Register Layout Typedef */ 72 typedef struct { 73 uint8_t RESERVED_0[4]; 74 __IO uint32_t CHIPCTL; /**< Chip Control register, offset: 0x4 */ 75 uint8_t RESERVED_1[4]; 76 __IO uint32_t FTMOPT0; /**< FTM Option Register 0, offset: 0xC */ 77 __IO uint32_t LPOCLKS; /**< LPO Clock Select Register, offset: 0x10 */ 78 uint8_t RESERVED_2[4]; 79 __IO uint32_t ADCOPT; /**< ADC Options Register, offset: 0x18 */ 80 __IO uint32_t FTMOPT1; /**< FTM Option Register 1, offset: 0x1C */ 81 __IO uint32_t MISCTRL0; /**< Miscellaneous control register 0, offset: 0x20 */ 82 __I uint32_t SDID; /**< System Device Identification Register, offset: 0x24 */ 83 uint8_t RESERVED_3[24]; 84 __IO uint32_t PLATCGC; /**< Platform Clock Gating Control Register, offset: 0x40 */ 85 uint8_t RESERVED_4[8]; 86 __I uint32_t FCFG1; /**< Flash Configuration Register 1, offset: 0x4C */ 87 uint8_t RESERVED_5[4]; 88 __I uint32_t UIDH; /**< Unique Identification Register High, offset: 0x54 */ 89 __I uint32_t UIDMH; /**< Unique Identification Register Mid-High, offset: 0x58 */ 90 __I uint32_t UIDML; /**< Unique Identification Register Mid Low, offset: 0x5C */ 91 __I uint32_t UIDL; /**< Unique Identification Register Low, offset: 0x60 */ 92 uint8_t RESERVED_6[4]; 93 __IO uint32_t CLKDIV4; /**< System Clock Divider Register 4, offset: 0x68 */ 94 __IO uint32_t MISCTRL1; /**< Miscellaneous Control register 1, offset: 0x6C */ 95 } SIM_Type, *SIM_MemMapPtr; 96 97 /** Number of instances of the SIM module. */ 98 #define SIM_INSTANCE_COUNT (1u) 99 100 /* SIM - Peripheral instance base addresses */ 101 /** Peripheral SIM base address */ 102 #define IP_SIM_BASE (0x40048000u) 103 /** Peripheral SIM base pointer */ 104 #define IP_SIM ((SIM_Type *)IP_SIM_BASE) 105 /** Array initializer of SIM peripheral base addresses */ 106 #define IP_SIM_BASE_ADDRS { IP_SIM_BASE } 107 /** Array initializer of SIM peripheral base pointers */ 108 #define IP_SIM_BASE_PTRS { IP_SIM } 109 110 /* ---------------------------------------------------------------------------- 111 -- SIM Register Masks 112 ---------------------------------------------------------------------------- */ 113 114 /*! 115 * @addtogroup SIM_Register_Masks SIM Register Masks 116 * @{ 117 */ 118 119 /*! @name CHIPCTL - Chip Control register */ 120 /*! @{ */ 121 122 #define SIM_CHIPCTL_ADC_INTERLEAVE_EN_MASK (0xFU) 123 #define SIM_CHIPCTL_ADC_INTERLEAVE_EN_SHIFT (0U) 124 #define SIM_CHIPCTL_ADC_INTERLEAVE_EN_WIDTH (4U) 125 #define SIM_CHIPCTL_ADC_INTERLEAVE_EN(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_ADC_INTERLEAVE_EN_SHIFT)) & SIM_CHIPCTL_ADC_INTERLEAVE_EN_MASK) 126 127 #define SIM_CHIPCTL_CLKOUTSEL_MASK (0xF0U) 128 #define SIM_CHIPCTL_CLKOUTSEL_SHIFT (4U) 129 #define SIM_CHIPCTL_CLKOUTSEL_WIDTH (4U) 130 #define SIM_CHIPCTL_CLKOUTSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_CLKOUTSEL_SHIFT)) & SIM_CHIPCTL_CLKOUTSEL_MASK) 131 132 #define SIM_CHIPCTL_CLKOUTDIV_MASK (0x700U) 133 #define SIM_CHIPCTL_CLKOUTDIV_SHIFT (8U) 134 #define SIM_CHIPCTL_CLKOUTDIV_WIDTH (3U) 135 #define SIM_CHIPCTL_CLKOUTDIV(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_CLKOUTDIV_SHIFT)) & SIM_CHIPCTL_CLKOUTDIV_MASK) 136 137 #define SIM_CHIPCTL_CLKOUTEN_MASK (0x800U) 138 #define SIM_CHIPCTL_CLKOUTEN_SHIFT (11U) 139 #define SIM_CHIPCTL_CLKOUTEN_WIDTH (1U) 140 #define SIM_CHIPCTL_CLKOUTEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_CLKOUTEN_SHIFT)) & SIM_CHIPCTL_CLKOUTEN_MASK) 141 142 #define SIM_CHIPCTL_TRACECLK_SEL_MASK (0x1000U) 143 #define SIM_CHIPCTL_TRACECLK_SEL_SHIFT (12U) 144 #define SIM_CHIPCTL_TRACECLK_SEL_WIDTH (1U) 145 #define SIM_CHIPCTL_TRACECLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_TRACECLK_SEL_SHIFT)) & SIM_CHIPCTL_TRACECLK_SEL_MASK) 146 147 #define SIM_CHIPCTL_PDB_BB_SEL_MASK (0x2000U) 148 #define SIM_CHIPCTL_PDB_BB_SEL_SHIFT (13U) 149 #define SIM_CHIPCTL_PDB_BB_SEL_WIDTH (1U) 150 #define SIM_CHIPCTL_PDB_BB_SEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_PDB_BB_SEL_SHIFT)) & SIM_CHIPCTL_PDB_BB_SEL_MASK) 151 152 #define SIM_CHIPCTL_ADC_SUPPLY_MASK (0x70000U) 153 #define SIM_CHIPCTL_ADC_SUPPLY_SHIFT (16U) 154 #define SIM_CHIPCTL_ADC_SUPPLY_WIDTH (3U) 155 #define SIM_CHIPCTL_ADC_SUPPLY(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_ADC_SUPPLY_SHIFT)) & SIM_CHIPCTL_ADC_SUPPLY_MASK) 156 157 #define SIM_CHIPCTL_ADC_SUPPLYEN_MASK (0x80000U) 158 #define SIM_CHIPCTL_ADC_SUPPLYEN_SHIFT (19U) 159 #define SIM_CHIPCTL_ADC_SUPPLYEN_WIDTH (1U) 160 #define SIM_CHIPCTL_ADC_SUPPLYEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_ADC_SUPPLYEN_SHIFT)) & SIM_CHIPCTL_ADC_SUPPLYEN_MASK) 161 162 #define SIM_CHIPCTL_SRAMU_RETEN_MASK (0x100000U) 163 #define SIM_CHIPCTL_SRAMU_RETEN_SHIFT (20U) 164 #define SIM_CHIPCTL_SRAMU_RETEN_WIDTH (1U) 165 #define SIM_CHIPCTL_SRAMU_RETEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_SRAMU_RETEN_SHIFT)) & SIM_CHIPCTL_SRAMU_RETEN_MASK) 166 167 #define SIM_CHIPCTL_SRAML_RETEN_MASK (0x200000U) 168 #define SIM_CHIPCTL_SRAML_RETEN_SHIFT (21U) 169 #define SIM_CHIPCTL_SRAML_RETEN_WIDTH (1U) 170 #define SIM_CHIPCTL_SRAML_RETEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_CHIPCTL_SRAML_RETEN_SHIFT)) & SIM_CHIPCTL_SRAML_RETEN_MASK) 171 /*! @} */ 172 173 /*! @name FTMOPT0 - FTM Option Register 0 */ 174 /*! @{ */ 175 176 #define SIM_FTMOPT0_FTM0FLTxSEL_MASK (0x7U) 177 #define SIM_FTMOPT0_FTM0FLTxSEL_SHIFT (0U) 178 #define SIM_FTMOPT0_FTM0FLTxSEL_WIDTH (3U) 179 #define SIM_FTMOPT0_FTM0FLTxSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM0FLTxSEL_SHIFT)) & SIM_FTMOPT0_FTM0FLTxSEL_MASK) 180 181 #define SIM_FTMOPT0_FTM1FLTxSEL_MASK (0x70U) 182 #define SIM_FTMOPT0_FTM1FLTxSEL_SHIFT (4U) 183 #define SIM_FTMOPT0_FTM1FLTxSEL_WIDTH (3U) 184 #define SIM_FTMOPT0_FTM1FLTxSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM1FLTxSEL_SHIFT)) & SIM_FTMOPT0_FTM1FLTxSEL_MASK) 185 186 #define SIM_FTMOPT0_FTM2FLTxSEL_MASK (0x700U) 187 #define SIM_FTMOPT0_FTM2FLTxSEL_SHIFT (8U) 188 #define SIM_FTMOPT0_FTM2FLTxSEL_WIDTH (3U) 189 #define SIM_FTMOPT0_FTM2FLTxSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM2FLTxSEL_SHIFT)) & SIM_FTMOPT0_FTM2FLTxSEL_MASK) 190 191 #define SIM_FTMOPT0_FTM3FLTxSEL_MASK (0x7000U) 192 #define SIM_FTMOPT0_FTM3FLTxSEL_SHIFT (12U) 193 #define SIM_FTMOPT0_FTM3FLTxSEL_WIDTH (3U) 194 #define SIM_FTMOPT0_FTM3FLTxSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM3FLTxSEL_SHIFT)) & SIM_FTMOPT0_FTM3FLTxSEL_MASK) 195 196 #define SIM_FTMOPT0_FTM4CLKSEL_MASK (0x30000U) 197 #define SIM_FTMOPT0_FTM4CLKSEL_SHIFT (16U) 198 #define SIM_FTMOPT0_FTM4CLKSEL_WIDTH (2U) 199 #define SIM_FTMOPT0_FTM4CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM4CLKSEL_SHIFT)) & SIM_FTMOPT0_FTM4CLKSEL_MASK) 200 201 #define SIM_FTMOPT0_FTM5CLKSEL_MASK (0xC0000U) 202 #define SIM_FTMOPT0_FTM5CLKSEL_SHIFT (18U) 203 #define SIM_FTMOPT0_FTM5CLKSEL_WIDTH (2U) 204 #define SIM_FTMOPT0_FTM5CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM5CLKSEL_SHIFT)) & SIM_FTMOPT0_FTM5CLKSEL_MASK) 205 206 #define SIM_FTMOPT0_FTM0CLKSEL_MASK (0x3000000U) 207 #define SIM_FTMOPT0_FTM0CLKSEL_SHIFT (24U) 208 #define SIM_FTMOPT0_FTM0CLKSEL_WIDTH (2U) 209 #define SIM_FTMOPT0_FTM0CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM0CLKSEL_SHIFT)) & SIM_FTMOPT0_FTM0CLKSEL_MASK) 210 211 #define SIM_FTMOPT0_FTM1CLKSEL_MASK (0xC000000U) 212 #define SIM_FTMOPT0_FTM1CLKSEL_SHIFT (26U) 213 #define SIM_FTMOPT0_FTM1CLKSEL_WIDTH (2U) 214 #define SIM_FTMOPT0_FTM1CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM1CLKSEL_SHIFT)) & SIM_FTMOPT0_FTM1CLKSEL_MASK) 215 216 #define SIM_FTMOPT0_FTM2CLKSEL_MASK (0x30000000U) 217 #define SIM_FTMOPT0_FTM2CLKSEL_SHIFT (28U) 218 #define SIM_FTMOPT0_FTM2CLKSEL_WIDTH (2U) 219 #define SIM_FTMOPT0_FTM2CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM2CLKSEL_SHIFT)) & SIM_FTMOPT0_FTM2CLKSEL_MASK) 220 221 #define SIM_FTMOPT0_FTM3CLKSEL_MASK (0xC0000000U) 222 #define SIM_FTMOPT0_FTM3CLKSEL_SHIFT (30U) 223 #define SIM_FTMOPT0_FTM3CLKSEL_WIDTH (2U) 224 #define SIM_FTMOPT0_FTM3CLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT0_FTM3CLKSEL_SHIFT)) & SIM_FTMOPT0_FTM3CLKSEL_MASK) 225 /*! @} */ 226 227 /*! @name LPOCLKS - LPO Clock Select Register */ 228 /*! @{ */ 229 230 #define SIM_LPOCLKS_LPO1KCLKEN_MASK (0x1U) 231 #define SIM_LPOCLKS_LPO1KCLKEN_SHIFT (0U) 232 #define SIM_LPOCLKS_LPO1KCLKEN_WIDTH (1U) 233 #define SIM_LPOCLKS_LPO1KCLKEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_LPOCLKS_LPO1KCLKEN_SHIFT)) & SIM_LPOCLKS_LPO1KCLKEN_MASK) 234 235 #define SIM_LPOCLKS_LPO32KCLKEN_MASK (0x2U) 236 #define SIM_LPOCLKS_LPO32KCLKEN_SHIFT (1U) 237 #define SIM_LPOCLKS_LPO32KCLKEN_WIDTH (1U) 238 #define SIM_LPOCLKS_LPO32KCLKEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_LPOCLKS_LPO32KCLKEN_SHIFT)) & SIM_LPOCLKS_LPO32KCLKEN_MASK) 239 240 #define SIM_LPOCLKS_LPOCLKSEL_MASK (0xCU) 241 #define SIM_LPOCLKS_LPOCLKSEL_SHIFT (2U) 242 #define SIM_LPOCLKS_LPOCLKSEL_WIDTH (2U) 243 #define SIM_LPOCLKS_LPOCLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_LPOCLKS_LPOCLKSEL_SHIFT)) & SIM_LPOCLKS_LPOCLKSEL_MASK) 244 245 #define SIM_LPOCLKS_RTCCLKSEL_MASK (0x30U) 246 #define SIM_LPOCLKS_RTCCLKSEL_SHIFT (4U) 247 #define SIM_LPOCLKS_RTCCLKSEL_WIDTH (2U) 248 #define SIM_LPOCLKS_RTCCLKSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_LPOCLKS_RTCCLKSEL_SHIFT)) & SIM_LPOCLKS_RTCCLKSEL_MASK) 249 /*! @} */ 250 251 /*! @name ADCOPT - ADC Options Register */ 252 /*! @{ */ 253 254 #define SIM_ADCOPT_ADC0TRGSEL_MASK (0x1U) 255 #define SIM_ADCOPT_ADC0TRGSEL_SHIFT (0U) 256 #define SIM_ADCOPT_ADC0TRGSEL_WIDTH (1U) 257 #define SIM_ADCOPT_ADC0TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_ADCOPT_ADC0TRGSEL_SHIFT)) & SIM_ADCOPT_ADC0TRGSEL_MASK) 258 259 #define SIM_ADCOPT_ADC0SWPRETRG_MASK (0xEU) 260 #define SIM_ADCOPT_ADC0SWPRETRG_SHIFT (1U) 261 #define SIM_ADCOPT_ADC0SWPRETRG_WIDTH (3U) 262 #define SIM_ADCOPT_ADC0SWPRETRG(x) (((uint32_t)(((uint32_t)(x)) << SIM_ADCOPT_ADC0SWPRETRG_SHIFT)) & SIM_ADCOPT_ADC0SWPRETRG_MASK) 263 264 #define SIM_ADCOPT_ADC0PRETRGSEL_MASK (0x30U) 265 #define SIM_ADCOPT_ADC0PRETRGSEL_SHIFT (4U) 266 #define SIM_ADCOPT_ADC0PRETRGSEL_WIDTH (2U) 267 #define SIM_ADCOPT_ADC0PRETRGSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_ADCOPT_ADC0PRETRGSEL_SHIFT)) & SIM_ADCOPT_ADC0PRETRGSEL_MASK) 268 269 #define SIM_ADCOPT_ADC1TRGSEL_MASK (0x100U) 270 #define SIM_ADCOPT_ADC1TRGSEL_SHIFT (8U) 271 #define SIM_ADCOPT_ADC1TRGSEL_WIDTH (1U) 272 #define SIM_ADCOPT_ADC1TRGSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_ADCOPT_ADC1TRGSEL_SHIFT)) & SIM_ADCOPT_ADC1TRGSEL_MASK) 273 274 #define SIM_ADCOPT_ADC1SWPRETRG_MASK (0xE00U) 275 #define SIM_ADCOPT_ADC1SWPRETRG_SHIFT (9U) 276 #define SIM_ADCOPT_ADC1SWPRETRG_WIDTH (3U) 277 #define SIM_ADCOPT_ADC1SWPRETRG(x) (((uint32_t)(((uint32_t)(x)) << SIM_ADCOPT_ADC1SWPRETRG_SHIFT)) & SIM_ADCOPT_ADC1SWPRETRG_MASK) 278 279 #define SIM_ADCOPT_ADC1PRETRGSEL_MASK (0x3000U) 280 #define SIM_ADCOPT_ADC1PRETRGSEL_SHIFT (12U) 281 #define SIM_ADCOPT_ADC1PRETRGSEL_WIDTH (2U) 282 #define SIM_ADCOPT_ADC1PRETRGSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_ADCOPT_ADC1PRETRGSEL_SHIFT)) & SIM_ADCOPT_ADC1PRETRGSEL_MASK) 283 /*! @} */ 284 285 /*! @name FTMOPT1 - FTM Option Register 1 */ 286 /*! @{ */ 287 288 #define SIM_FTMOPT1_FTM0SYNCBIT_MASK (0x1U) 289 #define SIM_FTMOPT1_FTM0SYNCBIT_SHIFT (0U) 290 #define SIM_FTMOPT1_FTM0SYNCBIT_WIDTH (1U) 291 #define SIM_FTMOPT1_FTM0SYNCBIT(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM0SYNCBIT_SHIFT)) & SIM_FTMOPT1_FTM0SYNCBIT_MASK) 292 293 #define SIM_FTMOPT1_FTM1SYNCBIT_MASK (0x2U) 294 #define SIM_FTMOPT1_FTM1SYNCBIT_SHIFT (1U) 295 #define SIM_FTMOPT1_FTM1SYNCBIT_WIDTH (1U) 296 #define SIM_FTMOPT1_FTM1SYNCBIT(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM1SYNCBIT_SHIFT)) & SIM_FTMOPT1_FTM1SYNCBIT_MASK) 297 298 #define SIM_FTMOPT1_FTM2SYNCBIT_MASK (0x4U) 299 #define SIM_FTMOPT1_FTM2SYNCBIT_SHIFT (2U) 300 #define SIM_FTMOPT1_FTM2SYNCBIT_WIDTH (1U) 301 #define SIM_FTMOPT1_FTM2SYNCBIT(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM2SYNCBIT_SHIFT)) & SIM_FTMOPT1_FTM2SYNCBIT_MASK) 302 303 #define SIM_FTMOPT1_FTM3SYNCBIT_MASK (0x8U) 304 #define SIM_FTMOPT1_FTM3SYNCBIT_SHIFT (3U) 305 #define SIM_FTMOPT1_FTM3SYNCBIT_WIDTH (1U) 306 #define SIM_FTMOPT1_FTM3SYNCBIT(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM3SYNCBIT_SHIFT)) & SIM_FTMOPT1_FTM3SYNCBIT_MASK) 307 308 #define SIM_FTMOPT1_FTM1CH0SEL_MASK (0x30U) 309 #define SIM_FTMOPT1_FTM1CH0SEL_SHIFT (4U) 310 #define SIM_FTMOPT1_FTM1CH0SEL_WIDTH (2U) 311 #define SIM_FTMOPT1_FTM1CH0SEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM1CH0SEL_SHIFT)) & SIM_FTMOPT1_FTM1CH0SEL_MASK) 312 313 #define SIM_FTMOPT1_FTM2CH0SEL_MASK (0xC0U) 314 #define SIM_FTMOPT1_FTM2CH0SEL_SHIFT (6U) 315 #define SIM_FTMOPT1_FTM2CH0SEL_WIDTH (2U) 316 #define SIM_FTMOPT1_FTM2CH0SEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM2CH0SEL_SHIFT)) & SIM_FTMOPT1_FTM2CH0SEL_MASK) 317 318 #define SIM_FTMOPT1_FTM2CH1SEL_MASK (0x100U) 319 #define SIM_FTMOPT1_FTM2CH1SEL_SHIFT (8U) 320 #define SIM_FTMOPT1_FTM2CH1SEL_WIDTH (1U) 321 #define SIM_FTMOPT1_FTM2CH1SEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM2CH1SEL_SHIFT)) & SIM_FTMOPT1_FTM2CH1SEL_MASK) 322 323 #define SIM_FTMOPT1_FTM4SYNCBIT_MASK (0x800U) 324 #define SIM_FTMOPT1_FTM4SYNCBIT_SHIFT (11U) 325 #define SIM_FTMOPT1_FTM4SYNCBIT_WIDTH (1U) 326 #define SIM_FTMOPT1_FTM4SYNCBIT(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM4SYNCBIT_SHIFT)) & SIM_FTMOPT1_FTM4SYNCBIT_MASK) 327 328 #define SIM_FTMOPT1_FTM5SYNCBIT_MASK (0x1000U) 329 #define SIM_FTMOPT1_FTM5SYNCBIT_SHIFT (12U) 330 #define SIM_FTMOPT1_FTM5SYNCBIT_WIDTH (1U) 331 #define SIM_FTMOPT1_FTM5SYNCBIT(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM5SYNCBIT_SHIFT)) & SIM_FTMOPT1_FTM5SYNCBIT_MASK) 332 333 #define SIM_FTMOPT1_FTMGLDOK_MASK (0x8000U) 334 #define SIM_FTMOPT1_FTMGLDOK_SHIFT (15U) 335 #define SIM_FTMOPT1_FTMGLDOK_WIDTH (1U) 336 #define SIM_FTMOPT1_FTMGLDOK(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTMGLDOK_SHIFT)) & SIM_FTMOPT1_FTMGLDOK_MASK) 337 338 #define SIM_FTMOPT1_FTM0_OUTSEL_MASK (0xFF0000U) 339 #define SIM_FTMOPT1_FTM0_OUTSEL_SHIFT (16U) 340 #define SIM_FTMOPT1_FTM0_OUTSEL_WIDTH (8U) 341 #define SIM_FTMOPT1_FTM0_OUTSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM0_OUTSEL_SHIFT)) & SIM_FTMOPT1_FTM0_OUTSEL_MASK) 342 343 #define SIM_FTMOPT1_FTM3_OUTSEL_MASK (0xFF000000U) 344 #define SIM_FTMOPT1_FTM3_OUTSEL_SHIFT (24U) 345 #define SIM_FTMOPT1_FTM3_OUTSEL_WIDTH (8U) 346 #define SIM_FTMOPT1_FTM3_OUTSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_FTMOPT1_FTM3_OUTSEL_SHIFT)) & SIM_FTMOPT1_FTM3_OUTSEL_MASK) 347 /*! @} */ 348 349 /*! @name MISCTRL0 - Miscellaneous control register 0 */ 350 /*! @{ */ 351 352 #define SIM_MISCTRL0_STOP1_MONITOR_MASK (0x200U) 353 #define SIM_MISCTRL0_STOP1_MONITOR_SHIFT (9U) 354 #define SIM_MISCTRL0_STOP1_MONITOR_WIDTH (1U) 355 #define SIM_MISCTRL0_STOP1_MONITOR(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_STOP1_MONITOR_SHIFT)) & SIM_MISCTRL0_STOP1_MONITOR_MASK) 356 357 #define SIM_MISCTRL0_STOP2_MONITOR_MASK (0x400U) 358 #define SIM_MISCTRL0_STOP2_MONITOR_SHIFT (10U) 359 #define SIM_MISCTRL0_STOP2_MONITOR_WIDTH (1U) 360 #define SIM_MISCTRL0_STOP2_MONITOR(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_STOP2_MONITOR_SHIFT)) & SIM_MISCTRL0_STOP2_MONITOR_MASK) 361 362 #define SIM_MISCTRL0_FTM_GTB_SPLIT_EN_MASK (0x4000U) 363 #define SIM_MISCTRL0_FTM_GTB_SPLIT_EN_SHIFT (14U) 364 #define SIM_MISCTRL0_FTM_GTB_SPLIT_EN_WIDTH (1U) 365 #define SIM_MISCTRL0_FTM_GTB_SPLIT_EN(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM_GTB_SPLIT_EN_SHIFT)) & SIM_MISCTRL0_FTM_GTB_SPLIT_EN_MASK) 366 367 #define SIM_MISCTRL0_FTM0_OBE_CTRL_MASK (0x10000U) 368 #define SIM_MISCTRL0_FTM0_OBE_CTRL_SHIFT (16U) 369 #define SIM_MISCTRL0_FTM0_OBE_CTRL_WIDTH (1U) 370 #define SIM_MISCTRL0_FTM0_OBE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM0_OBE_CTRL_SHIFT)) & SIM_MISCTRL0_FTM0_OBE_CTRL_MASK) 371 372 #define SIM_MISCTRL0_FTM1_OBE_CTRL_MASK (0x20000U) 373 #define SIM_MISCTRL0_FTM1_OBE_CTRL_SHIFT (17U) 374 #define SIM_MISCTRL0_FTM1_OBE_CTRL_WIDTH (1U) 375 #define SIM_MISCTRL0_FTM1_OBE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM1_OBE_CTRL_SHIFT)) & SIM_MISCTRL0_FTM1_OBE_CTRL_MASK) 376 377 #define SIM_MISCTRL0_FTM2_OBE_CTRL_MASK (0x40000U) 378 #define SIM_MISCTRL0_FTM2_OBE_CTRL_SHIFT (18U) 379 #define SIM_MISCTRL0_FTM2_OBE_CTRL_WIDTH (1U) 380 #define SIM_MISCTRL0_FTM2_OBE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM2_OBE_CTRL_SHIFT)) & SIM_MISCTRL0_FTM2_OBE_CTRL_MASK) 381 382 #define SIM_MISCTRL0_FTM3_OBE_CTRL_MASK (0x80000U) 383 #define SIM_MISCTRL0_FTM3_OBE_CTRL_SHIFT (19U) 384 #define SIM_MISCTRL0_FTM3_OBE_CTRL_WIDTH (1U) 385 #define SIM_MISCTRL0_FTM3_OBE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM3_OBE_CTRL_SHIFT)) & SIM_MISCTRL0_FTM3_OBE_CTRL_MASK) 386 387 #define SIM_MISCTRL0_FTM4_OBE_CTRL_MASK (0x100000U) 388 #define SIM_MISCTRL0_FTM4_OBE_CTRL_SHIFT (20U) 389 #define SIM_MISCTRL0_FTM4_OBE_CTRL_WIDTH (1U) 390 #define SIM_MISCTRL0_FTM4_OBE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM4_OBE_CTRL_SHIFT)) & SIM_MISCTRL0_FTM4_OBE_CTRL_MASK) 391 392 #define SIM_MISCTRL0_FTM5_OBE_CTRL_MASK (0x200000U) 393 #define SIM_MISCTRL0_FTM5_OBE_CTRL_SHIFT (21U) 394 #define SIM_MISCTRL0_FTM5_OBE_CTRL_WIDTH (1U) 395 #define SIM_MISCTRL0_FTM5_OBE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM5_OBE_CTRL_SHIFT)) & SIM_MISCTRL0_FTM5_OBE_CTRL_MASK) 396 397 #define SIM_MISCTRL0_FTM6_OBE_CTRL_MASK (0x400000U) 398 #define SIM_MISCTRL0_FTM6_OBE_CTRL_SHIFT (22U) 399 #define SIM_MISCTRL0_FTM6_OBE_CTRL_WIDTH (1U) 400 #define SIM_MISCTRL0_FTM6_OBE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM6_OBE_CTRL_SHIFT)) & SIM_MISCTRL0_FTM6_OBE_CTRL_MASK) 401 402 #define SIM_MISCTRL0_FTM7_OBE_CTRL_MASK (0x800000U) 403 #define SIM_MISCTRL0_FTM7_OBE_CTRL_SHIFT (23U) 404 #define SIM_MISCTRL0_FTM7_OBE_CTRL_WIDTH (1U) 405 #define SIM_MISCTRL0_FTM7_OBE_CTRL(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL0_FTM7_OBE_CTRL_SHIFT)) & SIM_MISCTRL0_FTM7_OBE_CTRL_MASK) 406 /*! @} */ 407 408 /*! @name SDID - System Device Identification Register */ 409 /*! @{ */ 410 411 #define SIM_SDID_FEATURES_MASK (0xFFU) 412 #define SIM_SDID_FEATURES_SHIFT (0U) 413 #define SIM_SDID_FEATURES_WIDTH (8U) 414 #define SIM_SDID_FEATURES(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_FEATURES_SHIFT)) & SIM_SDID_FEATURES_MASK) 415 416 #define SIM_SDID_PACKAGE_MASK (0xF00U) 417 #define SIM_SDID_PACKAGE_SHIFT (8U) 418 #define SIM_SDID_PACKAGE_WIDTH (4U) 419 #define SIM_SDID_PACKAGE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_PACKAGE_SHIFT)) & SIM_SDID_PACKAGE_MASK) 420 421 #define SIM_SDID_REVID_MASK (0xF000U) 422 #define SIM_SDID_REVID_SHIFT (12U) 423 #define SIM_SDID_REVID_WIDTH (4U) 424 #define SIM_SDID_REVID(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_REVID_SHIFT)) & SIM_SDID_REVID_MASK) 425 426 #define SIM_SDID_RAMSIZE_MASK (0xF0000U) 427 #define SIM_SDID_RAMSIZE_SHIFT (16U) 428 #define SIM_SDID_RAMSIZE_WIDTH (4U) 429 #define SIM_SDID_RAMSIZE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_RAMSIZE_SHIFT)) & SIM_SDID_RAMSIZE_MASK) 430 431 #define SIM_SDID_DERIVATE_MASK (0xF00000U) 432 #define SIM_SDID_DERIVATE_SHIFT (20U) 433 #define SIM_SDID_DERIVATE_WIDTH (4U) 434 #define SIM_SDID_DERIVATE(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_DERIVATE_SHIFT)) & SIM_SDID_DERIVATE_MASK) 435 436 #define SIM_SDID_SUBSERIES_MASK (0xF000000U) 437 #define SIM_SDID_SUBSERIES_SHIFT (24U) 438 #define SIM_SDID_SUBSERIES_WIDTH (4U) 439 #define SIM_SDID_SUBSERIES(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_SUBSERIES_SHIFT)) & SIM_SDID_SUBSERIES_MASK) 440 441 #define SIM_SDID_GENERATION_MASK (0xF0000000U) 442 #define SIM_SDID_GENERATION_SHIFT (28U) 443 #define SIM_SDID_GENERATION_WIDTH (4U) 444 #define SIM_SDID_GENERATION(x) (((uint32_t)(((uint32_t)(x)) << SIM_SDID_GENERATION_SHIFT)) & SIM_SDID_GENERATION_MASK) 445 /*! @} */ 446 447 /*! @name PLATCGC - Platform Clock Gating Control Register */ 448 /*! @{ */ 449 450 #define SIM_PLATCGC_CGCMSCM_MASK (0x1U) 451 #define SIM_PLATCGC_CGCMSCM_SHIFT (0U) 452 #define SIM_PLATCGC_CGCMSCM_WIDTH (1U) 453 #define SIM_PLATCGC_CGCMSCM(x) (((uint32_t)(((uint32_t)(x)) << SIM_PLATCGC_CGCMSCM_SHIFT)) & SIM_PLATCGC_CGCMSCM_MASK) 454 455 #define SIM_PLATCGC_CGCMPU_MASK (0x2U) 456 #define SIM_PLATCGC_CGCMPU_SHIFT (1U) 457 #define SIM_PLATCGC_CGCMPU_WIDTH (1U) 458 #define SIM_PLATCGC_CGCMPU(x) (((uint32_t)(((uint32_t)(x)) << SIM_PLATCGC_CGCMPU_SHIFT)) & SIM_PLATCGC_CGCMPU_MASK) 459 460 #define SIM_PLATCGC_CGCDMA_MASK (0x4U) 461 #define SIM_PLATCGC_CGCDMA_SHIFT (2U) 462 #define SIM_PLATCGC_CGCDMA_WIDTH (1U) 463 #define SIM_PLATCGC_CGCDMA(x) (((uint32_t)(((uint32_t)(x)) << SIM_PLATCGC_CGCDMA_SHIFT)) & SIM_PLATCGC_CGCDMA_MASK) 464 465 #define SIM_PLATCGC_CGCERM_MASK (0x8U) 466 #define SIM_PLATCGC_CGCERM_SHIFT (3U) 467 #define SIM_PLATCGC_CGCERM_WIDTH (1U) 468 #define SIM_PLATCGC_CGCERM(x) (((uint32_t)(((uint32_t)(x)) << SIM_PLATCGC_CGCERM_SHIFT)) & SIM_PLATCGC_CGCERM_MASK) 469 470 #define SIM_PLATCGC_CGCEIM_MASK (0x10U) 471 #define SIM_PLATCGC_CGCEIM_SHIFT (4U) 472 #define SIM_PLATCGC_CGCEIM_WIDTH (1U) 473 #define SIM_PLATCGC_CGCEIM(x) (((uint32_t)(((uint32_t)(x)) << SIM_PLATCGC_CGCEIM_SHIFT)) & SIM_PLATCGC_CGCEIM_MASK) 474 /*! @} */ 475 476 /*! @name FCFG1 - Flash Configuration Register 1 */ 477 /*! @{ */ 478 479 #define SIM_FCFG1_DEPART_MASK (0xF000U) 480 #define SIM_FCFG1_DEPART_SHIFT (12U) 481 #define SIM_FCFG1_DEPART_WIDTH (4U) 482 #define SIM_FCFG1_DEPART(x) (((uint32_t)(((uint32_t)(x)) << SIM_FCFG1_DEPART_SHIFT)) & SIM_FCFG1_DEPART_MASK) 483 484 #define SIM_FCFG1_EEERAMSIZE_MASK (0xF0000U) 485 #define SIM_FCFG1_EEERAMSIZE_SHIFT (16U) 486 #define SIM_FCFG1_EEERAMSIZE_WIDTH (4U) 487 #define SIM_FCFG1_EEERAMSIZE(x) (((uint32_t)(((uint32_t)(x)) << SIM_FCFG1_EEERAMSIZE_SHIFT)) & SIM_FCFG1_EEERAMSIZE_MASK) 488 /*! @} */ 489 490 /*! @name UIDH - Unique Identification Register High */ 491 /*! @{ */ 492 493 #define SIM_UIDH_UID127_96_MASK (0xFFFFFFFFU) 494 #define SIM_UIDH_UID127_96_SHIFT (0U) 495 #define SIM_UIDH_UID127_96_WIDTH (32U) 496 #define SIM_UIDH_UID127_96(x) (((uint32_t)(((uint32_t)(x)) << SIM_UIDH_UID127_96_SHIFT)) & SIM_UIDH_UID127_96_MASK) 497 /*! @} */ 498 499 /*! @name UIDMH - Unique Identification Register Mid-High */ 500 /*! @{ */ 501 502 #define SIM_UIDMH_UID95_64_MASK (0xFFFFFFFFU) 503 #define SIM_UIDMH_UID95_64_SHIFT (0U) 504 #define SIM_UIDMH_UID95_64_WIDTH (32U) 505 #define SIM_UIDMH_UID95_64(x) (((uint32_t)(((uint32_t)(x)) << SIM_UIDMH_UID95_64_SHIFT)) & SIM_UIDMH_UID95_64_MASK) 506 /*! @} */ 507 508 /*! @name UIDML - Unique Identification Register Mid Low */ 509 /*! @{ */ 510 511 #define SIM_UIDML_UID63_32_MASK (0xFFFFFFFFU) 512 #define SIM_UIDML_UID63_32_SHIFT (0U) 513 #define SIM_UIDML_UID63_32_WIDTH (32U) 514 #define SIM_UIDML_UID63_32(x) (((uint32_t)(((uint32_t)(x)) << SIM_UIDML_UID63_32_SHIFT)) & SIM_UIDML_UID63_32_MASK) 515 /*! @} */ 516 517 /*! @name UIDL - Unique Identification Register Low */ 518 /*! @{ */ 519 520 #define SIM_UIDL_UID31_0_MASK (0xFFFFFFFFU) 521 #define SIM_UIDL_UID31_0_SHIFT (0U) 522 #define SIM_UIDL_UID31_0_WIDTH (32U) 523 #define SIM_UIDL_UID31_0(x) (((uint32_t)(((uint32_t)(x)) << SIM_UIDL_UID31_0_SHIFT)) & SIM_UIDL_UID31_0_MASK) 524 /*! @} */ 525 526 /*! @name CLKDIV4 - System Clock Divider Register 4 */ 527 /*! @{ */ 528 529 #define SIM_CLKDIV4_TRACEFRAC_MASK (0x1U) 530 #define SIM_CLKDIV4_TRACEFRAC_SHIFT (0U) 531 #define SIM_CLKDIV4_TRACEFRAC_WIDTH (1U) 532 #define SIM_CLKDIV4_TRACEFRAC(x) (((uint32_t)(((uint32_t)(x)) << SIM_CLKDIV4_TRACEFRAC_SHIFT)) & SIM_CLKDIV4_TRACEFRAC_MASK) 533 534 #define SIM_CLKDIV4_TRACEDIV_MASK (0xEU) 535 #define SIM_CLKDIV4_TRACEDIV_SHIFT (1U) 536 #define SIM_CLKDIV4_TRACEDIV_WIDTH (3U) 537 #define SIM_CLKDIV4_TRACEDIV(x) (((uint32_t)(((uint32_t)(x)) << SIM_CLKDIV4_TRACEDIV_SHIFT)) & SIM_CLKDIV4_TRACEDIV_MASK) 538 539 #define SIM_CLKDIV4_TRACEDIVEN_MASK (0x10000000U) 540 #define SIM_CLKDIV4_TRACEDIVEN_SHIFT (28U) 541 #define SIM_CLKDIV4_TRACEDIVEN_WIDTH (1U) 542 #define SIM_CLKDIV4_TRACEDIVEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_CLKDIV4_TRACEDIVEN_SHIFT)) & SIM_CLKDIV4_TRACEDIVEN_MASK) 543 /*! @} */ 544 545 /*! @name MISCTRL1 - Miscellaneous Control register 1 */ 546 /*! @{ */ 547 548 #define SIM_MISCTRL1_SW_TRG_MASK (0x1U) 549 #define SIM_MISCTRL1_SW_TRG_SHIFT (0U) 550 #define SIM_MISCTRL1_SW_TRG_WIDTH (1U) 551 #define SIM_MISCTRL1_SW_TRG(x) (((uint32_t)(((uint32_t)(x)) << SIM_MISCTRL1_SW_TRG_SHIFT)) & SIM_MISCTRL1_SW_TRG_MASK) 552 /*! @} */ 553 554 /*! 555 * @} 556 */ /* end of group SIM_Register_Masks */ 557 558 /*! 559 * @} 560 */ /* end of group SIM_Peripheral_Access_Layer */ 561 562 #endif /* #if !defined(S32K146_SIM_H_) */ 563