eFlexPwm
Arduino eFlexPwm library for Teensy 4.x
nxp-enums-struct.h
1 /*
2  Copyright (c) 2015, Freescale Semiconductor, Inc.
3  Copyright 2016-2022 NXP
4  All rights reserved.
5 
6  SPDX-License-Identifier: BSD-3-Clause
7 */
8 #pragma once
9 
23 typedef enum _pwm_submodule {
29 
31 typedef enum _pwm_channels {
32  kPWM_PwmB = 0U,
33  kPWM_PwmA,
34  kPWM_PwmX
36 
38 typedef enum _pwm_value_register {
46 
54  kPWM_ValueRegisterMask_5 = (1U << 5)
55 };
56 
58 typedef enum _pwm_clock_source {
63 
65 typedef enum _pwm_clock_prescale {
75 
88 
90 typedef enum _pwm_output_state {
97 
99 typedef enum _pwm_init_source {
105 
107 typedef enum _pwm_load_frequency {
125 
127 typedef enum _pwm_fault_input {
131  kPWM_Fault_3
133 
135 typedef enum _pwm_fault_disable {
136  kPWM_FaultDisable_0 = (1U << 0),
137  kPWM_FaultDisable_1 = (1U << 1),
138  kPWM_FaultDisable_2 = (1U << 2),
139  kPWM_FaultDisable_3 = (1U << 3)
141 
143 typedef enum _pwm_fault_channels {
144  kPWM_faultchannel_0 = 0U,
145  kPWM_faultchannel_1
147 
155 
157 typedef enum _pwm_force_signal {
158  kPWM_UsePwm = 0U,
163 
170 
172 typedef enum _pwm_register_reload {
178 
186 
188 typedef enum _pwm_interrupt_enable {
206  kPWM_Fault3InterruptEnable = (1U << 19)
208 
210 typedef enum _pwm_status_flags {
211  kPWM_CompareVal0Flag = (1U << 0),
212  kPWM_CompareVal1Flag = (1U << 1),
213  kPWM_CompareVal2Flag = (1U << 2),
214  kPWM_CompareVal3Flag = (1U << 3),
215  kPWM_CompareVal4Flag = (1U << 4),
216  kPWM_CompareVal5Flag = (1U << 5),
217  kPWM_CaptureX0Flag = (1U << 6),
218  kPWM_CaptureX1Flag = (1U << 7),
219  kPWM_CaptureB0Flag = (1U << 8),
220  kPWM_CaptureB1Flag = (1U << 9),
221  kPWM_CaptureA0Flag = (1U << 10),
222  kPWM_CaptureA1Flag = (1U << 11),
223  kPWM_ReloadFlag = (1U << 12),
224  kPWM_ReloadErrorFlag = (1U << 13),
225  kPWM_RegUpdatedFlag = (1U << 14),
226  kPWM_Fault0Flag = (1U << 16),
227  kPWM_Fault1Flag = (1U << 17),
228  kPWM_Fault2Flag = (1U << 18),
229  kPWM_Fault3Flag = (1U << 19)
231 
233 typedef enum _pwm_dma_enable {
239  kPWM_CaptureA1DMAEnable = (1U << 5)
241 
249 
255 
257 typedef enum _pwm_mode {
263 
265 typedef enum _pwm_level_select {
267  kPWM_LowTrue
269 
271 typedef enum _pwm_fault_state {
273  0U,
278 
284 
286 typedef enum _pwm_fault_clear {
291 
293 typedef enum _pwm_module_control {
294  kPWM_Control_Module_0 = (1U << 0),
295  kPWM_Control_Module_1 = (1U << 1),
296  kPWM_Control_Module_2 = (1U << 2),
297  kPWM_Control_Module_3 = (1U << 3)
299  // end of nxp_enums
301 
303 typedef struct _pwm_signal_param {
309  uint16_t deadtimeValue;
313 
323 typedef struct _pwm_config {
326  #if !defined(FSL_FEATURE_PWM_HAS_NO_WAITEN) || (!FSL_FEATURE_PWM_HAS_NO_WAITEN)
327  bool enableWait;
329  #endif /* FSL_FEATURE_PWM_HAS_NO_WAITEN */
340 
348 
350 typedef struct _pwm_fault_param {
352  bool faultLevel;
358 
362 typedef struct _pwm_input_capture_param {
370  uint8_t fifoWatermark;
374  // end of nxp
struct _pwm_fault_param pwm_fault_param_t
Structure is used to hold the parameters to configure a PWM fault.
struct _pwm_input_capture_param pwm_input_capture_param_t
Structure is used to hold parameters to configure the capture capability of a signal pin.
struct _pwm_fault_input_filter_param pwm_fault_input_filter_param_t
Structure for the user to configure the fault input filter.
struct _pwm_config pwm_config_t
PWM config structure.
struct _pwm_signal_param pwm_signal_param_t
Structure for the user to define the PWM signal characteristics.
enum _pwm_load_frequency pwm_load_frequency_t
PWM load frequency selection.
_pwm_level_select
PWM output pulse mode, high-true or low-true.
enum _pwm_dma_source_select pwm_dma_source_select_t
List of PWM capture DMA enable source select.
enum _pwm_clock_source pwm_clock_source_t
PWM clock source selection.
_pwm_load_frequency
PWM load frequency selection.
enum _pwm_input_capture_edge pwm_input_capture_edge_t
PWM capture edge select.
_pwm_value_register_mask
List of PWM value registers mask.
enum _pwm_force_signal pwm_force_signal_t
PWM output options when a FORCE_OUT signal is asserted.
enum _pwm_status_flags pwm_status_flags_t
List of PWM status flags.
_pwm_value_register
List of PWM value registers.
_pwm_interrupt_enable
List of PWM interrupt options.
_pwm_fault_disable
List of PWM fault disable mapping selections.
enum _pwm_value_register pwm_value_register_t
List of PWM value registers.
_pwm_fault_channels
List of PWM fault channels.
enum _pwm_fault_recovery_mode pwm_fault_recovery_mode_t
Options available on how to re-enable the PWM output when recovering from a fault.
enum _pwm_output_state pwm_output_state_t
PWM channel output status.
enum _pwm_clock_prescale pwm_clock_prescale_t
PWM prescaler factor selection for clock source.
enum _pwm_fault_channels pwm_fault_channels_t
List of PWM fault channels.
_pwm_channels
List of PWM channels in each module.
_pwm_chnl_pair_operation
Options available for the PWM A & B pair operation.
_pwm_force_output_trigger
Options that can trigger a PWM FORCE_OUT.
_pwm_init_source
PWM counter initialization options.
_pwm_submodule
List of PWM submodules.
enum _pwm_channels pwm_channels_t
List of PWM channels in each module.
_pwm_watermark_control
PWM FIFO Watermark AND Control.
_pwm_dma_source_select
List of PWM capture DMA enable source select.
_pwm_mode
PWM operation mode.
_pwm_fault_recovery_mode
Options available on how to re-enable the PWM output when recovering from a fault.
enum _pwm_force_output_trigger pwm_force_output_trigger_t
Options that can trigger a PWM FORCE_OUT.
enum _pwm_submodule pwm_submodule_t
List of PWM submodules.
_pwm_register_reload
Options available on how to load the buffered-registers with new values.
_pwm_clock_prescale
PWM prescaler factor selection for clock source.
enum _pwm_reload_source_select pwm_reload_source_select_t
PWM reload source select.
enum _pwm_fault_disable pwm_fault_disable_t
List of PWM fault disable mapping selections.
enum _pwm_module_control pwm_module_control_t
Options for submodule master control operation.
enum _pwm_fault_state pwm_fault_state_t
PWM output fault status.
_pwm_force_signal
PWM output options when a FORCE_OUT signal is asserted.
enum _pwm_register_reload pwm_register_reload_t
Options available on how to load the buffered-registers with new values.
enum _pwm_init_source pwm_init_source_t
PWM counter initialization options.
enum _pwm_mode pwm_mode_t
PWM operation mode.
enum _pwm_fault_input pwm_fault_input_t
List of PWM fault selections.
enum _pwm_dma_enable pwm_dma_enable_t
List of PWM DMA options.
_pwm_status_flags
List of PWM status flags.
_pwm_output_state
PWM channel output status.
_pwm_fault_input
List of PWM fault selections.
enum _pwm_watermark_control pwm_watermark_control_t
PWM FIFO Watermark AND Control.
_pwm_input_capture_edge
PWM capture edge select.
_pwm_clock_source
PWM clock source selection.
_pwm_reload_source_select
PWM reload source select.
_pwm_fault_clear
PWM fault clearing options.
_pwm_module_control
Options for submodule master control operation.
_pwm_fault_state
PWM output fault status.
_pwm_dma_enable
List of PWM DMA options.
enum _pwm_chnl_pair_operation pwm_chnl_pair_operation_t
Options available for the PWM A & B pair operation.
enum _pwm_interrupt_enable pwm_interrupt_enable_t
List of PWM interrupt options.
enum _pwm_fault_clear pwm_fault_clear_t
PWM fault clearing options.
enum _pwm_level_select pwm_level_select_t
PWM output pulse mode, high-true or low-true.
@ kPWM_HighTrue
@ kPWM_LowTrue
@ kPWM_LoadEvery12Oportunity
@ kPWM_LoadEvery11Oportunity
@ kPWM_LoadEvery7Oportunity
@ kPWM_LoadEvery8Oportunity
@ kPWM_LoadEvery9Oportunity
@ kPWM_LoadEvery5Oportunity
@ kPWM_LoadEveryOportunity
@ kPWM_LoadEvery10Oportunity
@ kPWM_LoadEvery3Oportunity
@ kPWM_LoadEvery14Oportunity
@ kPWM_LoadEvery4Oportunity
@ kPWM_LoadEvery15Oportunity
@ kPWM_LoadEvery6Oportunity
@ kPWM_LoadEvery2Oportunity
@ kPWM_LoadEvery16Oportunity
@ kPWM_LoadEvery13Oportunity
@ kPWM_ValueRegisterMask_1
@ kPWM_ValueRegisterMask_3
@ kPWM_ValueRegisterMask_0
@ kPWM_ValueRegisterMask_5
@ kPWM_ValueRegisterMask_4
@ kPWM_ValueRegisterMask_2
@ kPWM_ValueRegister_0
@ kPWM_ValueRegister_1
@ kPWM_ValueRegister_3
@ kPWM_ValueRegister_4
@ kPWM_ValueRegister_5
@ kPWM_ValueRegister_2
@ kPWM_CompareVal3InterruptEnable
@ kPWM_CaptureA0InterruptEnable
@ kPWM_CompareVal1InterruptEnable
@ kPWM_ReloadErrorInterruptEnable
@ kPWM_Fault3InterruptEnable
@ kPWM_CaptureB0InterruptEnable
@ kPWM_CompareVal4InterruptEnable
@ kPWM_CaptureX1InterruptEnable
@ kPWM_CompareVal5InterruptEnable
@ kPWM_CompareVal0InterruptEnable
@ kPWM_CaptureX0InterruptEnable
@ kPWM_CaptureB1InterruptEnable
@ kPWM_ReloadInterruptEnable
@ kPWM_Fault0InterruptEnable
@ kPWM_Fault1InterruptEnable
@ kPWM_CaptureA1InterruptEnable
@ kPWM_CompareVal2InterruptEnable
@ kPWM_Fault2InterruptEnable
@ kPWM_FaultDisable_2
@ kPWM_FaultDisable_3
@ kPWM_FaultDisable_0
@ kPWM_FaultDisable_1
@ kPWM_ComplementaryPwmA
@ kPWM_ComplementaryPwmB
@ kPWM_Independent
@ kPWM_Force_External
@ kPWM_Force_ExternalSync
@ kPWM_Force_LocalReload
@ kPWM_Force_Local
@ kPWM_Force_LocalSync
@ kPWM_Force_Master
@ kPWM_Force_MasterReload
@ kPWM_Force_MasterSync
@ kPWM_Initialize_MasterReload
@ kPWM_Initialize_MasterSync
@ kPWM_Initialize_ExtSync
@ kPWM_Initialize_LocalSync
@ kPWM_Module_2
@ kPWM_Module_3
@ kPWM_Module_1
@ kPWM_Module_0
@ kPWM_FIFOWatermarksOR
@ kPWM_FIFOWatermarksAND
@ kPWM_DMALocalSync
@ kPWM_DMARequestDisable
@ kPWM_DMAWatermarksEnable
@ kPWM_DMALocalReload
@ kPWM_SignedEdgeAligned
@ kPWM_SignedCenterAligned
@ kPWM_CenterAligned
@ kPWM_EdgeAligned
@ kPWM_RecoverHalfAndFullCycle
@ kPWM_RecoverFullCycle
@ kPWM_RecoverHalfCycle
@ kPWM_NoRecovery
@ kPWM_ReloadImmediate
@ kPWM_ReloadPwmFullCycle
@ kPWM_ReloadPwmHalfCycle
@ kPWM_ReloadPwmHalfAndFullCycle
@ kPWM_Prescale_Divide_128
@ kPWM_Prescale_Divide_4
@ kPWM_Prescale_Divide_2
@ kPWM_Prescale_Divide_32
@ kPWM_Prescale_Divide_8
@ kPWM_Prescale_Divide_64
@ kPWM_Prescale_Divide_16
@ kPWM_Prescale_Divide_1
@ kPWM_UsePwm
@ kPWM_InvertedPwm
@ kPWM_SoftwareControl
@ kPWM_UseExternal
@ kPWM_CaptureB0Flag
@ kPWM_ReloadFlag
@ kPWM_CompareVal0Flag
@ kPWM_CompareVal4Flag
@ kPWM_ReloadErrorFlag
@ kPWM_CompareVal5Flag
@ kPWM_CompareVal1Flag
@ kPWM_CaptureA0Flag
@ kPWM_CaptureB1Flag
@ kPWM_CompareVal3Flag
@ kPWM_Fault2Flag
@ kPWM_Fault0Flag
@ kPWM_RegUpdatedFlag
@ kPWM_CaptureA1Flag
@ kPWM_CompareVal2Flag
@ kPWM_CaptureX1Flag
@ kPWM_Fault3Flag
@ kPWM_CaptureX0Flag
@ kPWM_Fault1Flag
@ kPWM_NormalState
@ kPWM_HighState
@ kPWM_MaskState
@ kPWM_InvertState
@ kPWM_LowState
@ kPWM_Fault_1
@ kPWM_Fault_3
@ kPWM_Fault_2
@ kPWM_Fault_0
@ kPWM_RiseAndFallEdge
@ kPWM_Disable
@ kPWM_RisingEdge
@ kPWM_FallingEdge
@ kPWM_ExternalClock
@ kPWM_BusClock
@ kPWM_Submodule0Clock
@ kPWM_MasterReload
@ kPWM_LocalReload
@ kPWM_ManualSafety
@ kPWM_ManualNormal
@ kPWM_Automatic
@ kPWM_Control_Module_0
@ kPWM_Control_Module_2
@ kPWM_Control_Module_1
@ kPWM_Control_Module_3
@ kPWM_PwmFaultState0
@ kPWM_PwmFaultState3
@ kPWM_PwmFaultState2
@ kPWM_PwmFaultState1
@ kPWM_CaptureB0DMAEnable
@ kPWM_CaptureA1DMAEnable
@ kPWM_CaptureX1DMAEnable
@ kPWM_CaptureX0DMAEnable
@ kPWM_CaptureB1DMAEnable
@ kPWM_CaptureA0DMAEnable
Structure for the user to define the PWM signal characteristics.
pwm_level_select_t level
pwm_channels_t pwmChannel
pwm_fault_state_t faultState
PWM config structure.
pwm_load_frequency_t reloadFrequency
pwm_clock_source_t clockSource
pwm_force_output_trigger_t forceTrigger
pwm_chnl_pair_operation_t pairOperation
pwm_clock_prescale_t prescale
pwm_register_reload_t reloadLogic
pwm_reload_source_select_t reloadSelect
pwm_init_source_t initializationControl
Structure for the user to configure the fault input filter.
Structure is used to hold the parameters to configure a PWM fault.
pwm_fault_clear_t faultClearingMode
pwm_fault_recovery_mode_t recoverMode
Structure is used to hold parameters to configure the capture capability of a signal pin.
pwm_input_capture_edge_t edge1
pwm_input_capture_edge_t edge0