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_FTM.h 10 * @version 1.1 11 * @date 2022-01-31 12 * @brief Peripheral Access Layer for S32K146_FTM 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_FTM_H_) /* Check if memory map has not been already included */ 58 #define S32K146_FTM_H_ 59 60 #include "S32K146_COMMON.h" 61 62 /* ---------------------------------------------------------------------------- 63 -- FTM Peripheral Access Layer 64 ---------------------------------------------------------------------------- */ 65 66 /*! 67 * @addtogroup FTM_Peripheral_Access_Layer FTM Peripheral Access Layer 68 * @{ 69 */ 70 71 /** FTM - Size of Registers Arrays */ 72 #define FTM_CnSC_COUNT 8u 73 #define FTM_CV_MIRROR_COUNT 8u 74 75 /** FTM - Register Layout Typedef */ 76 typedef struct { 77 __IO uint32_t SC; /**< Status And Control, offset: 0x0 */ 78 __IO uint32_t CNT; /**< Counter, offset: 0x4 */ 79 __IO uint32_t MOD; /**< Modulo, offset: 0x8 */ 80 struct { /* offset: 0xC, array step: 0x8 */ 81 __IO uint32_t CnSC; /**< Channel (n) Status And Control, array offset: 0xC, array step: 0x8 */ 82 __IO uint32_t CnV; /**< Channel (n) Value, array offset: 0x10, array step: 0x8 */ 83 } CONTROLS[FTM_CnSC_COUNT]; 84 __IO uint32_t CNTIN; /**< Counter Initial Value, offset: 0x4C */ 85 __IO uint32_t STATUS; /**< Capture And Compare Status, offset: 0x50 */ 86 __IO uint32_t MODE; /**< Features Mode Selection, offset: 0x54 */ 87 __IO uint32_t SYNC; /**< Synchronization, offset: 0x58 */ 88 __IO uint32_t OUTINIT; /**< Initial State For Channels Output, offset: 0x5C */ 89 __IO uint32_t OUTMASK; /**< Output Mask, offset: 0x60 */ 90 __IO uint32_t COMBINE; /**< Function For Linked Channels, offset: 0x64 */ 91 __IO uint32_t DEADTIME; /**< Deadtime Configuration, offset: 0x68 */ 92 __IO uint32_t EXTTRIG; /**< FTM External Trigger, offset: 0x6C */ 93 __IO uint32_t POL; /**< Channels Polarity, offset: 0x70 */ 94 __IO uint32_t FMS; /**< Fault Mode Status, offset: 0x74 */ 95 __IO uint32_t FILTER; /**< Input Capture Filter Control, offset: 0x78 */ 96 __IO uint32_t FLTCTRL; /**< Fault Control, offset: 0x7C */ 97 __IO uint32_t QDCTRL; /**< Quadrature Decoder Control And Status, offset: 0x80 */ 98 __IO uint32_t CONF; /**< Configuration, offset: 0x84 */ 99 __IO uint32_t FLTPOL; /**< FTM Fault Input Polarity, offset: 0x88 */ 100 __IO uint32_t SYNCONF; /**< Synchronization Configuration, offset: 0x8C */ 101 __IO uint32_t INVCTRL; /**< FTM Inverting Control, offset: 0x90 */ 102 __IO uint32_t SWOCTRL; /**< FTM Software Output Control, offset: 0x94 */ 103 __IO uint32_t PWMLOAD; /**< FTM PWM Load, offset: 0x98 */ 104 __IO uint32_t HCR; /**< Half Cycle Register, offset: 0x9C */ 105 __IO uint32_t PAIR0DEADTIME; /**< Pair 0 Deadtime Configuration, offset: 0xA0 */ 106 uint8_t RESERVED_0[4]; 107 __IO uint32_t PAIR1DEADTIME; /**< Pair 1 Deadtime Configuration, offset: 0xA8 */ 108 uint8_t RESERVED_1[4]; 109 __IO uint32_t PAIR2DEADTIME; /**< Pair 2 Deadtime Configuration, offset: 0xB0 */ 110 uint8_t RESERVED_2[4]; 111 __IO uint32_t PAIR3DEADTIME; /**< Pair 3 Deadtime Configuration, offset: 0xB8 */ 112 uint8_t RESERVED_3[324]; 113 __IO uint32_t MOD_MIRROR; /**< Mirror of Modulo Value, offset: 0x200 */ 114 __IO uint32_t CV_MIRROR[FTM_CV_MIRROR_COUNT]; /**< Mirror of Channel (n) Match Value, array offset: 0x204, array step: 0x4 */ 115 } FTM_Type, *FTM_MemMapPtr; 116 117 /** Number of instances of the FTM module. */ 118 #define FTM_INSTANCE_COUNT (6u) 119 120 /* FTM - Peripheral instance base addresses */ 121 /** Peripheral FTM0 base address */ 122 #define IP_FTM0_BASE (0x40038000u) 123 /** Peripheral FTM0 base pointer */ 124 #define IP_FTM0 ((FTM_Type *)IP_FTM0_BASE) 125 /** Peripheral FTM1 base address */ 126 #define IP_FTM1_BASE (0x40039000u) 127 /** Peripheral FTM1 base pointer */ 128 #define IP_FTM1 ((FTM_Type *)IP_FTM1_BASE) 129 /** Peripheral FTM2 base address */ 130 #define IP_FTM2_BASE (0x4003A000u) 131 /** Peripheral FTM2 base pointer */ 132 #define IP_FTM2 ((FTM_Type *)IP_FTM2_BASE) 133 /** Peripheral FTM3 base address */ 134 #define IP_FTM3_BASE (0x40026000u) 135 /** Peripheral FTM3 base pointer */ 136 #define IP_FTM3 ((FTM_Type *)IP_FTM3_BASE) 137 /** Peripheral FTM4 base address */ 138 #define IP_FTM4_BASE (0x4006E000u) 139 /** Peripheral FTM4 base pointer */ 140 #define IP_FTM4 ((FTM_Type *)IP_FTM4_BASE) 141 /** Peripheral FTM5 base address */ 142 #define IP_FTM5_BASE (0x4006F000u) 143 /** Peripheral FTM5 base pointer */ 144 #define IP_FTM5 ((FTM_Type *)IP_FTM5_BASE) 145 /** Array initializer of FTM peripheral base addresses */ 146 #define IP_FTM_BASE_ADDRS { IP_FTM0_BASE, IP_FTM1_BASE, IP_FTM2_BASE, IP_FTM3_BASE, IP_FTM4_BASE, IP_FTM5_BASE } 147 /** Array initializer of FTM peripheral base pointers */ 148 #define IP_FTM_BASE_PTRS { IP_FTM0, IP_FTM1, IP_FTM2, IP_FTM3, IP_FTM4, IP_FTM5 } 149 150 /* ---------------------------------------------------------------------------- 151 -- FTM Register Masks 152 ---------------------------------------------------------------------------- */ 153 154 /*! 155 * @addtogroup FTM_Register_Masks FTM Register Masks 156 * @{ 157 */ 158 159 /*! @name SC - Status And Control */ 160 /*! @{ */ 161 162 #define FTM_SC_PS_MASK (0x7U) 163 #define FTM_SC_PS_SHIFT (0U) 164 #define FTM_SC_PS_WIDTH (3U) 165 #define FTM_SC_PS(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PS_SHIFT)) & FTM_SC_PS_MASK) 166 167 #define FTM_SC_CLKS_MASK (0x18U) 168 #define FTM_SC_CLKS_SHIFT (3U) 169 #define FTM_SC_CLKS_WIDTH (2U) 170 #define FTM_SC_CLKS(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_CLKS_SHIFT)) & FTM_SC_CLKS_MASK) 171 172 #define FTM_SC_CPWMS_MASK (0x20U) 173 #define FTM_SC_CPWMS_SHIFT (5U) 174 #define FTM_SC_CPWMS_WIDTH (1U) 175 #define FTM_SC_CPWMS(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_CPWMS_SHIFT)) & FTM_SC_CPWMS_MASK) 176 177 #define FTM_SC_RIE_MASK (0x40U) 178 #define FTM_SC_RIE_SHIFT (6U) 179 #define FTM_SC_RIE_WIDTH (1U) 180 #define FTM_SC_RIE(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_RIE_SHIFT)) & FTM_SC_RIE_MASK) 181 182 #define FTM_SC_RF_MASK (0x80U) 183 #define FTM_SC_RF_SHIFT (7U) 184 #define FTM_SC_RF_WIDTH (1U) 185 #define FTM_SC_RF(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_RF_SHIFT)) & FTM_SC_RF_MASK) 186 187 #define FTM_SC_TOIE_MASK (0x100U) 188 #define FTM_SC_TOIE_SHIFT (8U) 189 #define FTM_SC_TOIE_WIDTH (1U) 190 #define FTM_SC_TOIE(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_TOIE_SHIFT)) & FTM_SC_TOIE_MASK) 191 192 #define FTM_SC_TOF_MASK (0x200U) 193 #define FTM_SC_TOF_SHIFT (9U) 194 #define FTM_SC_TOF_WIDTH (1U) 195 #define FTM_SC_TOF(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_TOF_SHIFT)) & FTM_SC_TOF_MASK) 196 197 #define FTM_SC_PWMEN0_MASK (0x10000U) 198 #define FTM_SC_PWMEN0_SHIFT (16U) 199 #define FTM_SC_PWMEN0_WIDTH (1U) 200 #define FTM_SC_PWMEN0(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PWMEN0_SHIFT)) & FTM_SC_PWMEN0_MASK) 201 202 #define FTM_SC_PWMEN1_MASK (0x20000U) 203 #define FTM_SC_PWMEN1_SHIFT (17U) 204 #define FTM_SC_PWMEN1_WIDTH (1U) 205 #define FTM_SC_PWMEN1(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PWMEN1_SHIFT)) & FTM_SC_PWMEN1_MASK) 206 207 #define FTM_SC_PWMEN2_MASK (0x40000U) 208 #define FTM_SC_PWMEN2_SHIFT (18U) 209 #define FTM_SC_PWMEN2_WIDTH (1U) 210 #define FTM_SC_PWMEN2(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PWMEN2_SHIFT)) & FTM_SC_PWMEN2_MASK) 211 212 #define FTM_SC_PWMEN3_MASK (0x80000U) 213 #define FTM_SC_PWMEN3_SHIFT (19U) 214 #define FTM_SC_PWMEN3_WIDTH (1U) 215 #define FTM_SC_PWMEN3(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PWMEN3_SHIFT)) & FTM_SC_PWMEN3_MASK) 216 217 #define FTM_SC_PWMEN4_MASK (0x100000U) 218 #define FTM_SC_PWMEN4_SHIFT (20U) 219 #define FTM_SC_PWMEN4_WIDTH (1U) 220 #define FTM_SC_PWMEN4(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PWMEN4_SHIFT)) & FTM_SC_PWMEN4_MASK) 221 222 #define FTM_SC_PWMEN5_MASK (0x200000U) 223 #define FTM_SC_PWMEN5_SHIFT (21U) 224 #define FTM_SC_PWMEN5_WIDTH (1U) 225 #define FTM_SC_PWMEN5(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PWMEN5_SHIFT)) & FTM_SC_PWMEN5_MASK) 226 227 #define FTM_SC_PWMEN6_MASK (0x400000U) 228 #define FTM_SC_PWMEN6_SHIFT (22U) 229 #define FTM_SC_PWMEN6_WIDTH (1U) 230 #define FTM_SC_PWMEN6(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PWMEN6_SHIFT)) & FTM_SC_PWMEN6_MASK) 231 232 #define FTM_SC_PWMEN7_MASK (0x800000U) 233 #define FTM_SC_PWMEN7_SHIFT (23U) 234 #define FTM_SC_PWMEN7_WIDTH (1U) 235 #define FTM_SC_PWMEN7(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_PWMEN7_SHIFT)) & FTM_SC_PWMEN7_MASK) 236 237 #define FTM_SC_FLTPS_MASK (0xF000000U) 238 #define FTM_SC_FLTPS_SHIFT (24U) 239 #define FTM_SC_FLTPS_WIDTH (4U) 240 #define FTM_SC_FLTPS(x) (((uint32_t)(((uint32_t)(x)) << FTM_SC_FLTPS_SHIFT)) & FTM_SC_FLTPS_MASK) 241 /*! @} */ 242 243 /*! @name CNT - Counter */ 244 /*! @{ */ 245 246 #define FTM_CNT_COUNT_MASK (0xFFFFU) 247 #define FTM_CNT_COUNT_SHIFT (0U) 248 #define FTM_CNT_COUNT_WIDTH (16U) 249 #define FTM_CNT_COUNT(x) (((uint32_t)(((uint32_t)(x)) << FTM_CNT_COUNT_SHIFT)) & FTM_CNT_COUNT_MASK) 250 /*! @} */ 251 252 /*! @name MOD - Modulo */ 253 /*! @{ */ 254 255 #define FTM_MOD_MOD_MASK (0xFFFFU) 256 #define FTM_MOD_MOD_SHIFT (0U) 257 #define FTM_MOD_MOD_WIDTH (16U) 258 #define FTM_MOD_MOD(x) (((uint32_t)(((uint32_t)(x)) << FTM_MOD_MOD_SHIFT)) & FTM_MOD_MOD_MASK) 259 /*! @} */ 260 261 /*! @name CnSC - Channel (n) Status And Control */ 262 /*! @{ */ 263 264 #define FTM_CnSC_DMA_MASK (0x1U) 265 #define FTM_CnSC_DMA_SHIFT (0U) 266 #define FTM_CnSC_DMA_WIDTH (1U) 267 #define FTM_CnSC_DMA(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_DMA_SHIFT)) & FTM_CnSC_DMA_MASK) 268 269 #define FTM_CnSC_ICRST_MASK (0x2U) 270 #define FTM_CnSC_ICRST_SHIFT (1U) 271 #define FTM_CnSC_ICRST_WIDTH (1U) 272 #define FTM_CnSC_ICRST(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_ICRST_SHIFT)) & FTM_CnSC_ICRST_MASK) 273 274 #define FTM_CnSC_ELSA_MASK (0x4U) 275 #define FTM_CnSC_ELSA_SHIFT (2U) 276 #define FTM_CnSC_ELSA_WIDTH (1U) 277 #define FTM_CnSC_ELSA(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_ELSA_SHIFT)) & FTM_CnSC_ELSA_MASK) 278 279 #define FTM_CnSC_ELSB_MASK (0x8U) 280 #define FTM_CnSC_ELSB_SHIFT (3U) 281 #define FTM_CnSC_ELSB_WIDTH (1U) 282 #define FTM_CnSC_ELSB(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_ELSB_SHIFT)) & FTM_CnSC_ELSB_MASK) 283 284 #define FTM_CnSC_MSA_MASK (0x10U) 285 #define FTM_CnSC_MSA_SHIFT (4U) 286 #define FTM_CnSC_MSA_WIDTH (1U) 287 #define FTM_CnSC_MSA(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_MSA_SHIFT)) & FTM_CnSC_MSA_MASK) 288 289 #define FTM_CnSC_MSB_MASK (0x20U) 290 #define FTM_CnSC_MSB_SHIFT (5U) 291 #define FTM_CnSC_MSB_WIDTH (1U) 292 #define FTM_CnSC_MSB(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_MSB_SHIFT)) & FTM_CnSC_MSB_MASK) 293 294 #define FTM_CnSC_CHIE_MASK (0x40U) 295 #define FTM_CnSC_CHIE_SHIFT (6U) 296 #define FTM_CnSC_CHIE_WIDTH (1U) 297 #define FTM_CnSC_CHIE(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_CHIE_SHIFT)) & FTM_CnSC_CHIE_MASK) 298 299 #define FTM_CnSC_CHF_MASK (0x80U) 300 #define FTM_CnSC_CHF_SHIFT (7U) 301 #define FTM_CnSC_CHF_WIDTH (1U) 302 #define FTM_CnSC_CHF(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_CHF_SHIFT)) & FTM_CnSC_CHF_MASK) 303 304 #define FTM_CnSC_TRIGMODE_MASK (0x100U) 305 #define FTM_CnSC_TRIGMODE_SHIFT (8U) 306 #define FTM_CnSC_TRIGMODE_WIDTH (1U) 307 #define FTM_CnSC_TRIGMODE(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_TRIGMODE_SHIFT)) & FTM_CnSC_TRIGMODE_MASK) 308 309 #define FTM_CnSC_CHIS_MASK (0x200U) 310 #define FTM_CnSC_CHIS_SHIFT (9U) 311 #define FTM_CnSC_CHIS_WIDTH (1U) 312 #define FTM_CnSC_CHIS(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_CHIS_SHIFT)) & FTM_CnSC_CHIS_MASK) 313 314 #define FTM_CnSC_CHOV_MASK (0x400U) 315 #define FTM_CnSC_CHOV_SHIFT (10U) 316 #define FTM_CnSC_CHOV_WIDTH (1U) 317 #define FTM_CnSC_CHOV(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnSC_CHOV_SHIFT)) & FTM_CnSC_CHOV_MASK) 318 /*! @} */ 319 320 /*! @name CnV - Channel (n) Value */ 321 /*! @{ */ 322 323 #define FTM_CnV_VAL_MASK (0xFFFFU) 324 #define FTM_CnV_VAL_SHIFT (0U) 325 #define FTM_CnV_VAL_WIDTH (16U) 326 #define FTM_CnV_VAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_CnV_VAL_SHIFT)) & FTM_CnV_VAL_MASK) 327 /*! @} */ 328 329 /*! @name CNTIN - Counter Initial Value */ 330 /*! @{ */ 331 332 #define FTM_CNTIN_INIT_MASK (0xFFFFU) 333 #define FTM_CNTIN_INIT_SHIFT (0U) 334 #define FTM_CNTIN_INIT_WIDTH (16U) 335 #define FTM_CNTIN_INIT(x) (((uint32_t)(((uint32_t)(x)) << FTM_CNTIN_INIT_SHIFT)) & FTM_CNTIN_INIT_MASK) 336 /*! @} */ 337 338 /*! @name STATUS - Capture And Compare Status */ 339 /*! @{ */ 340 341 #define FTM_STATUS_CH0F_MASK (0x1U) 342 #define FTM_STATUS_CH0F_SHIFT (0U) 343 #define FTM_STATUS_CH0F_WIDTH (1U) 344 #define FTM_STATUS_CH0F(x) (((uint32_t)(((uint32_t)(x)) << FTM_STATUS_CH0F_SHIFT)) & FTM_STATUS_CH0F_MASK) 345 346 #define FTM_STATUS_CH1F_MASK (0x2U) 347 #define FTM_STATUS_CH1F_SHIFT (1U) 348 #define FTM_STATUS_CH1F_WIDTH (1U) 349 #define FTM_STATUS_CH1F(x) (((uint32_t)(((uint32_t)(x)) << FTM_STATUS_CH1F_SHIFT)) & FTM_STATUS_CH1F_MASK) 350 351 #define FTM_STATUS_CH2F_MASK (0x4U) 352 #define FTM_STATUS_CH2F_SHIFT (2U) 353 #define FTM_STATUS_CH2F_WIDTH (1U) 354 #define FTM_STATUS_CH2F(x) (((uint32_t)(((uint32_t)(x)) << FTM_STATUS_CH2F_SHIFT)) & FTM_STATUS_CH2F_MASK) 355 356 #define FTM_STATUS_CH3F_MASK (0x8U) 357 #define FTM_STATUS_CH3F_SHIFT (3U) 358 #define FTM_STATUS_CH3F_WIDTH (1U) 359 #define FTM_STATUS_CH3F(x) (((uint32_t)(((uint32_t)(x)) << FTM_STATUS_CH3F_SHIFT)) & FTM_STATUS_CH3F_MASK) 360 361 #define FTM_STATUS_CH4F_MASK (0x10U) 362 #define FTM_STATUS_CH4F_SHIFT (4U) 363 #define FTM_STATUS_CH4F_WIDTH (1U) 364 #define FTM_STATUS_CH4F(x) (((uint32_t)(((uint32_t)(x)) << FTM_STATUS_CH4F_SHIFT)) & FTM_STATUS_CH4F_MASK) 365 366 #define FTM_STATUS_CH5F_MASK (0x20U) 367 #define FTM_STATUS_CH5F_SHIFT (5U) 368 #define FTM_STATUS_CH5F_WIDTH (1U) 369 #define FTM_STATUS_CH5F(x) (((uint32_t)(((uint32_t)(x)) << FTM_STATUS_CH5F_SHIFT)) & FTM_STATUS_CH5F_MASK) 370 371 #define FTM_STATUS_CH6F_MASK (0x40U) 372 #define FTM_STATUS_CH6F_SHIFT (6U) 373 #define FTM_STATUS_CH6F_WIDTH (1U) 374 #define FTM_STATUS_CH6F(x) (((uint32_t)(((uint32_t)(x)) << FTM_STATUS_CH6F_SHIFT)) & FTM_STATUS_CH6F_MASK) 375 376 #define FTM_STATUS_CH7F_MASK (0x80U) 377 #define FTM_STATUS_CH7F_SHIFT (7U) 378 #define FTM_STATUS_CH7F_WIDTH (1U) 379 #define FTM_STATUS_CH7F(x) (((uint32_t)(((uint32_t)(x)) << FTM_STATUS_CH7F_SHIFT)) & FTM_STATUS_CH7F_MASK) 380 /*! @} */ 381 382 /*! @name MODE - Features Mode Selection */ 383 /*! @{ */ 384 385 #define FTM_MODE_FTMEN_MASK (0x1U) 386 #define FTM_MODE_FTMEN_SHIFT (0U) 387 #define FTM_MODE_FTMEN_WIDTH (1U) 388 #define FTM_MODE_FTMEN(x) (((uint32_t)(((uint32_t)(x)) << FTM_MODE_FTMEN_SHIFT)) & FTM_MODE_FTMEN_MASK) 389 390 #define FTM_MODE_INIT_MASK (0x2U) 391 #define FTM_MODE_INIT_SHIFT (1U) 392 #define FTM_MODE_INIT_WIDTH (1U) 393 #define FTM_MODE_INIT(x) (((uint32_t)(((uint32_t)(x)) << FTM_MODE_INIT_SHIFT)) & FTM_MODE_INIT_MASK) 394 395 #define FTM_MODE_WPDIS_MASK (0x4U) 396 #define FTM_MODE_WPDIS_SHIFT (2U) 397 #define FTM_MODE_WPDIS_WIDTH (1U) 398 #define FTM_MODE_WPDIS(x) (((uint32_t)(((uint32_t)(x)) << FTM_MODE_WPDIS_SHIFT)) & FTM_MODE_WPDIS_MASK) 399 400 #define FTM_MODE_PWMSYNC_MASK (0x8U) 401 #define FTM_MODE_PWMSYNC_SHIFT (3U) 402 #define FTM_MODE_PWMSYNC_WIDTH (1U) 403 #define FTM_MODE_PWMSYNC(x) (((uint32_t)(((uint32_t)(x)) << FTM_MODE_PWMSYNC_SHIFT)) & FTM_MODE_PWMSYNC_MASK) 404 405 #define FTM_MODE_CAPTEST_MASK (0x10U) 406 #define FTM_MODE_CAPTEST_SHIFT (4U) 407 #define FTM_MODE_CAPTEST_WIDTH (1U) 408 #define FTM_MODE_CAPTEST(x) (((uint32_t)(((uint32_t)(x)) << FTM_MODE_CAPTEST_SHIFT)) & FTM_MODE_CAPTEST_MASK) 409 410 #define FTM_MODE_FAULTM_MASK (0x60U) 411 #define FTM_MODE_FAULTM_SHIFT (5U) 412 #define FTM_MODE_FAULTM_WIDTH (2U) 413 #define FTM_MODE_FAULTM(x) (((uint32_t)(((uint32_t)(x)) << FTM_MODE_FAULTM_SHIFT)) & FTM_MODE_FAULTM_MASK) 414 415 #define FTM_MODE_FAULTIE_MASK (0x80U) 416 #define FTM_MODE_FAULTIE_SHIFT (7U) 417 #define FTM_MODE_FAULTIE_WIDTH (1U) 418 #define FTM_MODE_FAULTIE(x) (((uint32_t)(((uint32_t)(x)) << FTM_MODE_FAULTIE_SHIFT)) & FTM_MODE_FAULTIE_MASK) 419 /*! @} */ 420 421 /*! @name SYNC - Synchronization */ 422 /*! @{ */ 423 424 #define FTM_SYNC_CNTMIN_MASK (0x1U) 425 #define FTM_SYNC_CNTMIN_SHIFT (0U) 426 #define FTM_SYNC_CNTMIN_WIDTH (1U) 427 #define FTM_SYNC_CNTMIN(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNC_CNTMIN_SHIFT)) & FTM_SYNC_CNTMIN_MASK) 428 429 #define FTM_SYNC_CNTMAX_MASK (0x2U) 430 #define FTM_SYNC_CNTMAX_SHIFT (1U) 431 #define FTM_SYNC_CNTMAX_WIDTH (1U) 432 #define FTM_SYNC_CNTMAX(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNC_CNTMAX_SHIFT)) & FTM_SYNC_CNTMAX_MASK) 433 434 #define FTM_SYNC_REINIT_MASK (0x4U) 435 #define FTM_SYNC_REINIT_SHIFT (2U) 436 #define FTM_SYNC_REINIT_WIDTH (1U) 437 #define FTM_SYNC_REINIT(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNC_REINIT_SHIFT)) & FTM_SYNC_REINIT_MASK) 438 439 #define FTM_SYNC_SYNCHOM_MASK (0x8U) 440 #define FTM_SYNC_SYNCHOM_SHIFT (3U) 441 #define FTM_SYNC_SYNCHOM_WIDTH (1U) 442 #define FTM_SYNC_SYNCHOM(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNC_SYNCHOM_SHIFT)) & FTM_SYNC_SYNCHOM_MASK) 443 444 #define FTM_SYNC_TRIG0_MASK (0x10U) 445 #define FTM_SYNC_TRIG0_SHIFT (4U) 446 #define FTM_SYNC_TRIG0_WIDTH (1U) 447 #define FTM_SYNC_TRIG0(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNC_TRIG0_SHIFT)) & FTM_SYNC_TRIG0_MASK) 448 449 #define FTM_SYNC_TRIG1_MASK (0x20U) 450 #define FTM_SYNC_TRIG1_SHIFT (5U) 451 #define FTM_SYNC_TRIG1_WIDTH (1U) 452 #define FTM_SYNC_TRIG1(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNC_TRIG1_SHIFT)) & FTM_SYNC_TRIG1_MASK) 453 454 #define FTM_SYNC_TRIG2_MASK (0x40U) 455 #define FTM_SYNC_TRIG2_SHIFT (6U) 456 #define FTM_SYNC_TRIG2_WIDTH (1U) 457 #define FTM_SYNC_TRIG2(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNC_TRIG2_SHIFT)) & FTM_SYNC_TRIG2_MASK) 458 459 #define FTM_SYNC_SWSYNC_MASK (0x80U) 460 #define FTM_SYNC_SWSYNC_SHIFT (7U) 461 #define FTM_SYNC_SWSYNC_WIDTH (1U) 462 #define FTM_SYNC_SWSYNC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNC_SWSYNC_SHIFT)) & FTM_SYNC_SWSYNC_MASK) 463 /*! @} */ 464 465 /*! @name OUTINIT - Initial State For Channels Output */ 466 /*! @{ */ 467 468 #define FTM_OUTINIT_CH0OI_MASK (0x1U) 469 #define FTM_OUTINIT_CH0OI_SHIFT (0U) 470 #define FTM_OUTINIT_CH0OI_WIDTH (1U) 471 #define FTM_OUTINIT_CH0OI(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTINIT_CH0OI_SHIFT)) & FTM_OUTINIT_CH0OI_MASK) 472 473 #define FTM_OUTINIT_CH1OI_MASK (0x2U) 474 #define FTM_OUTINIT_CH1OI_SHIFT (1U) 475 #define FTM_OUTINIT_CH1OI_WIDTH (1U) 476 #define FTM_OUTINIT_CH1OI(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTINIT_CH1OI_SHIFT)) & FTM_OUTINIT_CH1OI_MASK) 477 478 #define FTM_OUTINIT_CH2OI_MASK (0x4U) 479 #define FTM_OUTINIT_CH2OI_SHIFT (2U) 480 #define FTM_OUTINIT_CH2OI_WIDTH (1U) 481 #define FTM_OUTINIT_CH2OI(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTINIT_CH2OI_SHIFT)) & FTM_OUTINIT_CH2OI_MASK) 482 483 #define FTM_OUTINIT_CH3OI_MASK (0x8U) 484 #define FTM_OUTINIT_CH3OI_SHIFT (3U) 485 #define FTM_OUTINIT_CH3OI_WIDTH (1U) 486 #define FTM_OUTINIT_CH3OI(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTINIT_CH3OI_SHIFT)) & FTM_OUTINIT_CH3OI_MASK) 487 488 #define FTM_OUTINIT_CH4OI_MASK (0x10U) 489 #define FTM_OUTINIT_CH4OI_SHIFT (4U) 490 #define FTM_OUTINIT_CH4OI_WIDTH (1U) 491 #define FTM_OUTINIT_CH4OI(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTINIT_CH4OI_SHIFT)) & FTM_OUTINIT_CH4OI_MASK) 492 493 #define FTM_OUTINIT_CH5OI_MASK (0x20U) 494 #define FTM_OUTINIT_CH5OI_SHIFT (5U) 495 #define FTM_OUTINIT_CH5OI_WIDTH (1U) 496 #define FTM_OUTINIT_CH5OI(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTINIT_CH5OI_SHIFT)) & FTM_OUTINIT_CH5OI_MASK) 497 498 #define FTM_OUTINIT_CH6OI_MASK (0x40U) 499 #define FTM_OUTINIT_CH6OI_SHIFT (6U) 500 #define FTM_OUTINIT_CH6OI_WIDTH (1U) 501 #define FTM_OUTINIT_CH6OI(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTINIT_CH6OI_SHIFT)) & FTM_OUTINIT_CH6OI_MASK) 502 503 #define FTM_OUTINIT_CH7OI_MASK (0x80U) 504 #define FTM_OUTINIT_CH7OI_SHIFT (7U) 505 #define FTM_OUTINIT_CH7OI_WIDTH (1U) 506 #define FTM_OUTINIT_CH7OI(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTINIT_CH7OI_SHIFT)) & FTM_OUTINIT_CH7OI_MASK) 507 /*! @} */ 508 509 /*! @name OUTMASK - Output Mask */ 510 /*! @{ */ 511 512 #define FTM_OUTMASK_CH0OM_MASK (0x1U) 513 #define FTM_OUTMASK_CH0OM_SHIFT (0U) 514 #define FTM_OUTMASK_CH0OM_WIDTH (1U) 515 #define FTM_OUTMASK_CH0OM(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTMASK_CH0OM_SHIFT)) & FTM_OUTMASK_CH0OM_MASK) 516 517 #define FTM_OUTMASK_CH1OM_MASK (0x2U) 518 #define FTM_OUTMASK_CH1OM_SHIFT (1U) 519 #define FTM_OUTMASK_CH1OM_WIDTH (1U) 520 #define FTM_OUTMASK_CH1OM(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTMASK_CH1OM_SHIFT)) & FTM_OUTMASK_CH1OM_MASK) 521 522 #define FTM_OUTMASK_CH2OM_MASK (0x4U) 523 #define FTM_OUTMASK_CH2OM_SHIFT (2U) 524 #define FTM_OUTMASK_CH2OM_WIDTH (1U) 525 #define FTM_OUTMASK_CH2OM(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTMASK_CH2OM_SHIFT)) & FTM_OUTMASK_CH2OM_MASK) 526 527 #define FTM_OUTMASK_CH3OM_MASK (0x8U) 528 #define FTM_OUTMASK_CH3OM_SHIFT (3U) 529 #define FTM_OUTMASK_CH3OM_WIDTH (1U) 530 #define FTM_OUTMASK_CH3OM(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTMASK_CH3OM_SHIFT)) & FTM_OUTMASK_CH3OM_MASK) 531 532 #define FTM_OUTMASK_CH4OM_MASK (0x10U) 533 #define FTM_OUTMASK_CH4OM_SHIFT (4U) 534 #define FTM_OUTMASK_CH4OM_WIDTH (1U) 535 #define FTM_OUTMASK_CH4OM(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTMASK_CH4OM_SHIFT)) & FTM_OUTMASK_CH4OM_MASK) 536 537 #define FTM_OUTMASK_CH5OM_MASK (0x20U) 538 #define FTM_OUTMASK_CH5OM_SHIFT (5U) 539 #define FTM_OUTMASK_CH5OM_WIDTH (1U) 540 #define FTM_OUTMASK_CH5OM(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTMASK_CH5OM_SHIFT)) & FTM_OUTMASK_CH5OM_MASK) 541 542 #define FTM_OUTMASK_CH6OM_MASK (0x40U) 543 #define FTM_OUTMASK_CH6OM_SHIFT (6U) 544 #define FTM_OUTMASK_CH6OM_WIDTH (1U) 545 #define FTM_OUTMASK_CH6OM(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTMASK_CH6OM_SHIFT)) & FTM_OUTMASK_CH6OM_MASK) 546 547 #define FTM_OUTMASK_CH7OM_MASK (0x80U) 548 #define FTM_OUTMASK_CH7OM_SHIFT (7U) 549 #define FTM_OUTMASK_CH7OM_WIDTH (1U) 550 #define FTM_OUTMASK_CH7OM(x) (((uint32_t)(((uint32_t)(x)) << FTM_OUTMASK_CH7OM_SHIFT)) & FTM_OUTMASK_CH7OM_MASK) 551 /*! @} */ 552 553 /*! @name COMBINE - Function For Linked Channels */ 554 /*! @{ */ 555 556 #define FTM_COMBINE_COMBINE0_MASK (0x1U) 557 #define FTM_COMBINE_COMBINE0_SHIFT (0U) 558 #define FTM_COMBINE_COMBINE0_WIDTH (1U) 559 #define FTM_COMBINE_COMBINE0(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_COMBINE0_SHIFT)) & FTM_COMBINE_COMBINE0_MASK) 560 561 #define FTM_COMBINE_COMP0_MASK (0x2U) 562 #define FTM_COMBINE_COMP0_SHIFT (1U) 563 #define FTM_COMBINE_COMP0_WIDTH (1U) 564 #define FTM_COMBINE_COMP0(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_COMP0_SHIFT)) & FTM_COMBINE_COMP0_MASK) 565 566 #define FTM_COMBINE_DECAPEN0_MASK (0x4U) 567 #define FTM_COMBINE_DECAPEN0_SHIFT (2U) 568 #define FTM_COMBINE_DECAPEN0_WIDTH (1U) 569 #define FTM_COMBINE_DECAPEN0(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DECAPEN0_SHIFT)) & FTM_COMBINE_DECAPEN0_MASK) 570 571 #define FTM_COMBINE_DECAP0_MASK (0x8U) 572 #define FTM_COMBINE_DECAP0_SHIFT (3U) 573 #define FTM_COMBINE_DECAP0_WIDTH (1U) 574 #define FTM_COMBINE_DECAP0(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DECAP0_SHIFT)) & FTM_COMBINE_DECAP0_MASK) 575 576 #define FTM_COMBINE_DTEN0_MASK (0x10U) 577 #define FTM_COMBINE_DTEN0_SHIFT (4U) 578 #define FTM_COMBINE_DTEN0_WIDTH (1U) 579 #define FTM_COMBINE_DTEN0(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DTEN0_SHIFT)) & FTM_COMBINE_DTEN0_MASK) 580 581 #define FTM_COMBINE_SYNCEN0_MASK (0x20U) 582 #define FTM_COMBINE_SYNCEN0_SHIFT (5U) 583 #define FTM_COMBINE_SYNCEN0_WIDTH (1U) 584 #define FTM_COMBINE_SYNCEN0(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_SYNCEN0_SHIFT)) & FTM_COMBINE_SYNCEN0_MASK) 585 586 #define FTM_COMBINE_FAULTEN0_MASK (0x40U) 587 #define FTM_COMBINE_FAULTEN0_SHIFT (6U) 588 #define FTM_COMBINE_FAULTEN0_WIDTH (1U) 589 #define FTM_COMBINE_FAULTEN0(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_FAULTEN0_SHIFT)) & FTM_COMBINE_FAULTEN0_MASK) 590 591 #define FTM_COMBINE_MCOMBINE0_MASK (0x80U) 592 #define FTM_COMBINE_MCOMBINE0_SHIFT (7U) 593 #define FTM_COMBINE_MCOMBINE0_WIDTH (1U) 594 #define FTM_COMBINE_MCOMBINE0(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_MCOMBINE0_SHIFT)) & FTM_COMBINE_MCOMBINE0_MASK) 595 596 #define FTM_COMBINE_COMBINE1_MASK (0x100U) 597 #define FTM_COMBINE_COMBINE1_SHIFT (8U) 598 #define FTM_COMBINE_COMBINE1_WIDTH (1U) 599 #define FTM_COMBINE_COMBINE1(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_COMBINE1_SHIFT)) & FTM_COMBINE_COMBINE1_MASK) 600 601 #define FTM_COMBINE_COMP1_MASK (0x200U) 602 #define FTM_COMBINE_COMP1_SHIFT (9U) 603 #define FTM_COMBINE_COMP1_WIDTH (1U) 604 #define FTM_COMBINE_COMP1(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_COMP1_SHIFT)) & FTM_COMBINE_COMP1_MASK) 605 606 #define FTM_COMBINE_DECAPEN1_MASK (0x400U) 607 #define FTM_COMBINE_DECAPEN1_SHIFT (10U) 608 #define FTM_COMBINE_DECAPEN1_WIDTH (1U) 609 #define FTM_COMBINE_DECAPEN1(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DECAPEN1_SHIFT)) & FTM_COMBINE_DECAPEN1_MASK) 610 611 #define FTM_COMBINE_DECAP1_MASK (0x800U) 612 #define FTM_COMBINE_DECAP1_SHIFT (11U) 613 #define FTM_COMBINE_DECAP1_WIDTH (1U) 614 #define FTM_COMBINE_DECAP1(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DECAP1_SHIFT)) & FTM_COMBINE_DECAP1_MASK) 615 616 #define FTM_COMBINE_DTEN1_MASK (0x1000U) 617 #define FTM_COMBINE_DTEN1_SHIFT (12U) 618 #define FTM_COMBINE_DTEN1_WIDTH (1U) 619 #define FTM_COMBINE_DTEN1(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DTEN1_SHIFT)) & FTM_COMBINE_DTEN1_MASK) 620 621 #define FTM_COMBINE_SYNCEN1_MASK (0x2000U) 622 #define FTM_COMBINE_SYNCEN1_SHIFT (13U) 623 #define FTM_COMBINE_SYNCEN1_WIDTH (1U) 624 #define FTM_COMBINE_SYNCEN1(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_SYNCEN1_SHIFT)) & FTM_COMBINE_SYNCEN1_MASK) 625 626 #define FTM_COMBINE_FAULTEN1_MASK (0x4000U) 627 #define FTM_COMBINE_FAULTEN1_SHIFT (14U) 628 #define FTM_COMBINE_FAULTEN1_WIDTH (1U) 629 #define FTM_COMBINE_FAULTEN1(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_FAULTEN1_SHIFT)) & FTM_COMBINE_FAULTEN1_MASK) 630 631 #define FTM_COMBINE_MCOMBINE1_MASK (0x8000U) 632 #define FTM_COMBINE_MCOMBINE1_SHIFT (15U) 633 #define FTM_COMBINE_MCOMBINE1_WIDTH (1U) 634 #define FTM_COMBINE_MCOMBINE1(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_MCOMBINE1_SHIFT)) & FTM_COMBINE_MCOMBINE1_MASK) 635 636 #define FTM_COMBINE_COMBINE2_MASK (0x10000U) 637 #define FTM_COMBINE_COMBINE2_SHIFT (16U) 638 #define FTM_COMBINE_COMBINE2_WIDTH (1U) 639 #define FTM_COMBINE_COMBINE2(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_COMBINE2_SHIFT)) & FTM_COMBINE_COMBINE2_MASK) 640 641 #define FTM_COMBINE_COMP2_MASK (0x20000U) 642 #define FTM_COMBINE_COMP2_SHIFT (17U) 643 #define FTM_COMBINE_COMP2_WIDTH (1U) 644 #define FTM_COMBINE_COMP2(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_COMP2_SHIFT)) & FTM_COMBINE_COMP2_MASK) 645 646 #define FTM_COMBINE_DECAPEN2_MASK (0x40000U) 647 #define FTM_COMBINE_DECAPEN2_SHIFT (18U) 648 #define FTM_COMBINE_DECAPEN2_WIDTH (1U) 649 #define FTM_COMBINE_DECAPEN2(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DECAPEN2_SHIFT)) & FTM_COMBINE_DECAPEN2_MASK) 650 651 #define FTM_COMBINE_DECAP2_MASK (0x80000U) 652 #define FTM_COMBINE_DECAP2_SHIFT (19U) 653 #define FTM_COMBINE_DECAP2_WIDTH (1U) 654 #define FTM_COMBINE_DECAP2(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DECAP2_SHIFT)) & FTM_COMBINE_DECAP2_MASK) 655 656 #define FTM_COMBINE_DTEN2_MASK (0x100000U) 657 #define FTM_COMBINE_DTEN2_SHIFT (20U) 658 #define FTM_COMBINE_DTEN2_WIDTH (1U) 659 #define FTM_COMBINE_DTEN2(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DTEN2_SHIFT)) & FTM_COMBINE_DTEN2_MASK) 660 661 #define FTM_COMBINE_SYNCEN2_MASK (0x200000U) 662 #define FTM_COMBINE_SYNCEN2_SHIFT (21U) 663 #define FTM_COMBINE_SYNCEN2_WIDTH (1U) 664 #define FTM_COMBINE_SYNCEN2(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_SYNCEN2_SHIFT)) & FTM_COMBINE_SYNCEN2_MASK) 665 666 #define FTM_COMBINE_FAULTEN2_MASK (0x400000U) 667 #define FTM_COMBINE_FAULTEN2_SHIFT (22U) 668 #define FTM_COMBINE_FAULTEN2_WIDTH (1U) 669 #define FTM_COMBINE_FAULTEN2(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_FAULTEN2_SHIFT)) & FTM_COMBINE_FAULTEN2_MASK) 670 671 #define FTM_COMBINE_MCOMBINE2_MASK (0x800000U) 672 #define FTM_COMBINE_MCOMBINE2_SHIFT (23U) 673 #define FTM_COMBINE_MCOMBINE2_WIDTH (1U) 674 #define FTM_COMBINE_MCOMBINE2(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_MCOMBINE2_SHIFT)) & FTM_COMBINE_MCOMBINE2_MASK) 675 676 #define FTM_COMBINE_COMBINE3_MASK (0x1000000U) 677 #define FTM_COMBINE_COMBINE3_SHIFT (24U) 678 #define FTM_COMBINE_COMBINE3_WIDTH (1U) 679 #define FTM_COMBINE_COMBINE3(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_COMBINE3_SHIFT)) & FTM_COMBINE_COMBINE3_MASK) 680 681 #define FTM_COMBINE_COMP3_MASK (0x2000000U) 682 #define FTM_COMBINE_COMP3_SHIFT (25U) 683 #define FTM_COMBINE_COMP3_WIDTH (1U) 684 #define FTM_COMBINE_COMP3(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_COMP3_SHIFT)) & FTM_COMBINE_COMP3_MASK) 685 686 #define FTM_COMBINE_DECAPEN3_MASK (0x4000000U) 687 #define FTM_COMBINE_DECAPEN3_SHIFT (26U) 688 #define FTM_COMBINE_DECAPEN3_WIDTH (1U) 689 #define FTM_COMBINE_DECAPEN3(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DECAPEN3_SHIFT)) & FTM_COMBINE_DECAPEN3_MASK) 690 691 #define FTM_COMBINE_DECAP3_MASK (0x8000000U) 692 #define FTM_COMBINE_DECAP3_SHIFT (27U) 693 #define FTM_COMBINE_DECAP3_WIDTH (1U) 694 #define FTM_COMBINE_DECAP3(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DECAP3_SHIFT)) & FTM_COMBINE_DECAP3_MASK) 695 696 #define FTM_COMBINE_DTEN3_MASK (0x10000000U) 697 #define FTM_COMBINE_DTEN3_SHIFT (28U) 698 #define FTM_COMBINE_DTEN3_WIDTH (1U) 699 #define FTM_COMBINE_DTEN3(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_DTEN3_SHIFT)) & FTM_COMBINE_DTEN3_MASK) 700 701 #define FTM_COMBINE_SYNCEN3_MASK (0x20000000U) 702 #define FTM_COMBINE_SYNCEN3_SHIFT (29U) 703 #define FTM_COMBINE_SYNCEN3_WIDTH (1U) 704 #define FTM_COMBINE_SYNCEN3(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_SYNCEN3_SHIFT)) & FTM_COMBINE_SYNCEN3_MASK) 705 706 #define FTM_COMBINE_FAULTEN3_MASK (0x40000000U) 707 #define FTM_COMBINE_FAULTEN3_SHIFT (30U) 708 #define FTM_COMBINE_FAULTEN3_WIDTH (1U) 709 #define FTM_COMBINE_FAULTEN3(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_FAULTEN3_SHIFT)) & FTM_COMBINE_FAULTEN3_MASK) 710 711 #define FTM_COMBINE_MCOMBINE3_MASK (0x80000000U) 712 #define FTM_COMBINE_MCOMBINE3_SHIFT (31U) 713 #define FTM_COMBINE_MCOMBINE3_WIDTH (1U) 714 #define FTM_COMBINE_MCOMBINE3(x) (((uint32_t)(((uint32_t)(x)) << FTM_COMBINE_MCOMBINE3_SHIFT)) & FTM_COMBINE_MCOMBINE3_MASK) 715 /*! @} */ 716 717 /*! @name DEADTIME - Deadtime Configuration */ 718 /*! @{ */ 719 720 #define FTM_DEADTIME_DTVAL_MASK (0x3FU) 721 #define FTM_DEADTIME_DTVAL_SHIFT (0U) 722 #define FTM_DEADTIME_DTVAL_WIDTH (6U) 723 #define FTM_DEADTIME_DTVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_DEADTIME_DTVAL_SHIFT)) & FTM_DEADTIME_DTVAL_MASK) 724 725 #define FTM_DEADTIME_DTPS_MASK (0xC0U) 726 #define FTM_DEADTIME_DTPS_SHIFT (6U) 727 #define FTM_DEADTIME_DTPS_WIDTH (2U) 728 #define FTM_DEADTIME_DTPS(x) (((uint32_t)(((uint32_t)(x)) << FTM_DEADTIME_DTPS_SHIFT)) & FTM_DEADTIME_DTPS_MASK) 729 730 #define FTM_DEADTIME_DTVALEX_MASK (0xF0000U) 731 #define FTM_DEADTIME_DTVALEX_SHIFT (16U) 732 #define FTM_DEADTIME_DTVALEX_WIDTH (4U) 733 #define FTM_DEADTIME_DTVALEX(x) (((uint32_t)(((uint32_t)(x)) << FTM_DEADTIME_DTVALEX_SHIFT)) & FTM_DEADTIME_DTVALEX_MASK) 734 /*! @} */ 735 736 /*! @name EXTTRIG - FTM External Trigger */ 737 /*! @{ */ 738 739 #define FTM_EXTTRIG_CH2TRIG_MASK (0x1U) 740 #define FTM_EXTTRIG_CH2TRIG_SHIFT (0U) 741 #define FTM_EXTTRIG_CH2TRIG_WIDTH (1U) 742 #define FTM_EXTTRIG_CH2TRIG(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_CH2TRIG_SHIFT)) & FTM_EXTTRIG_CH2TRIG_MASK) 743 744 #define FTM_EXTTRIG_CH3TRIG_MASK (0x2U) 745 #define FTM_EXTTRIG_CH3TRIG_SHIFT (1U) 746 #define FTM_EXTTRIG_CH3TRIG_WIDTH (1U) 747 #define FTM_EXTTRIG_CH3TRIG(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_CH3TRIG_SHIFT)) & FTM_EXTTRIG_CH3TRIG_MASK) 748 749 #define FTM_EXTTRIG_CH4TRIG_MASK (0x4U) 750 #define FTM_EXTTRIG_CH4TRIG_SHIFT (2U) 751 #define FTM_EXTTRIG_CH4TRIG_WIDTH (1U) 752 #define FTM_EXTTRIG_CH4TRIG(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_CH4TRIG_SHIFT)) & FTM_EXTTRIG_CH4TRIG_MASK) 753 754 #define FTM_EXTTRIG_CH5TRIG_MASK (0x8U) 755 #define FTM_EXTTRIG_CH5TRIG_SHIFT (3U) 756 #define FTM_EXTTRIG_CH5TRIG_WIDTH (1U) 757 #define FTM_EXTTRIG_CH5TRIG(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_CH5TRIG_SHIFT)) & FTM_EXTTRIG_CH5TRIG_MASK) 758 759 #define FTM_EXTTRIG_CH0TRIG_MASK (0x10U) 760 #define FTM_EXTTRIG_CH0TRIG_SHIFT (4U) 761 #define FTM_EXTTRIG_CH0TRIG_WIDTH (1U) 762 #define FTM_EXTTRIG_CH0TRIG(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_CH0TRIG_SHIFT)) & FTM_EXTTRIG_CH0TRIG_MASK) 763 764 #define FTM_EXTTRIG_CH1TRIG_MASK (0x20U) 765 #define FTM_EXTTRIG_CH1TRIG_SHIFT (5U) 766 #define FTM_EXTTRIG_CH1TRIG_WIDTH (1U) 767 #define FTM_EXTTRIG_CH1TRIG(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_CH1TRIG_SHIFT)) & FTM_EXTTRIG_CH1TRIG_MASK) 768 769 #define FTM_EXTTRIG_INITTRIGEN_MASK (0x40U) 770 #define FTM_EXTTRIG_INITTRIGEN_SHIFT (6U) 771 #define FTM_EXTTRIG_INITTRIGEN_WIDTH (1U) 772 #define FTM_EXTTRIG_INITTRIGEN(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_INITTRIGEN_SHIFT)) & FTM_EXTTRIG_INITTRIGEN_MASK) 773 774 #define FTM_EXTTRIG_TRIGF_MASK (0x80U) 775 #define FTM_EXTTRIG_TRIGF_SHIFT (7U) 776 #define FTM_EXTTRIG_TRIGF_WIDTH (1U) 777 #define FTM_EXTTRIG_TRIGF(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_TRIGF_SHIFT)) & FTM_EXTTRIG_TRIGF_MASK) 778 779 #define FTM_EXTTRIG_CH6TRIG_MASK (0x100U) 780 #define FTM_EXTTRIG_CH6TRIG_SHIFT (8U) 781 #define FTM_EXTTRIG_CH6TRIG_WIDTH (1U) 782 #define FTM_EXTTRIG_CH6TRIG(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_CH6TRIG_SHIFT)) & FTM_EXTTRIG_CH6TRIG_MASK) 783 784 #define FTM_EXTTRIG_CH7TRIG_MASK (0x200U) 785 #define FTM_EXTTRIG_CH7TRIG_SHIFT (9U) 786 #define FTM_EXTTRIG_CH7TRIG_WIDTH (1U) 787 #define FTM_EXTTRIG_CH7TRIG(x) (((uint32_t)(((uint32_t)(x)) << FTM_EXTTRIG_CH7TRIG_SHIFT)) & FTM_EXTTRIG_CH7TRIG_MASK) 788 /*! @} */ 789 790 /*! @name POL - Channels Polarity */ 791 /*! @{ */ 792 793 #define FTM_POL_POL0_MASK (0x1U) 794 #define FTM_POL_POL0_SHIFT (0U) 795 #define FTM_POL_POL0_WIDTH (1U) 796 #define FTM_POL_POL0(x) (((uint32_t)(((uint32_t)(x)) << FTM_POL_POL0_SHIFT)) & FTM_POL_POL0_MASK) 797 798 #define FTM_POL_POL1_MASK (0x2U) 799 #define FTM_POL_POL1_SHIFT (1U) 800 #define FTM_POL_POL1_WIDTH (1U) 801 #define FTM_POL_POL1(x) (((uint32_t)(((uint32_t)(x)) << FTM_POL_POL1_SHIFT)) & FTM_POL_POL1_MASK) 802 803 #define FTM_POL_POL2_MASK (0x4U) 804 #define FTM_POL_POL2_SHIFT (2U) 805 #define FTM_POL_POL2_WIDTH (1U) 806 #define FTM_POL_POL2(x) (((uint32_t)(((uint32_t)(x)) << FTM_POL_POL2_SHIFT)) & FTM_POL_POL2_MASK) 807 808 #define FTM_POL_POL3_MASK (0x8U) 809 #define FTM_POL_POL3_SHIFT (3U) 810 #define FTM_POL_POL3_WIDTH (1U) 811 #define FTM_POL_POL3(x) (((uint32_t)(((uint32_t)(x)) << FTM_POL_POL3_SHIFT)) & FTM_POL_POL3_MASK) 812 813 #define FTM_POL_POL4_MASK (0x10U) 814 #define FTM_POL_POL4_SHIFT (4U) 815 #define FTM_POL_POL4_WIDTH (1U) 816 #define FTM_POL_POL4(x) (((uint32_t)(((uint32_t)(x)) << FTM_POL_POL4_SHIFT)) & FTM_POL_POL4_MASK) 817 818 #define FTM_POL_POL5_MASK (0x20U) 819 #define FTM_POL_POL5_SHIFT (5U) 820 #define FTM_POL_POL5_WIDTH (1U) 821 #define FTM_POL_POL5(x) (((uint32_t)(((uint32_t)(x)) << FTM_POL_POL5_SHIFT)) & FTM_POL_POL5_MASK) 822 823 #define FTM_POL_POL6_MASK (0x40U) 824 #define FTM_POL_POL6_SHIFT (6U) 825 #define FTM_POL_POL6_WIDTH (1U) 826 #define FTM_POL_POL6(x) (((uint32_t)(((uint32_t)(x)) << FTM_POL_POL6_SHIFT)) & FTM_POL_POL6_MASK) 827 828 #define FTM_POL_POL7_MASK (0x80U) 829 #define FTM_POL_POL7_SHIFT (7U) 830 #define FTM_POL_POL7_WIDTH (1U) 831 #define FTM_POL_POL7(x) (((uint32_t)(((uint32_t)(x)) << FTM_POL_POL7_SHIFT)) & FTM_POL_POL7_MASK) 832 /*! @} */ 833 834 /*! @name FMS - Fault Mode Status */ 835 /*! @{ */ 836 837 #define FTM_FMS_FAULTF0_MASK (0x1U) 838 #define FTM_FMS_FAULTF0_SHIFT (0U) 839 #define FTM_FMS_FAULTF0_WIDTH (1U) 840 #define FTM_FMS_FAULTF0(x) (((uint32_t)(((uint32_t)(x)) << FTM_FMS_FAULTF0_SHIFT)) & FTM_FMS_FAULTF0_MASK) 841 842 #define FTM_FMS_FAULTF1_MASK (0x2U) 843 #define FTM_FMS_FAULTF1_SHIFT (1U) 844 #define FTM_FMS_FAULTF1_WIDTH (1U) 845 #define FTM_FMS_FAULTF1(x) (((uint32_t)(((uint32_t)(x)) << FTM_FMS_FAULTF1_SHIFT)) & FTM_FMS_FAULTF1_MASK) 846 847 #define FTM_FMS_FAULTF2_MASK (0x4U) 848 #define FTM_FMS_FAULTF2_SHIFT (2U) 849 #define FTM_FMS_FAULTF2_WIDTH (1U) 850 #define FTM_FMS_FAULTF2(x) (((uint32_t)(((uint32_t)(x)) << FTM_FMS_FAULTF2_SHIFT)) & FTM_FMS_FAULTF2_MASK) 851 852 #define FTM_FMS_FAULTF3_MASK (0x8U) 853 #define FTM_FMS_FAULTF3_SHIFT (3U) 854 #define FTM_FMS_FAULTF3_WIDTH (1U) 855 #define FTM_FMS_FAULTF3(x) (((uint32_t)(((uint32_t)(x)) << FTM_FMS_FAULTF3_SHIFT)) & FTM_FMS_FAULTF3_MASK) 856 857 #define FTM_FMS_FAULTIN_MASK (0x20U) 858 #define FTM_FMS_FAULTIN_SHIFT (5U) 859 #define FTM_FMS_FAULTIN_WIDTH (1U) 860 #define FTM_FMS_FAULTIN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FMS_FAULTIN_SHIFT)) & FTM_FMS_FAULTIN_MASK) 861 862 #define FTM_FMS_WPEN_MASK (0x40U) 863 #define FTM_FMS_WPEN_SHIFT (6U) 864 #define FTM_FMS_WPEN_WIDTH (1U) 865 #define FTM_FMS_WPEN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FMS_WPEN_SHIFT)) & FTM_FMS_WPEN_MASK) 866 867 #define FTM_FMS_FAULTF_MASK (0x80U) 868 #define FTM_FMS_FAULTF_SHIFT (7U) 869 #define FTM_FMS_FAULTF_WIDTH (1U) 870 #define FTM_FMS_FAULTF(x) (((uint32_t)(((uint32_t)(x)) << FTM_FMS_FAULTF_SHIFT)) & FTM_FMS_FAULTF_MASK) 871 /*! @} */ 872 873 /*! @name FILTER - Input Capture Filter Control */ 874 /*! @{ */ 875 876 #define FTM_FILTER_CH0FVAL_MASK (0xFU) 877 #define FTM_FILTER_CH0FVAL_SHIFT (0U) 878 #define FTM_FILTER_CH0FVAL_WIDTH (4U) 879 #define FTM_FILTER_CH0FVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FILTER_CH0FVAL_SHIFT)) & FTM_FILTER_CH0FVAL_MASK) 880 881 #define FTM_FILTER_CH1FVAL_MASK (0xF0U) 882 #define FTM_FILTER_CH1FVAL_SHIFT (4U) 883 #define FTM_FILTER_CH1FVAL_WIDTH (4U) 884 #define FTM_FILTER_CH1FVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FILTER_CH1FVAL_SHIFT)) & FTM_FILTER_CH1FVAL_MASK) 885 886 #define FTM_FILTER_CH2FVAL_MASK (0xF00U) 887 #define FTM_FILTER_CH2FVAL_SHIFT (8U) 888 #define FTM_FILTER_CH2FVAL_WIDTH (4U) 889 #define FTM_FILTER_CH2FVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FILTER_CH2FVAL_SHIFT)) & FTM_FILTER_CH2FVAL_MASK) 890 891 #define FTM_FILTER_CH3FVAL_MASK (0xF000U) 892 #define FTM_FILTER_CH3FVAL_SHIFT (12U) 893 #define FTM_FILTER_CH3FVAL_WIDTH (4U) 894 #define FTM_FILTER_CH3FVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FILTER_CH3FVAL_SHIFT)) & FTM_FILTER_CH3FVAL_MASK) 895 /*! @} */ 896 897 /*! @name FLTCTRL - Fault Control */ 898 /*! @{ */ 899 900 #define FTM_FLTCTRL_FAULT0EN_MASK (0x1U) 901 #define FTM_FLTCTRL_FAULT0EN_SHIFT (0U) 902 #define FTM_FLTCTRL_FAULT0EN_WIDTH (1U) 903 #define FTM_FLTCTRL_FAULT0EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FAULT0EN_SHIFT)) & FTM_FLTCTRL_FAULT0EN_MASK) 904 905 #define FTM_FLTCTRL_FAULT1EN_MASK (0x2U) 906 #define FTM_FLTCTRL_FAULT1EN_SHIFT (1U) 907 #define FTM_FLTCTRL_FAULT1EN_WIDTH (1U) 908 #define FTM_FLTCTRL_FAULT1EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FAULT1EN_SHIFT)) & FTM_FLTCTRL_FAULT1EN_MASK) 909 910 #define FTM_FLTCTRL_FAULT2EN_MASK (0x4U) 911 #define FTM_FLTCTRL_FAULT2EN_SHIFT (2U) 912 #define FTM_FLTCTRL_FAULT2EN_WIDTH (1U) 913 #define FTM_FLTCTRL_FAULT2EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FAULT2EN_SHIFT)) & FTM_FLTCTRL_FAULT2EN_MASK) 914 915 #define FTM_FLTCTRL_FAULT3EN_MASK (0x8U) 916 #define FTM_FLTCTRL_FAULT3EN_SHIFT (3U) 917 #define FTM_FLTCTRL_FAULT3EN_WIDTH (1U) 918 #define FTM_FLTCTRL_FAULT3EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FAULT3EN_SHIFT)) & FTM_FLTCTRL_FAULT3EN_MASK) 919 920 #define FTM_FLTCTRL_FFLTR0EN_MASK (0x10U) 921 #define FTM_FLTCTRL_FFLTR0EN_SHIFT (4U) 922 #define FTM_FLTCTRL_FFLTR0EN_WIDTH (1U) 923 #define FTM_FLTCTRL_FFLTR0EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FFLTR0EN_SHIFT)) & FTM_FLTCTRL_FFLTR0EN_MASK) 924 925 #define FTM_FLTCTRL_FFLTR1EN_MASK (0x20U) 926 #define FTM_FLTCTRL_FFLTR1EN_SHIFT (5U) 927 #define FTM_FLTCTRL_FFLTR1EN_WIDTH (1U) 928 #define FTM_FLTCTRL_FFLTR1EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FFLTR1EN_SHIFT)) & FTM_FLTCTRL_FFLTR1EN_MASK) 929 930 #define FTM_FLTCTRL_FFLTR2EN_MASK (0x40U) 931 #define FTM_FLTCTRL_FFLTR2EN_SHIFT (6U) 932 #define FTM_FLTCTRL_FFLTR2EN_WIDTH (1U) 933 #define FTM_FLTCTRL_FFLTR2EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FFLTR2EN_SHIFT)) & FTM_FLTCTRL_FFLTR2EN_MASK) 934 935 #define FTM_FLTCTRL_FFLTR3EN_MASK (0x80U) 936 #define FTM_FLTCTRL_FFLTR3EN_SHIFT (7U) 937 #define FTM_FLTCTRL_FFLTR3EN_WIDTH (1U) 938 #define FTM_FLTCTRL_FFLTR3EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FFLTR3EN_SHIFT)) & FTM_FLTCTRL_FFLTR3EN_MASK) 939 940 #define FTM_FLTCTRL_FFVAL_MASK (0xF00U) 941 #define FTM_FLTCTRL_FFVAL_SHIFT (8U) 942 #define FTM_FLTCTRL_FFVAL_WIDTH (4U) 943 #define FTM_FLTCTRL_FFVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FFVAL_SHIFT)) & FTM_FLTCTRL_FFVAL_MASK) 944 945 #define FTM_FLTCTRL_FSTATE_MASK (0x8000U) 946 #define FTM_FLTCTRL_FSTATE_SHIFT (15U) 947 #define FTM_FLTCTRL_FSTATE_WIDTH (1U) 948 #define FTM_FLTCTRL_FSTATE(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTCTRL_FSTATE_SHIFT)) & FTM_FLTCTRL_FSTATE_MASK) 949 /*! @} */ 950 951 /*! @name QDCTRL - Quadrature Decoder Control And Status */ 952 /*! @{ */ 953 954 #define FTM_QDCTRL_QUADEN_MASK (0x1U) 955 #define FTM_QDCTRL_QUADEN_SHIFT (0U) 956 #define FTM_QDCTRL_QUADEN_WIDTH (1U) 957 #define FTM_QDCTRL_QUADEN(x) (((uint32_t)(((uint32_t)(x)) << FTM_QDCTRL_QUADEN_SHIFT)) & FTM_QDCTRL_QUADEN_MASK) 958 959 #define FTM_QDCTRL_TOFDIR_MASK (0x2U) 960 #define FTM_QDCTRL_TOFDIR_SHIFT (1U) 961 #define FTM_QDCTRL_TOFDIR_WIDTH (1U) 962 #define FTM_QDCTRL_TOFDIR(x) (((uint32_t)(((uint32_t)(x)) << FTM_QDCTRL_TOFDIR_SHIFT)) & FTM_QDCTRL_TOFDIR_MASK) 963 964 #define FTM_QDCTRL_QUADIR_MASK (0x4U) 965 #define FTM_QDCTRL_QUADIR_SHIFT (2U) 966 #define FTM_QDCTRL_QUADIR_WIDTH (1U) 967 #define FTM_QDCTRL_QUADIR(x) (((uint32_t)(((uint32_t)(x)) << FTM_QDCTRL_QUADIR_SHIFT)) & FTM_QDCTRL_QUADIR_MASK) 968 969 #define FTM_QDCTRL_QUADMODE_MASK (0x8U) 970 #define FTM_QDCTRL_QUADMODE_SHIFT (3U) 971 #define FTM_QDCTRL_QUADMODE_WIDTH (1U) 972 #define FTM_QDCTRL_QUADMODE(x) (((uint32_t)(((uint32_t)(x)) << FTM_QDCTRL_QUADMODE_SHIFT)) & FTM_QDCTRL_QUADMODE_MASK) 973 974 #define FTM_QDCTRL_PHBPOL_MASK (0x10U) 975 #define FTM_QDCTRL_PHBPOL_SHIFT (4U) 976 #define FTM_QDCTRL_PHBPOL_WIDTH (1U) 977 #define FTM_QDCTRL_PHBPOL(x) (((uint32_t)(((uint32_t)(x)) << FTM_QDCTRL_PHBPOL_SHIFT)) & FTM_QDCTRL_PHBPOL_MASK) 978 979 #define FTM_QDCTRL_PHAPOL_MASK (0x20U) 980 #define FTM_QDCTRL_PHAPOL_SHIFT (5U) 981 #define FTM_QDCTRL_PHAPOL_WIDTH (1U) 982 #define FTM_QDCTRL_PHAPOL(x) (((uint32_t)(((uint32_t)(x)) << FTM_QDCTRL_PHAPOL_SHIFT)) & FTM_QDCTRL_PHAPOL_MASK) 983 984 #define FTM_QDCTRL_PHBFLTREN_MASK (0x40U) 985 #define FTM_QDCTRL_PHBFLTREN_SHIFT (6U) 986 #define FTM_QDCTRL_PHBFLTREN_WIDTH (1U) 987 #define FTM_QDCTRL_PHBFLTREN(x) (((uint32_t)(((uint32_t)(x)) << FTM_QDCTRL_PHBFLTREN_SHIFT)) & FTM_QDCTRL_PHBFLTREN_MASK) 988 989 #define FTM_QDCTRL_PHAFLTREN_MASK (0x80U) 990 #define FTM_QDCTRL_PHAFLTREN_SHIFT (7U) 991 #define FTM_QDCTRL_PHAFLTREN_WIDTH (1U) 992 #define FTM_QDCTRL_PHAFLTREN(x) (((uint32_t)(((uint32_t)(x)) << FTM_QDCTRL_PHAFLTREN_SHIFT)) & FTM_QDCTRL_PHAFLTREN_MASK) 993 /*! @} */ 994 995 /*! @name CONF - Configuration */ 996 /*! @{ */ 997 998 #define FTM_CONF_LDFQ_MASK (0x1FU) 999 #define FTM_CONF_LDFQ_SHIFT (0U) 1000 #define FTM_CONF_LDFQ_WIDTH (5U) 1001 #define FTM_CONF_LDFQ(x) (((uint32_t)(((uint32_t)(x)) << FTM_CONF_LDFQ_SHIFT)) & FTM_CONF_LDFQ_MASK) 1002 1003 #define FTM_CONF_BDMMODE_MASK (0xC0U) 1004 #define FTM_CONF_BDMMODE_SHIFT (6U) 1005 #define FTM_CONF_BDMMODE_WIDTH (2U) 1006 #define FTM_CONF_BDMMODE(x) (((uint32_t)(((uint32_t)(x)) << FTM_CONF_BDMMODE_SHIFT)) & FTM_CONF_BDMMODE_MASK) 1007 1008 #define FTM_CONF_GTBEEN_MASK (0x200U) 1009 #define FTM_CONF_GTBEEN_SHIFT (9U) 1010 #define FTM_CONF_GTBEEN_WIDTH (1U) 1011 #define FTM_CONF_GTBEEN(x) (((uint32_t)(((uint32_t)(x)) << FTM_CONF_GTBEEN_SHIFT)) & FTM_CONF_GTBEEN_MASK) 1012 1013 #define FTM_CONF_GTBEOUT_MASK (0x400U) 1014 #define FTM_CONF_GTBEOUT_SHIFT (10U) 1015 #define FTM_CONF_GTBEOUT_WIDTH (1U) 1016 #define FTM_CONF_GTBEOUT(x) (((uint32_t)(((uint32_t)(x)) << FTM_CONF_GTBEOUT_SHIFT)) & FTM_CONF_GTBEOUT_MASK) 1017 1018 #define FTM_CONF_ITRIGR_MASK (0x800U) 1019 #define FTM_CONF_ITRIGR_SHIFT (11U) 1020 #define FTM_CONF_ITRIGR_WIDTH (1U) 1021 #define FTM_CONF_ITRIGR(x) (((uint32_t)(((uint32_t)(x)) << FTM_CONF_ITRIGR_SHIFT)) & FTM_CONF_ITRIGR_MASK) 1022 /*! @} */ 1023 1024 /*! @name FLTPOL - FTM Fault Input Polarity */ 1025 /*! @{ */ 1026 1027 #define FTM_FLTPOL_FLT0POL_MASK (0x1U) 1028 #define FTM_FLTPOL_FLT0POL_SHIFT (0U) 1029 #define FTM_FLTPOL_FLT0POL_WIDTH (1U) 1030 #define FTM_FLTPOL_FLT0POL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTPOL_FLT0POL_SHIFT)) & FTM_FLTPOL_FLT0POL_MASK) 1031 1032 #define FTM_FLTPOL_FLT1POL_MASK (0x2U) 1033 #define FTM_FLTPOL_FLT1POL_SHIFT (1U) 1034 #define FTM_FLTPOL_FLT1POL_WIDTH (1U) 1035 #define FTM_FLTPOL_FLT1POL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTPOL_FLT1POL_SHIFT)) & FTM_FLTPOL_FLT1POL_MASK) 1036 1037 #define FTM_FLTPOL_FLT2POL_MASK (0x4U) 1038 #define FTM_FLTPOL_FLT2POL_SHIFT (2U) 1039 #define FTM_FLTPOL_FLT2POL_WIDTH (1U) 1040 #define FTM_FLTPOL_FLT2POL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTPOL_FLT2POL_SHIFT)) & FTM_FLTPOL_FLT2POL_MASK) 1041 1042 #define FTM_FLTPOL_FLT3POL_MASK (0x8U) 1043 #define FTM_FLTPOL_FLT3POL_SHIFT (3U) 1044 #define FTM_FLTPOL_FLT3POL_WIDTH (1U) 1045 #define FTM_FLTPOL_FLT3POL(x) (((uint32_t)(((uint32_t)(x)) << FTM_FLTPOL_FLT3POL_SHIFT)) & FTM_FLTPOL_FLT3POL_MASK) 1046 /*! @} */ 1047 1048 /*! @name SYNCONF - Synchronization Configuration */ 1049 /*! @{ */ 1050 1051 #define FTM_SYNCONF_HWTRIGMODE_MASK (0x1U) 1052 #define FTM_SYNCONF_HWTRIGMODE_SHIFT (0U) 1053 #define FTM_SYNCONF_HWTRIGMODE_WIDTH (1U) 1054 #define FTM_SYNCONF_HWTRIGMODE(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_HWTRIGMODE_SHIFT)) & FTM_SYNCONF_HWTRIGMODE_MASK) 1055 1056 #define FTM_SYNCONF_CNTINC_MASK (0x4U) 1057 #define FTM_SYNCONF_CNTINC_SHIFT (2U) 1058 #define FTM_SYNCONF_CNTINC_WIDTH (1U) 1059 #define FTM_SYNCONF_CNTINC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_CNTINC_SHIFT)) & FTM_SYNCONF_CNTINC_MASK) 1060 1061 #define FTM_SYNCONF_INVC_MASK (0x10U) 1062 #define FTM_SYNCONF_INVC_SHIFT (4U) 1063 #define FTM_SYNCONF_INVC_WIDTH (1U) 1064 #define FTM_SYNCONF_INVC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_INVC_SHIFT)) & FTM_SYNCONF_INVC_MASK) 1065 1066 #define FTM_SYNCONF_SWOC_MASK (0x20U) 1067 #define FTM_SYNCONF_SWOC_SHIFT (5U) 1068 #define FTM_SYNCONF_SWOC_WIDTH (1U) 1069 #define FTM_SYNCONF_SWOC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_SWOC_SHIFT)) & FTM_SYNCONF_SWOC_MASK) 1070 1071 #define FTM_SYNCONF_SYNCMODE_MASK (0x80U) 1072 #define FTM_SYNCONF_SYNCMODE_SHIFT (7U) 1073 #define FTM_SYNCONF_SYNCMODE_WIDTH (1U) 1074 #define FTM_SYNCONF_SYNCMODE(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_SYNCMODE_SHIFT)) & FTM_SYNCONF_SYNCMODE_MASK) 1075 1076 #define FTM_SYNCONF_SWRSTCNT_MASK (0x100U) 1077 #define FTM_SYNCONF_SWRSTCNT_SHIFT (8U) 1078 #define FTM_SYNCONF_SWRSTCNT_WIDTH (1U) 1079 #define FTM_SYNCONF_SWRSTCNT(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_SWRSTCNT_SHIFT)) & FTM_SYNCONF_SWRSTCNT_MASK) 1080 1081 #define FTM_SYNCONF_SWWRBUF_MASK (0x200U) 1082 #define FTM_SYNCONF_SWWRBUF_SHIFT (9U) 1083 #define FTM_SYNCONF_SWWRBUF_WIDTH (1U) 1084 #define FTM_SYNCONF_SWWRBUF(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_SWWRBUF_SHIFT)) & FTM_SYNCONF_SWWRBUF_MASK) 1085 1086 #define FTM_SYNCONF_SWOM_MASK (0x400U) 1087 #define FTM_SYNCONF_SWOM_SHIFT (10U) 1088 #define FTM_SYNCONF_SWOM_WIDTH (1U) 1089 #define FTM_SYNCONF_SWOM(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_SWOM_SHIFT)) & FTM_SYNCONF_SWOM_MASK) 1090 1091 #define FTM_SYNCONF_SWINVC_MASK (0x800U) 1092 #define FTM_SYNCONF_SWINVC_SHIFT (11U) 1093 #define FTM_SYNCONF_SWINVC_WIDTH (1U) 1094 #define FTM_SYNCONF_SWINVC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_SWINVC_SHIFT)) & FTM_SYNCONF_SWINVC_MASK) 1095 1096 #define FTM_SYNCONF_SWSOC_MASK (0x1000U) 1097 #define FTM_SYNCONF_SWSOC_SHIFT (12U) 1098 #define FTM_SYNCONF_SWSOC_WIDTH (1U) 1099 #define FTM_SYNCONF_SWSOC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_SWSOC_SHIFT)) & FTM_SYNCONF_SWSOC_MASK) 1100 1101 #define FTM_SYNCONF_HWRSTCNT_MASK (0x10000U) 1102 #define FTM_SYNCONF_HWRSTCNT_SHIFT (16U) 1103 #define FTM_SYNCONF_HWRSTCNT_WIDTH (1U) 1104 #define FTM_SYNCONF_HWRSTCNT(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_HWRSTCNT_SHIFT)) & FTM_SYNCONF_HWRSTCNT_MASK) 1105 1106 #define FTM_SYNCONF_HWWRBUF_MASK (0x20000U) 1107 #define FTM_SYNCONF_HWWRBUF_SHIFT (17U) 1108 #define FTM_SYNCONF_HWWRBUF_WIDTH (1U) 1109 #define FTM_SYNCONF_HWWRBUF(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_HWWRBUF_SHIFT)) & FTM_SYNCONF_HWWRBUF_MASK) 1110 1111 #define FTM_SYNCONF_HWOM_MASK (0x40000U) 1112 #define FTM_SYNCONF_HWOM_SHIFT (18U) 1113 #define FTM_SYNCONF_HWOM_WIDTH (1U) 1114 #define FTM_SYNCONF_HWOM(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_HWOM_SHIFT)) & FTM_SYNCONF_HWOM_MASK) 1115 1116 #define FTM_SYNCONF_HWINVC_MASK (0x80000U) 1117 #define FTM_SYNCONF_HWINVC_SHIFT (19U) 1118 #define FTM_SYNCONF_HWINVC_WIDTH (1U) 1119 #define FTM_SYNCONF_HWINVC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_HWINVC_SHIFT)) & FTM_SYNCONF_HWINVC_MASK) 1120 1121 #define FTM_SYNCONF_HWSOC_MASK (0x100000U) 1122 #define FTM_SYNCONF_HWSOC_SHIFT (20U) 1123 #define FTM_SYNCONF_HWSOC_WIDTH (1U) 1124 #define FTM_SYNCONF_HWSOC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SYNCONF_HWSOC_SHIFT)) & FTM_SYNCONF_HWSOC_MASK) 1125 /*! @} */ 1126 1127 /*! @name INVCTRL - FTM Inverting Control */ 1128 /*! @{ */ 1129 1130 #define FTM_INVCTRL_INV0EN_MASK (0x1U) 1131 #define FTM_INVCTRL_INV0EN_SHIFT (0U) 1132 #define FTM_INVCTRL_INV0EN_WIDTH (1U) 1133 #define FTM_INVCTRL_INV0EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_INVCTRL_INV0EN_SHIFT)) & FTM_INVCTRL_INV0EN_MASK) 1134 1135 #define FTM_INVCTRL_INV1EN_MASK (0x2U) 1136 #define FTM_INVCTRL_INV1EN_SHIFT (1U) 1137 #define FTM_INVCTRL_INV1EN_WIDTH (1U) 1138 #define FTM_INVCTRL_INV1EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_INVCTRL_INV1EN_SHIFT)) & FTM_INVCTRL_INV1EN_MASK) 1139 1140 #define FTM_INVCTRL_INV2EN_MASK (0x4U) 1141 #define FTM_INVCTRL_INV2EN_SHIFT (2U) 1142 #define FTM_INVCTRL_INV2EN_WIDTH (1U) 1143 #define FTM_INVCTRL_INV2EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_INVCTRL_INV2EN_SHIFT)) & FTM_INVCTRL_INV2EN_MASK) 1144 1145 #define FTM_INVCTRL_INV3EN_MASK (0x8U) 1146 #define FTM_INVCTRL_INV3EN_SHIFT (3U) 1147 #define FTM_INVCTRL_INV3EN_WIDTH (1U) 1148 #define FTM_INVCTRL_INV3EN(x) (((uint32_t)(((uint32_t)(x)) << FTM_INVCTRL_INV3EN_SHIFT)) & FTM_INVCTRL_INV3EN_MASK) 1149 /*! @} */ 1150 1151 /*! @name SWOCTRL - FTM Software Output Control */ 1152 /*! @{ */ 1153 1154 #define FTM_SWOCTRL_CH0OC_MASK (0x1U) 1155 #define FTM_SWOCTRL_CH0OC_SHIFT (0U) 1156 #define FTM_SWOCTRL_CH0OC_WIDTH (1U) 1157 #define FTM_SWOCTRL_CH0OC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH0OC_SHIFT)) & FTM_SWOCTRL_CH0OC_MASK) 1158 1159 #define FTM_SWOCTRL_CH1OC_MASK (0x2U) 1160 #define FTM_SWOCTRL_CH1OC_SHIFT (1U) 1161 #define FTM_SWOCTRL_CH1OC_WIDTH (1U) 1162 #define FTM_SWOCTRL_CH1OC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH1OC_SHIFT)) & FTM_SWOCTRL_CH1OC_MASK) 1163 1164 #define FTM_SWOCTRL_CH2OC_MASK (0x4U) 1165 #define FTM_SWOCTRL_CH2OC_SHIFT (2U) 1166 #define FTM_SWOCTRL_CH2OC_WIDTH (1U) 1167 #define FTM_SWOCTRL_CH2OC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH2OC_SHIFT)) & FTM_SWOCTRL_CH2OC_MASK) 1168 1169 #define FTM_SWOCTRL_CH3OC_MASK (0x8U) 1170 #define FTM_SWOCTRL_CH3OC_SHIFT (3U) 1171 #define FTM_SWOCTRL_CH3OC_WIDTH (1U) 1172 #define FTM_SWOCTRL_CH3OC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH3OC_SHIFT)) & FTM_SWOCTRL_CH3OC_MASK) 1173 1174 #define FTM_SWOCTRL_CH4OC_MASK (0x10U) 1175 #define FTM_SWOCTRL_CH4OC_SHIFT (4U) 1176 #define FTM_SWOCTRL_CH4OC_WIDTH (1U) 1177 #define FTM_SWOCTRL_CH4OC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH4OC_SHIFT)) & FTM_SWOCTRL_CH4OC_MASK) 1178 1179 #define FTM_SWOCTRL_CH5OC_MASK (0x20U) 1180 #define FTM_SWOCTRL_CH5OC_SHIFT (5U) 1181 #define FTM_SWOCTRL_CH5OC_WIDTH (1U) 1182 #define FTM_SWOCTRL_CH5OC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH5OC_SHIFT)) & FTM_SWOCTRL_CH5OC_MASK) 1183 1184 #define FTM_SWOCTRL_CH6OC_MASK (0x40U) 1185 #define FTM_SWOCTRL_CH6OC_SHIFT (6U) 1186 #define FTM_SWOCTRL_CH6OC_WIDTH (1U) 1187 #define FTM_SWOCTRL_CH6OC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH6OC_SHIFT)) & FTM_SWOCTRL_CH6OC_MASK) 1188 1189 #define FTM_SWOCTRL_CH7OC_MASK (0x80U) 1190 #define FTM_SWOCTRL_CH7OC_SHIFT (7U) 1191 #define FTM_SWOCTRL_CH7OC_WIDTH (1U) 1192 #define FTM_SWOCTRL_CH7OC(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH7OC_SHIFT)) & FTM_SWOCTRL_CH7OC_MASK) 1193 1194 #define FTM_SWOCTRL_CH0OCV_MASK (0x100U) 1195 #define FTM_SWOCTRL_CH0OCV_SHIFT (8U) 1196 #define FTM_SWOCTRL_CH0OCV_WIDTH (1U) 1197 #define FTM_SWOCTRL_CH0OCV(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH0OCV_SHIFT)) & FTM_SWOCTRL_CH0OCV_MASK) 1198 1199 #define FTM_SWOCTRL_CH1OCV_MASK (0x200U) 1200 #define FTM_SWOCTRL_CH1OCV_SHIFT (9U) 1201 #define FTM_SWOCTRL_CH1OCV_WIDTH (1U) 1202 #define FTM_SWOCTRL_CH1OCV(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH1OCV_SHIFT)) & FTM_SWOCTRL_CH1OCV_MASK) 1203 1204 #define FTM_SWOCTRL_CH2OCV_MASK (0x400U) 1205 #define FTM_SWOCTRL_CH2OCV_SHIFT (10U) 1206 #define FTM_SWOCTRL_CH2OCV_WIDTH (1U) 1207 #define FTM_SWOCTRL_CH2OCV(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH2OCV_SHIFT)) & FTM_SWOCTRL_CH2OCV_MASK) 1208 1209 #define FTM_SWOCTRL_CH3OCV_MASK (0x800U) 1210 #define FTM_SWOCTRL_CH3OCV_SHIFT (11U) 1211 #define FTM_SWOCTRL_CH3OCV_WIDTH (1U) 1212 #define FTM_SWOCTRL_CH3OCV(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH3OCV_SHIFT)) & FTM_SWOCTRL_CH3OCV_MASK) 1213 1214 #define FTM_SWOCTRL_CH4OCV_MASK (0x1000U) 1215 #define FTM_SWOCTRL_CH4OCV_SHIFT (12U) 1216 #define FTM_SWOCTRL_CH4OCV_WIDTH (1U) 1217 #define FTM_SWOCTRL_CH4OCV(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH4OCV_SHIFT)) & FTM_SWOCTRL_CH4OCV_MASK) 1218 1219 #define FTM_SWOCTRL_CH5OCV_MASK (0x2000U) 1220 #define FTM_SWOCTRL_CH5OCV_SHIFT (13U) 1221 #define FTM_SWOCTRL_CH5OCV_WIDTH (1U) 1222 #define FTM_SWOCTRL_CH5OCV(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH5OCV_SHIFT)) & FTM_SWOCTRL_CH5OCV_MASK) 1223 1224 #define FTM_SWOCTRL_CH6OCV_MASK (0x4000U) 1225 #define FTM_SWOCTRL_CH6OCV_SHIFT (14U) 1226 #define FTM_SWOCTRL_CH6OCV_WIDTH (1U) 1227 #define FTM_SWOCTRL_CH6OCV(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH6OCV_SHIFT)) & FTM_SWOCTRL_CH6OCV_MASK) 1228 1229 #define FTM_SWOCTRL_CH7OCV_MASK (0x8000U) 1230 #define FTM_SWOCTRL_CH7OCV_SHIFT (15U) 1231 #define FTM_SWOCTRL_CH7OCV_WIDTH (1U) 1232 #define FTM_SWOCTRL_CH7OCV(x) (((uint32_t)(((uint32_t)(x)) << FTM_SWOCTRL_CH7OCV_SHIFT)) & FTM_SWOCTRL_CH7OCV_MASK) 1233 /*! @} */ 1234 1235 /*! @name PWMLOAD - FTM PWM Load */ 1236 /*! @{ */ 1237 1238 #define FTM_PWMLOAD_CH0SEL_MASK (0x1U) 1239 #define FTM_PWMLOAD_CH0SEL_SHIFT (0U) 1240 #define FTM_PWMLOAD_CH0SEL_WIDTH (1U) 1241 #define FTM_PWMLOAD_CH0SEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_CH0SEL_SHIFT)) & FTM_PWMLOAD_CH0SEL_MASK) 1242 1243 #define FTM_PWMLOAD_CH1SEL_MASK (0x2U) 1244 #define FTM_PWMLOAD_CH1SEL_SHIFT (1U) 1245 #define FTM_PWMLOAD_CH1SEL_WIDTH (1U) 1246 #define FTM_PWMLOAD_CH1SEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_CH1SEL_SHIFT)) & FTM_PWMLOAD_CH1SEL_MASK) 1247 1248 #define FTM_PWMLOAD_CH2SEL_MASK (0x4U) 1249 #define FTM_PWMLOAD_CH2SEL_SHIFT (2U) 1250 #define FTM_PWMLOAD_CH2SEL_WIDTH (1U) 1251 #define FTM_PWMLOAD_CH2SEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_CH2SEL_SHIFT)) & FTM_PWMLOAD_CH2SEL_MASK) 1252 1253 #define FTM_PWMLOAD_CH3SEL_MASK (0x8U) 1254 #define FTM_PWMLOAD_CH3SEL_SHIFT (3U) 1255 #define FTM_PWMLOAD_CH3SEL_WIDTH (1U) 1256 #define FTM_PWMLOAD_CH3SEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_CH3SEL_SHIFT)) & FTM_PWMLOAD_CH3SEL_MASK) 1257 1258 #define FTM_PWMLOAD_CH4SEL_MASK (0x10U) 1259 #define FTM_PWMLOAD_CH4SEL_SHIFT (4U) 1260 #define FTM_PWMLOAD_CH4SEL_WIDTH (1U) 1261 #define FTM_PWMLOAD_CH4SEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_CH4SEL_SHIFT)) & FTM_PWMLOAD_CH4SEL_MASK) 1262 1263 #define FTM_PWMLOAD_CH5SEL_MASK (0x20U) 1264 #define FTM_PWMLOAD_CH5SEL_SHIFT (5U) 1265 #define FTM_PWMLOAD_CH5SEL_WIDTH (1U) 1266 #define FTM_PWMLOAD_CH5SEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_CH5SEL_SHIFT)) & FTM_PWMLOAD_CH5SEL_MASK) 1267 1268 #define FTM_PWMLOAD_CH6SEL_MASK (0x40U) 1269 #define FTM_PWMLOAD_CH6SEL_SHIFT (6U) 1270 #define FTM_PWMLOAD_CH6SEL_WIDTH (1U) 1271 #define FTM_PWMLOAD_CH6SEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_CH6SEL_SHIFT)) & FTM_PWMLOAD_CH6SEL_MASK) 1272 1273 #define FTM_PWMLOAD_CH7SEL_MASK (0x80U) 1274 #define FTM_PWMLOAD_CH7SEL_SHIFT (7U) 1275 #define FTM_PWMLOAD_CH7SEL_WIDTH (1U) 1276 #define FTM_PWMLOAD_CH7SEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_CH7SEL_SHIFT)) & FTM_PWMLOAD_CH7SEL_MASK) 1277 1278 #define FTM_PWMLOAD_HCSEL_MASK (0x100U) 1279 #define FTM_PWMLOAD_HCSEL_SHIFT (8U) 1280 #define FTM_PWMLOAD_HCSEL_WIDTH (1U) 1281 #define FTM_PWMLOAD_HCSEL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_HCSEL_SHIFT)) & FTM_PWMLOAD_HCSEL_MASK) 1282 1283 #define FTM_PWMLOAD_LDOK_MASK (0x200U) 1284 #define FTM_PWMLOAD_LDOK_SHIFT (9U) 1285 #define FTM_PWMLOAD_LDOK_WIDTH (1U) 1286 #define FTM_PWMLOAD_LDOK(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_LDOK_SHIFT)) & FTM_PWMLOAD_LDOK_MASK) 1287 1288 #define FTM_PWMLOAD_GLEN_MASK (0x400U) 1289 #define FTM_PWMLOAD_GLEN_SHIFT (10U) 1290 #define FTM_PWMLOAD_GLEN_WIDTH (1U) 1291 #define FTM_PWMLOAD_GLEN(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_GLEN_SHIFT)) & FTM_PWMLOAD_GLEN_MASK) 1292 1293 #define FTM_PWMLOAD_GLDOK_MASK (0x800U) 1294 #define FTM_PWMLOAD_GLDOK_SHIFT (11U) 1295 #define FTM_PWMLOAD_GLDOK_WIDTH (1U) 1296 #define FTM_PWMLOAD_GLDOK(x) (((uint32_t)(((uint32_t)(x)) << FTM_PWMLOAD_GLDOK_SHIFT)) & FTM_PWMLOAD_GLDOK_MASK) 1297 /*! @} */ 1298 1299 /*! @name HCR - Half Cycle Register */ 1300 /*! @{ */ 1301 1302 #define FTM_HCR_HCVAL_MASK (0xFFFFU) 1303 #define FTM_HCR_HCVAL_SHIFT (0U) 1304 #define FTM_HCR_HCVAL_WIDTH (16U) 1305 #define FTM_HCR_HCVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_HCR_HCVAL_SHIFT)) & FTM_HCR_HCVAL_MASK) 1306 /*! @} */ 1307 1308 /*! @name PAIR0DEADTIME - Pair 0 Deadtime Configuration */ 1309 /*! @{ */ 1310 1311 #define FTM_PAIR0DEADTIME_DTVAL_MASK (0x3FU) 1312 #define FTM_PAIR0DEADTIME_DTVAL_SHIFT (0U) 1313 #define FTM_PAIR0DEADTIME_DTVAL_WIDTH (6U) 1314 #define FTM_PAIR0DEADTIME_DTVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR0DEADTIME_DTVAL_SHIFT)) & FTM_PAIR0DEADTIME_DTVAL_MASK) 1315 1316 #define FTM_PAIR0DEADTIME_DTPS_MASK (0xC0U) 1317 #define FTM_PAIR0DEADTIME_DTPS_SHIFT (6U) 1318 #define FTM_PAIR0DEADTIME_DTPS_WIDTH (2U) 1319 #define FTM_PAIR0DEADTIME_DTPS(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR0DEADTIME_DTPS_SHIFT)) & FTM_PAIR0DEADTIME_DTPS_MASK) 1320 1321 #define FTM_PAIR0DEADTIME_DTVALEX_MASK (0xF0000U) 1322 #define FTM_PAIR0DEADTIME_DTVALEX_SHIFT (16U) 1323 #define FTM_PAIR0DEADTIME_DTVALEX_WIDTH (4U) 1324 #define FTM_PAIR0DEADTIME_DTVALEX(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR0DEADTIME_DTVALEX_SHIFT)) & FTM_PAIR0DEADTIME_DTVALEX_MASK) 1325 /*! @} */ 1326 1327 /*! @name PAIR1DEADTIME - Pair 1 Deadtime Configuration */ 1328 /*! @{ */ 1329 1330 #define FTM_PAIR1DEADTIME_DTVAL_MASK (0x3FU) 1331 #define FTM_PAIR1DEADTIME_DTVAL_SHIFT (0U) 1332 #define FTM_PAIR1DEADTIME_DTVAL_WIDTH (6U) 1333 #define FTM_PAIR1DEADTIME_DTVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR1DEADTIME_DTVAL_SHIFT)) & FTM_PAIR1DEADTIME_DTVAL_MASK) 1334 1335 #define FTM_PAIR1DEADTIME_DTPS_MASK (0xC0U) 1336 #define FTM_PAIR1DEADTIME_DTPS_SHIFT (6U) 1337 #define FTM_PAIR1DEADTIME_DTPS_WIDTH (2U) 1338 #define FTM_PAIR1DEADTIME_DTPS(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR1DEADTIME_DTPS_SHIFT)) & FTM_PAIR1DEADTIME_DTPS_MASK) 1339 1340 #define FTM_PAIR1DEADTIME_DTVALEX_MASK (0xF0000U) 1341 #define FTM_PAIR1DEADTIME_DTVALEX_SHIFT (16U) 1342 #define FTM_PAIR1DEADTIME_DTVALEX_WIDTH (4U) 1343 #define FTM_PAIR1DEADTIME_DTVALEX(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR1DEADTIME_DTVALEX_SHIFT)) & FTM_PAIR1DEADTIME_DTVALEX_MASK) 1344 /*! @} */ 1345 1346 /*! @name PAIR2DEADTIME - Pair 2 Deadtime Configuration */ 1347 /*! @{ */ 1348 1349 #define FTM_PAIR2DEADTIME_DTVAL_MASK (0x3FU) 1350 #define FTM_PAIR2DEADTIME_DTVAL_SHIFT (0U) 1351 #define FTM_PAIR2DEADTIME_DTVAL_WIDTH (6U) 1352 #define FTM_PAIR2DEADTIME_DTVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR2DEADTIME_DTVAL_SHIFT)) & FTM_PAIR2DEADTIME_DTVAL_MASK) 1353 1354 #define FTM_PAIR2DEADTIME_DTPS_MASK (0xC0U) 1355 #define FTM_PAIR2DEADTIME_DTPS_SHIFT (6U) 1356 #define FTM_PAIR2DEADTIME_DTPS_WIDTH (2U) 1357 #define FTM_PAIR2DEADTIME_DTPS(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR2DEADTIME_DTPS_SHIFT)) & FTM_PAIR2DEADTIME_DTPS_MASK) 1358 1359 #define FTM_PAIR2DEADTIME_DTVALEX_MASK (0xF0000U) 1360 #define FTM_PAIR2DEADTIME_DTVALEX_SHIFT (16U) 1361 #define FTM_PAIR2DEADTIME_DTVALEX_WIDTH (4U) 1362 #define FTM_PAIR2DEADTIME_DTVALEX(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR2DEADTIME_DTVALEX_SHIFT)) & FTM_PAIR2DEADTIME_DTVALEX_MASK) 1363 /*! @} */ 1364 1365 /*! @name PAIR3DEADTIME - Pair 3 Deadtime Configuration */ 1366 /*! @{ */ 1367 1368 #define FTM_PAIR3DEADTIME_DTVAL_MASK (0x3FU) 1369 #define FTM_PAIR3DEADTIME_DTVAL_SHIFT (0U) 1370 #define FTM_PAIR3DEADTIME_DTVAL_WIDTH (6U) 1371 #define FTM_PAIR3DEADTIME_DTVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR3DEADTIME_DTVAL_SHIFT)) & FTM_PAIR3DEADTIME_DTVAL_MASK) 1372 1373 #define FTM_PAIR3DEADTIME_DTPS_MASK (0xC0U) 1374 #define FTM_PAIR3DEADTIME_DTPS_SHIFT (6U) 1375 #define FTM_PAIR3DEADTIME_DTPS_WIDTH (2U) 1376 #define FTM_PAIR3DEADTIME_DTPS(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR3DEADTIME_DTPS_SHIFT)) & FTM_PAIR3DEADTIME_DTPS_MASK) 1377 1378 #define FTM_PAIR3DEADTIME_DTVALEX_MASK (0xF0000U) 1379 #define FTM_PAIR3DEADTIME_DTVALEX_SHIFT (16U) 1380 #define FTM_PAIR3DEADTIME_DTVALEX_WIDTH (4U) 1381 #define FTM_PAIR3DEADTIME_DTVALEX(x) (((uint32_t)(((uint32_t)(x)) << FTM_PAIR3DEADTIME_DTVALEX_SHIFT)) & FTM_PAIR3DEADTIME_DTVALEX_MASK) 1382 /*! @} */ 1383 1384 /*! @name MOD_MIRROR - Mirror of Modulo Value */ 1385 /*! @{ */ 1386 1387 #define FTM_MOD_MIRROR_FRACMOD_MASK (0xF800U) 1388 #define FTM_MOD_MIRROR_FRACMOD_SHIFT (11U) 1389 #define FTM_MOD_MIRROR_FRACMOD_WIDTH (5U) 1390 #define FTM_MOD_MIRROR_FRACMOD(x) (((uint32_t)(((uint32_t)(x)) << FTM_MOD_MIRROR_FRACMOD_SHIFT)) & FTM_MOD_MIRROR_FRACMOD_MASK) 1391 1392 #define FTM_MOD_MIRROR_MOD_MASK (0xFFFF0000U) 1393 #define FTM_MOD_MIRROR_MOD_SHIFT (16U) 1394 #define FTM_MOD_MIRROR_MOD_WIDTH (16U) 1395 #define FTM_MOD_MIRROR_MOD(x) (((uint32_t)(((uint32_t)(x)) << FTM_MOD_MIRROR_MOD_SHIFT)) & FTM_MOD_MIRROR_MOD_MASK) 1396 /*! @} */ 1397 1398 /*! @name CV_MIRROR - Mirror of Channel (n) Match Value */ 1399 /*! @{ */ 1400 1401 #define FTM_CV_MIRROR_FRACVAL_MASK (0xF800U) 1402 #define FTM_CV_MIRROR_FRACVAL_SHIFT (11U) 1403 #define FTM_CV_MIRROR_FRACVAL_WIDTH (5U) 1404 #define FTM_CV_MIRROR_FRACVAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_CV_MIRROR_FRACVAL_SHIFT)) & FTM_CV_MIRROR_FRACVAL_MASK) 1405 1406 #define FTM_CV_MIRROR_VAL_MASK (0xFFFF0000U) 1407 #define FTM_CV_MIRROR_VAL_SHIFT (16U) 1408 #define FTM_CV_MIRROR_VAL_WIDTH (16U) 1409 #define FTM_CV_MIRROR_VAL(x) (((uint32_t)(((uint32_t)(x)) << FTM_CV_MIRROR_VAL_SHIFT)) & FTM_CV_MIRROR_VAL_MASK) 1410 /*! @} */ 1411 1412 /*! 1413 * @} 1414 */ /* end of group FTM_Register_Masks */ 1415 1416 /*! 1417 * @} 1418 */ /* end of group FTM_Peripheral_Access_Layer */ 1419 1420 #endif /* #if !defined(S32K146_FTM_H_) */ 1421