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