Contain functions and data types as MCC extension for PWM. More...
Files | |
file | drv_custom_config_pwm.h |
Contains PWM initialization that was not supported by MCC generated code. | |
file | drv_mcc_extension_pwm.h |
Contains public functions and defines for the MCC code extension for PWM. | |
Functions | |
static __inline__ void | DRV_Config_Custom_PWM (void) |
Contains PWM initialization that was not supported by MCC generated code. | |
static void | PWM_PCI_Fault_AcceptanceCriteria (uint16_t pwmIndex, PWM_PCI_ACCEPTANCE_CRITERIA_t acpSetting) |
Set PCI fault acceptance criteria. | |
static void | PWM_PCI_Fault_AcceptanceQualiferInvert (uint16_t pwmIndex, bool invert) |
Set PCI polarity of PCI fault acceptance input. | |
static void | PWM_PCI_Sync_AcceptanceCriteria (uint16_t pwmIndex, PWM_PCI_ACCEPTANCE_CRITERIA_t acpSetting) |
Sets PCI Synchronization Acceptance Criteria. | |
static void | PWM_PCI_Fault_TimetoTerminateAfterEvent (uint16_t pwmIndex, PWM_PCI_TERMTIME_AFTER_EVENT_t faultTerm) |
Set TSYNCDIS bit to determine when PWM should stop after a fault occurs. | |
static void | PWM_PCI_Sync_TimetoTerminateAfterEvent (uint16_t pwmIndex, PWM_PCI_TERMTIME_AFTER_EVENT_t faultTerm) |
Set TSYNCDIS bit to determine when PWM should stop after a sync event occurs. | |
static void | PWM_StartOfCycleTrigger (uint16_t pwmIndex, PWM_SOCS_t triggerSource) |
Set SOCS field to determine start of cycle trigger. | |
static void | PWM_UPDREQ_Broadcast_Enable (uint16_t pwmIndex, bool enable) |
Enable broadcasting of UPDREQ bit to other PWMs. | |
static void | PWM_Data_Update_Mode (uint16_t pwmIndex, PWM_UPDMOD_t updateMode) |
Sets the PWM Data Update Mode. | |
static void | PWM_PCI_Source1 (uint16_t pwmIndex, PWM_PCI_SOURCE_t pciSource) |
Set PWM source for PCI selection bits (for PCI source 1) | |
static void | RPnR_VirtualPin_Source (RPnR_VIRTUAL_PIN_t virtualPin, RPnR_SOURCE_t peripheral) |
Set source for a virtual pin. | |
static void | PWM_PCI_INPUT_MaptoPin (PWM_PCI_INPUT_t pciIndex, RPx_INPUT_t pin) |
Map PWM PCI input to a pin. | |
static void | PWM_PCI_Sync_Source_Select (uint16_t pwmIndex, PWM_PCI_SOURCE_SELECT_t pciSource) |
Set PCI source (PSS field) for PCI Synchronization. | |
static void | PWM_PCI_Fault_AcceptanceQualifierSource (uint16_t pwmIndex, PWM_PCI_ACCEPTANCE_QUALIFER_t source) |
Set source of fault PCI acceptance qualifier. | |
static void | PWM_Trigger_Mode (uint16_t pwmIndex, PWM_TRIG_MODE_t trigMode) |
Set source of fault PCI acceptance qualifier. | |
static void | PWM_PCI_Sync_TerminationEventSelect (uint16_t pwmIndex, PWM_PCI_TERM_t termEvent) |
Select termination event for SYNC PCI. | |
static void | PWM_Swap_PWMxL_and_PWMxH (uint16_t pwmIndex, bool swapPWMH_PWML) |
Enable/Disable the PWM instance output swap bit. | |
static void | PWM_EVENTA_Configure (uint16_t pwmSource, PWM_EVENT_SOURCE_t eventSource, bool invert, bool outputEnable, bool stretchDisable, bool outputSync) |
Configure PWM Event A register. | |
static void | PWM_Data_Update_Trigger (uint16_t pwmIndex, PWM_UPDTRG_t updateTrigger) |
Set PWM Register update trigger. | |
static void | PWM_Fault_LatchMode (uint16_t pwmIndex, PWM_LATCH_MODE_t latchMode) |
Set the latch mode of fault PCI. | |
static void | PWM_Fault_DataMode (uint16_t pwmIndex, PWM_FAULT_DATA_t faultDataMode) |
Set the data mode of fault PCI. | |
This documentation includes functions and data types for the PWM peripheral as an enhancement to the MCC Code Configurator. It provides application-specific PWM functions and includes essential PWM initialization that is not supported by the code generated by MCC.
enum PWM_EVENT_SOURCE_e |
Definition at line 1091 of file drv_mcc_extension_pwm.h.
enum PWM_FAULT_DATA_e |
Enumerator | |
---|---|
PWM_FAULT_EVENT_PWMH | |
PWM_FAULT_EVENT_PWML |
Definition at line 1254 of file drv_mcc_extension_pwm.h.
enum PWM_LATCH_MODE_e |
Enumerator | |
---|---|
PWM_SET_DOMINANT_MODE | |
PWM_RESET_DOMINANT_MODE |
Definition at line 1199 of file drv_mcc_extension_pwm.h.
Enumerator | |
---|---|
PWM_PCI_ACCEPT_LEVEL_SENSITIVE | |
PWM_PCI_ACCEPT_RISING_EDGE | |
PWM_PCI_ACCEPT_ANY_EDGE | |
PWM_PCI_ACCEPT_LATCHED | |
PWM_PCI_ACCEPT_LATCHED_RISING_EDGE | |
PWM_PCI_ACCEPT_LATCHED_ANY_EDGE |
Definition at line 28 of file drv_mcc_extension_pwm.h.
Definition at line 867 of file drv_mcc_extension_pwm.h.
enum PWM_PCI_INPUT_e |
Enumerator | |
---|---|
PWM_PCI_INPUT8 | |
PWM_PCI_INPUT9 | |
PWM_PCI_INPUT10 | |
PWM_PCI_INPUT11 |
Definition at line 729 of file drv_mcc_extension_pwm.h.
enum PWM_PCI_SOURCE_e |
Enumerator | |
---|---|
PWM_PCI_SOURCE_PWM1 | |
PWM_PCI_SOURCE_PWM2 | |
PWM_PCI_SOURCE_PWM3 | |
PWM_PCI_SOURCE_PWM4 |
Definition at line 455 of file drv_mcc_extension_pwm.h.
Definition at line 778 of file drv_mcc_extension_pwm.h.
enum PWM_PCI_TERM_e |
Definition at line 985 of file drv_mcc_extension_pwm.h.
Enumerator | |
---|---|
PWM_PCI_TERMTIME_AFTER_EVENT_AT_EOC | |
PWM_PCI_TERMTIME_AFTER_EVENT_IMMEDIATE |
Definition at line 181 of file drv_mcc_extension_pwm.h.
enum PWM_SOCS_e |
Enumerator | |
---|---|
PWM_SOCS_SELF_TRIGGER | |
PWM_SOCS_PG1_OR_PG5 | |
PWM_SOCS_PG2_OR_PG6 | |
PWM_SOCS_PG3_OR_PG7 | |
PWM_SOCS_PG4_OR_PG8 | |
PWM_SOCS_TRIG_OR_PCI_SYNC |
Definition at line 284 of file drv_mcc_extension_pwm.h.
enum PWM_TRIG_MODE_e |
Enumerator | |
---|---|
PWM_TRIG_MODE_SINGLE | |
PWM_TRIG_MODE_RETRIGGERABLE |
Definition at line 930 of file drv_mcc_extension_pwm.h.
enum PWM_UPDMOD_e |
Enumerator | |
---|---|
PWM_UPDMOD_SOC | |
PWM_UPDMOD_IMMEDIATE | |
PWM_UPDMOD_CLIENT_SOC | |
PWM_UPDMOD_CLIENT_IMMEDIATE |
Definition at line 394 of file drv_mcc_extension_pwm.h.
enum PWM_UPDTRG_e |
Definition at line 1141 of file drv_mcc_extension_pwm.h.
enum RPnR_SOURCE_e |
Enumerator | |
---|---|
RPnR_SOURCE_DefaultPORT | RPn tied to Default Pin. |
RPnR_SOURCE_U1TX | RPn tied to UART1 Transmit. |
RPnR_SOURCE_U1RTS | RPn tied to UART1 Request-to-Send. |
RPnR_SOURCE_U2TX | RPn tied to UART2 Transmit. |
RPnR_SOURCE_U2RTS | RPn tied to UART2 Request-to-Send. |
RPnR_SOURCE_SDO1 | RPn tied to SPI1 Data Output. |
RPnR_SOURCE_SCK1 | RPn tied to SPI1 Clock Output. |
RPnR_SOURCE_SS1 | RPn tied to SPI1 Client Select. |
RPnR_SOURCE_SDO2 | RPn tied to SPI2 Data Output. |
RPnR_SOURCE_SCK2 | RPn tied to SPI2 Clock Output. |
RPnR_SOURCE_SS2 | RPn tied to SPI2 Client Select. |
RPnR_SOURCE_SDO3 | RPn tied to SPI3 Data Output. |
RPnR_SOURCE_SCK3 | RPn tied to SPI3 Clock Output. |
RPnR_SOURCE_SS3 | RPn tied to SPI3 Client Select. |
RPnR_SOURCE_REFCLKO | RPn tied to Reference Clock Output. |
RPnR_SOURCE_OCM1 | RPn tied to SCCP1 Output. |
RPnR_SOURCE_OCM2 | RPn tied to SCCP2 Output. |
RPnR_SOURCE_OCM3 | RPn tied to SCCP3 Output. |
RPnR_SOURCE_OCM4 | RPn tied to SCCP4 Output. |
RPnR_SOURCE_OCM5 | RPn tied to SCCP5 Output. |
RPnR_SOURCE_OCM6 | RPn tied to SCCP6 Output. |
RPnR_SOURCE_CAN1TX | RPn tied to CAN1 Transmit. |
RPnR_SOURCE_CMP1 | RPn tied to Comparator 1 Output. |
RPnR_SOURCE_CMP2 | RPn tied to Comparator 2 Output. |
RPnR_SOURCE_CMP3 | RPn tied to Comparator 3 Output. |
RPnR_SOURCE_U3TX | RPn tied to UART3 Transmit. |
RPnR_SOURCE_U3RTS | RPn tied to UART3 Request-to-Send. |
RPnR_SOURCE_PWM4H | RPn tied to PWM4H Output. |
RPnR_SOURCE_PWM4L | RPn tied to PWM4L Output. |
RPnR_SOURCE_PWMEA | RPn tied to PWM Event A Output. |
RPnR_SOURCE_PWMEB | RPn tied to PWM Event B Output. |
RPnR_SOURCE_QEICMP1 | RPn tied to QEI1 Comparator Output. |
RPnR_SOURCE_QEICMP2 | RPn tied to QEI2 Comparator Output. |
RPnR_SOURCE_CLC1OUT | RPn tied to CLC1 Output. |
RPnR_SOURCE_CLC2OUT | RPn tied to CLC2 Output. |
RPnR_SOURCE_OCM7 | RPn tied to SCCP7 Output. |
RPnR_SOURCE_OCM8 | RPn tied to SCCP8 Output. |
RPnR_SOURCE_PWMEC | RPn tied to PWM Event C Output. |
RPnR_SOURCE_PWMED | RPn tied to PWM Event D Output. |
RPnR_SOURCE_PTGTRG24 | PTG Trigger Output 24. |
RPnR_SOURCE_PTGTRG25 | PTG Trigger Output 25. |
RPnR_SOURCE_SENT1OUT | RPn tied to SENT1 Output. |
RPnR_SOURCE_SENT2OUT | RPn tied to SENT2 Output. |
RPnR_SOURCE_MCCP9A | RPn tied to MCCP9 Output A. |
RPnR_SOURCE_MCCP9B | RPn tied to MCCP9 Output B. |
RPnR_SOURCE_MCCP9C | RPn tied to MCCP9 Output C. |
RPnR_SOURCE_MCCP9D | RPn tied to MCCP9 Output D. |
RPnR_SOURCE_MCCP9E | RPn tied to MCCP9 Output E. |
RPnR_SOURCE_MCCP9F | RPn tied to MCCP9 Output F. |
RPnR_SOURCE_CLC3OUT | RPn tied to CLC4 Output. |
RPnR_SOURCE_CLC4OUT | RPn tied to CLC4 Output. |
RPnR_SOURCE_U1DTR | RPn tied to UART1 DTR. |
RPnR_SOURCE_U2DTR | RPn tied to UART2 DTR. |
RPnR_SOURCE_U3DTR | RPn tied to UART3 DTR |
Definition at line 519 of file drv_mcc_extension_pwm.h.
enum RPnR_VIRTUAL_PIN_e |
Enumerator | |
---|---|
RPnR_VIRTUAL_PIN_RP176 | |
RPnR_VIRTUAL_PIN_RP177 | |
RPnR_VIRTUAL_PIN_RP178 | |
RPnR_VIRTUAL_PIN_RP179 | |
RPnR_VIRTUAL_PIN_RP180 | |
RPnR_VIRTUAL_PIN_RP181 |
Definition at line 583 of file drv_mcc_extension_pwm.h.
enum RPx_INPUT_e |
Definition at line 651 of file drv_mcc_extension_pwm.h.
|
static |
This PWM initialization configures the PWM modules to be retriggerable for the cascaded PWM approach. Additionally, two PWM outputs were swapped to support the board's functionality.
Definition at line 24 of file drv_custom_config_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
updateMode | Pointer to a power control data object of type PWM_UPDMOD_t |
This function is used for register update synchronization between PWMs. Setting the MSTEN bit means that the UPDREQ flag is broadcast to other PWMs. If the UPDMOD field in the receiving PWM is set to "Client SOC" or "client immediate" then this will take effect and data update between different PWM modules can be implemented
Definition at line 416 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
updateTrigger | Pointer to a power control data object of type PWM_UPDTRG_t |
This function configures the PWM Event Trigger source for a particular PWM instance.
Definition at line 1160 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmSource | PWM instance |
eventSource | Pointer to a power control data object of type PWM_EVENT_SOURCE_t |
invert | PWM Event Output Polarity |
outputEnable | PWM Event Output Enable |
stretchDisable | PWM Event Output Stretch Disable |
outputSync | PWM Event Output Sync |
This function configures the PWM Event A (PWM event Output Control register).
Definition at line 1120 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
latch | Pointer to a power control data object of type PWM_FAULT_DATA_t |
This function configures the PWM instance data mode for fault PCI.
Definition at line 1270 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
latch | Pointer to a power control data object of type PWM_LATCH_MODE_t |
This function configures the PWM instance latch mode for fault PCI.
Definition at line 1215 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
acpSetting | Pointer to a power control data object of type PWM_PCI_ACCEPTANCE_CRITERIA_t |
This function sets the PCI fault Acceptance Criteria.
Definition at line 50 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
invert | Inverts the polarity |
This function configures the polarity of the PCI fault acceptance qualifier.
Definition at line 97 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
source | Pointer to a power control data object of type PWM_PCI_ACCEPTANCE_QUALIFER_t |
This function sets the PWM PCI Fault Acceptance qualifier source for a specific PWM instance.
Definition at line 891 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
acpSetting | Pointer to a power control data object of type PWM_PCI_TERMTIME_AFTER_EVENT_t |
This function the Termination Synchronization bit for a particular PWM Fault PCI instance.
Definition at line 198 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pciIndex | Pointer to a power control data object of type PWM_PCI_INPUT_t |
pin | Pointer to a power control data object of type RPx_INPUT_t |
This function maps thePCI input to a particular pin.
Definition at line 747 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
pciSource | Pointer to a power control data object of type PWM_PCI_SOURCE_t |
The selected PWM Generator source does not affect the LEB counter. This source can be optionally used as a PCI input, PCI qualifier, PCI terminator or PCI terminator qualifier
Definition at line 480 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
acpSetting | Pointer to a power control data object of type PWM_PCI_ACCEPTANCE_CRITERIA_t |
This function configures the PCI Synchronization Acceptance Criteria.
Definition at line 141 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
pciSource | Pointer to a power control data object of type PWM_PCI_SOURCE_SELECT_t |
This function set the PWM PCI Synchronization source.
Definition at line 826 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
termEvent | Pointer to a power control data object of type PWM_PCI_TERM_t |
This function configures the PWM PCI Synchronization Termination event.
Definition at line 1007 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
acpSetting | Pointer to a power control data object of type PWM_PCI_TERMTIME_AFTER_EVENT_t |
This function the Termination Synchronization bit for a particular PWM Synchronization PCI instance.
Definition at line 244 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
triggerSource | Pointer to a power control data object of type PWM_SOCS_t |
This function set the start-of-cycle of a particular PWM instance.
Definition at line 304 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
swapPWMH_PWML | enable/disable the PWM instance output swap bit |
This function configures the PWM output as swapped output (PWMH output -> PWML output; PWML output -> PWMH output).
Definition at line 1052 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
trigMode | Pointer to a power control data object of type PWM_TRIG_MODE_t |
This function configures the PWM instance trigger mode.
Definition at line 946 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
pwmIndex | PWM instance |
enable | enable the Master bit of a PWM instance |
This function is used for register update synchronization between PWMs. Setting the MSTEN bit means that the UPDREQ flag is broadcast to other PWMs. If the UPDMOD field in the receiving PWM is set to "Client SOC" or "client immediate" then this will take effect and data update between different PWM modules can be implemented
Definition at line 352 of file drv_mcc_extension_pwm.h.
|
inlinestatic |
virtualPin | Pointer to a power control data object of type RPnR_VIRTUAL_PIN_t |
peripheral | Pointer to a power control data object of type RPnR_SOURCE_t |
These pins provide a simple way for inter-peripheral connection without utilizing a physical pin. For example, the output of the analog comparator can be connected to RP176 and the PWM Fault input can be configured for RP176 as well. This configuration allows the analog comparator to trigger PWM Faults without the use of an actual physical pin on the device
Definition at line 609 of file drv_mcc_extension_pwm.h.