![]() |
MCUSW
|
This files defines PWM MCAL configuration structures
Data Structures | |
| struct | Pwm_ChannelConfigType_PC |
| Pwm channel configuration. More... | |
| struct | Pwm_ConfigType_PC |
| Pwm configuration structure. More... | |
| struct | Pwm_ChannelConfigType |
| Pwm channel configuration. More... | |
| struct | Pwm_ConfigType |
| Pwm configuration structure. More... | |
| struct | Pwm_RegisterReadbackType |
| PWM register readback structure. More... | |
Macros | |
| #define | PWM_PRE_COMPILE_VARIANT (STD_ON ) |
| PWM Build Variant. Build variants.(i.e Pre-compile,Post-build or Link time) More... | |
| #define | PWM_VARIANT_POST_BUILD (STD_OFF) |
PWM Driver State Values | |
| enum | Pwm_OutputStateType { PWM_LOW = 0U, PWM_HIGH } |
| Possible output states of a PWM channel. More... | |
| enum | Pwm_EdgeNotificationType { PWM_RISING_EDGE = 1U, PWM_FALLING_EDGE = 2U, PWM_BOTH_EDGES = 3U } |
| Possible edge notification More... | |
| enum | Pwm_ChannelClassType { PWM_FIXED_PERIOD = 0U, PWM_FIXED_PERIOD_SHIFTED, PWM_VARIABLE_PERIOD } |
| Period type for pwm channels. Fixed periods prohibit changes to the period length with Pwm_SetPeriod( ). PWM_FIXED_PERIOD_SHIFTED type is not supported due to hardware restrictions of the PWM unit. More... | |
| enum | Pwm_epwmOutputCh_t { EPWM_OUTPUT_CH_A = 0U, EPWM_OUTPUT_CH_B = 1U, EPWM_OUTPUT_CH_BOTH_A_AND_B = 2U } |
| EPWM outputs in a single epwm channel. More... | |
| typedef uint32 | Pwm_PeriodType |
| typedef of period value More... | |
| typedef uint32 | Pwm_ChannelType |
| PWM Channel type. More... | |
| typedef uint32 | Pwm_FrequencyType |
| typedef of frequency value (Frequency in Hz) More... | |
| typedef void(* | Pwm_NotifyFuncType) (void) |
| Notification callback function pointer More... | |
| AUTOMATIC | |
| PWM_PBCFG | CfgPtr |
| uint16 | DutyCycle |
| Pwm_PeriodType | Period |
| Pwm_EdgeNotificationType | Notification |
| PWM_APPL_DATA | versioninfo |
| FUNC (void, PWM_CODE) Pwm_Init(P2CONST(Pwm_ConfigType | |
| Service for PWM initialization. More... | |
| FUNC (Pwm_OutputStateType, PWM_CODE) Pwm_GetOutputState(Pwm_ChannelType ChannelNumber) | |
| Std_ReturnType | Pwm_RegisterReadback (Pwm_ChannelType ChannelNumber, Pwm_RegisterReadbackType *RegRbPtr) |
| This function reads the important registers of the hardware unit and returns the value in the structure. More... | |
PWM Driver ISR category level | |
| const struct Pwm_ConfigType_PC_s | PwmChannelConfigSet_PC |
| PWM Configuration structure declaration. More... | |
| const struct Pwm_ConfigType_s | PwmChannelConfigSet |
| CONST (uint32, PWM_CONST) Pwm_HwUnitBaseAddr[PWM_MAX_NUM_CHANNELS] | |
| FUNC (void, PWM_CODE_FAST) Pwm_Ch11Isr(void) | |
| PWM Channel 11 ISR. More... | |
| #define | PWM_ISR_VOID (0x00U) |
| void ISR type More... | |
| #define | PWM_ISR_CAT1 (0x01U) |
| Category 1 ISR type. More... | |
| #define | PWM_ISR_CAT2 (0x02U) |
| Category 2 ISR type. More... | |
| #define | PWM_DEINIT_API (STD_ON) |
| Enable/Disable PWM DeInit API. More... | |
| #define | PWM_SET_DUTY_CYCLE_API (STD_ON) |
| Enable/Disable PWM SetDutyCycle API. More... | |
| #define | PWM_SET_OUTPUT_TO_IDLE_API (STD_ON) |
| Enable/Disable PWM SetOutputToIdle API. More... | |
| #define | PWM_GET_OUTPUT_STATE_API (STD_OFF) |
| Enable/Disable PWM GetOutputState API. More... | |
| #define | PWM_SET_PERIOD_AND_DUTY_API (STD_ON) |
| Enable/Disable PWM SetPeriodAndDuty API. More... | |
| #define | PWM_VERSION_INFO_API (STD_ON) |
| Enable/Disable PWM VersionInfo API. More... | |
| #define | PWM_REGISTER_READBACK_API (STD_ON) |
| Enable/Disable PWM RegisterReadback API. More... | |
| #define | PWM_DUTYCYCLE_UPDATED_ENDPERIOD (STD_ON) |
| Enable/Disable PWM Dutycycle update always at the end of the period. More... | |
| #define | PWM_PERIOD_UPDATED_ENDPERIOD (STD_ON) |
| Enable/Disable PWM Period update always at the end of the period. More... | |
| #define | PWM_ISR_TYPE (PWM_ISR_CAT1) |
| ISR type. More... | |
| #define | PWM_NUM_CHANNELS (1U) |
| Number of configured channels. More... | |
| #define | PWM_DEV_ERROR_DETECT (STD_ON) |
| Enable/Disable PWM dev detect error. More... | |
| #define | PWM_NOTIFICATION_SUPPORTED (STD_ON) |
| Enable/Disable PWM notifications. More... | |
| #define | PWM_OS_COUNTER_ID ((CounterType)OsCounter_0) |
| Counter ID for counter used to count wait ticks. More... | |
| #define | PWM_INDEX (1U) |
| Instance ID for driver module to toggle between GPT and EPWM usage. More... | |
| #define | PWM_INSTANCE_ID (PWM_INDEX) |
| #define | PWM_USE_GPT |
| #define | PWM_TIMEOUT_DURATION (32000U) |
| timeout. Each tick is 31.25us (for 32K Counter). Wait for 5s which comes to below value More... | |
| #define | PwmConf_PwmChannel_PwmChannel_0 (10U) |
| Channel ID Symbolic Names Configured channel ID(s) More... | |
| #define | PWM_INIT_CONFIG_PC PwmChannelConfigSet |
| Pre Compile config macro name. More... | |
| #define | PWM_MAX_NUM_CHANNELS (30U) |
| #define | PWM_CHANNEL11 (10U) |
| GP timer 11 instance, in MCU DOMAIN. More... | |
| #define PWM_PRE_COMPILE_VARIANT (STD_ON ) |
PWM Build Variant. Build variants.(i.e Pre-compile,Post-build or Link time)
| #define PWM_VARIANT_POST_BUILD (STD_OFF) |
| #define PWM_ISR_VOID (0x00U) |
void ISR type
| #define PWM_ISR_CAT1 (0x01U) |
Category 1 ISR type.
| #define PWM_ISR_CAT2 (0x02U) |
Category 2 ISR type.
| #define PWM_DEINIT_API (STD_ON) |
Enable/Disable PWM DeInit API.
| #define PWM_SET_DUTY_CYCLE_API (STD_ON) |
Enable/Disable PWM SetDutyCycle API.
| #define PWM_SET_OUTPUT_TO_IDLE_API (STD_ON) |
Enable/Disable PWM SetOutputToIdle API.
| #define PWM_GET_OUTPUT_STATE_API (STD_OFF) |
Enable/Disable PWM GetOutputState API.
| #define PWM_SET_PERIOD_AND_DUTY_API (STD_ON) |
Enable/Disable PWM SetPeriodAndDuty API.
| #define PWM_VERSION_INFO_API (STD_ON) |
Enable/Disable PWM VersionInfo API.
| #define PWM_REGISTER_READBACK_API (STD_ON) |
Enable/Disable PWM RegisterReadback API.
| #define PWM_DUTYCYCLE_UPDATED_ENDPERIOD (STD_ON) |
Enable/Disable PWM Dutycycle update always at the end of the period.
| #define PWM_PERIOD_UPDATED_ENDPERIOD (STD_ON) |
Enable/Disable PWM Period update always at the end of the period.
| #define PWM_ISR_TYPE (PWM_ISR_CAT1) |
ISR type.
| #define PWM_NUM_CHANNELS (1U) |
Number of configured channels.
| #define PWM_DEV_ERROR_DETECT (STD_ON) |
Enable/Disable PWM dev detect error.
| #define PWM_NOTIFICATION_SUPPORTED (STD_ON) |
Enable/Disable PWM notifications.
| #define PWM_OS_COUNTER_ID ((CounterType)OsCounter_0) |
Counter ID for counter used to count wait ticks.
| #define PWM_INDEX (1U) |
Instance ID for driver module to toggle between GPT and EPWM usage.
| #define PWM_INSTANCE_ID (PWM_INDEX) |
| #define PWM_USE_GPT |
| #define PWM_TIMEOUT_DURATION (32000U) |
timeout. Each tick is 31.25us (for 32K Counter). Wait for 5s which comes to below value
| #define PwmConf_PwmChannel_PwmChannel_0 (10U) |
Channel ID Symbolic Names Configured channel ID(s)
Channel identifiers
| #define PWM_INIT_CONFIG_PC PwmChannelConfigSet |
Pre Compile config macro name.
| #define PWM_MAX_NUM_CHANNELS (30U) |
| #define PWM_CHANNEL11 (10U) |
GP timer 11 instance, in MCU DOMAIN.
| typedef uint32 Pwm_PeriodType |
typedef of period value
| typedef uint32 Pwm_ChannelType |
PWM Channel type.
| typedef uint32 Pwm_FrequencyType |
typedef of frequency value (Frequency in Hz)
| typedef void(* Pwm_NotifyFuncType) (void) |
Notification callback function pointer
| enum Pwm_OutputStateType |
| enum Pwm_ChannelClassType |
Period type for pwm channels. Fixed periods prohibit changes to the period length with Pwm_SetPeriod( ). PWM_FIXED_PERIOD_SHIFTED type is not supported due to hardware restrictions of the PWM unit.
| Enumerator | |
|---|---|
| PWM_FIXED_PERIOD | Period is immutable |
| PWM_FIXED_PERIOD_SHIFTED | Period is immutable with phase shift |
| PWM_VARIABLE_PERIOD | Period is variable |
| enum Pwm_epwmOutputCh_t |
| FUNC | ( | void | , |
| PWM_CODE | |||
| ) |
Service for PWM initialization.
This service returns the version information of this module.
Service to enable the Edge Notification.
Service to disable the Edge Notification.
Service to set the output of a channel immediately to idle.
Service for setting Period and Duty Cycle.
Service for setting Duty Cycle.
Service for PWM de-initialization.
* Service name : Pwm_Init * Syntax : Pwm_Init(P2CONST(Pwm_ConfigType, * AUTOMATIC, PWM_PBCFG) ConfigPtr) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x00 * Sync/Async : Synchronous * Reentrancy : Non Reentrant * Parameters (in) : Pointer to the configuration * Parameters (out) : None * Return value : void * Description : Initializes internal variables * and the PWM unit of the micro controller. * The function can be called on task level. *
* Service name : Pwm_DeInit * Syntax : Pwm_DeInit(void) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x01 * Sync/Async : Synchronous * Reentrancy : Non Reentrant * Parameters (in) : None * Parameters (out) : None * Return value : void * Description : After DeInit output states should be in idle level * (it is configurable whether reset state is restored or * if channel output states are really set to idle). * The function can be called on task level. *
* Service name : Pwm_SetDutyCycle * Syntax : Pwm_SetDutyCycle(Pwm_ChannelType Channel, * uint16 DutyCycle) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x02 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Pwm_ChannelType Channel * Parameters (in) : uint16 DutyCycle * Parameters (out) : None * Return value : void * Description : This service sets the duty cycle for a channel * if DutyCycle is 0%, set output to inverse of polarity * if DutyCycle is >= 100%, set output to polarity * if 0% < DutyCycle < 100%, set output accordingly * The function can be called on task level. *
* Service name : Pwm_SetPeriodAndDuty * Syntax : Pwm_SetPeriodAndDuty(Pwm_ChannelType Channel, * Pwm_PeriodType Period, uint16 DutyCycle) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x03 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Pwm_ChannelType Channel * Parameters (in) : Pwm_PeriodType Period * Parameters (in) : uint16 DutyCycle * Parameters (out) : None * Return value : void * Description : This service sets period and duty cycle for a channel * if DutyCycle is 0%, set output to inverse of polarity * if DutyCycle is >= 100%, set output to polarity * if 0% < DutyCycle < 100%, set output accordingly * The function can be called on task level. *
* Service name : Pwm_SetOutputToIdle * Syntax : Pwm_SetOutputToIdle(Pwm_ChannelType Channel) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x04 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Pwm_ChannelType Channel * Parameters (out) : None * Return value : void * Description : This service sets the output of a channel * immediately to idle. The idle output level * is configured in driver configuration. * The function can be called on task level. *
* Service name : Pwm_DisableNotification * Syntax : Pwm_DisableNotification(Pwm_ChannelType ChannelNumber) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x06 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Pwm_ChannelType ChannelNumber * Parameters (out) : None * Return value : None * Description : Disables the Edge Notification * This service deactivates the Edge Notification for the * pwm channel specified by the ChannelNumber Parameter. * The function can be called on task level. *
* Service name : Pwm_EnableNotification * Syntax : Pwm_EnableNotification (Pwm_ChannelType Channel, * Pwm_EdgeNotificationType Notification) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x07 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Pwm_ChannelType ChannelNumber * Parameters (in) : Pwm_EdgeNotificationType Notification * Parameters (out) : None * Return value : None * Description : Enables the Edge Notification * This service enables the notification of the chosen * edges for the Pwm channel specified by the * ChannelNumber.The function can be called on task level *
* Service name : Pwm_GetVersionInfo * Syntax : Pwm_GetVersionInfo(P2VAR(Std_VersionInfoType, * AUTOMATIC, PWM_APPL_DATA) versioninfo) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x08 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : Std_VersionInfoType - Version info. * Parameters (out) : None * Return value : void * Description : Returns the version information of this module. * The function can be called on task level. *
| FUNC | ( | Pwm_OutputStateType | , |
| PWM_CODE | |||
| ) |
| Std_ReturnType Pwm_RegisterReadback | ( | Pwm_ChannelType | ChannelNumber, |
| Pwm_RegisterReadbackType * | RegRbPtr | ||
| ) |
This function reads the important registers of the hardware unit and returns the value in the structure.
* Service name : Pwm_RegisterReadback(Pwm_ChannelType ChannelNumber,
* Pwm_RegisterReadbackType *RegRbPtr)
* Sync/Async : Synchronous
* Reentrancy : Reentrant
* Service ID[hex] : 0x0D
* Parameters (in) : Pwm_ChannelType ChannelNumber
* Parameters (inout) : RegRbPtr - Pointer to where to store the readback
* values. If this pointer is NULL, then the API
* will return E_NOT_OK.
* Description : This API is used to check the status of critical
registers which donot change during program execution.
* Return value : Std_ReturnType
* E_OK: Register read back has been done successfully
* E_NOT_OK: Register read back failed
*
| CONST | ( | uint32 | , |
| PWM_CONST | |||
| ) |
| FUNC | ( | void | , |
| PWM_CODE_FAST | |||
| ) |
PWM Channel 11 ISR.
| Pwm_ChannelType Pwm_ChannelConfigType_PC::channelId |
| Pwm_ChannelConfigType_PC Pwm_ConfigType_PC::chCfg[PWM_NUM_CHANNELS] |
Channel configurations
| uint32 Pwm_ChannelConfigType::instanceClkHz |
System clock frequency
| uint16 Pwm_ChannelConfigType::dutyCycle |
Initial dutycycle
| uint32 Pwm_ChannelConfigType::hwPeriod |
Number of HW Unit ticks value which sets initial period
| Pwm_OutputStateType Pwm_ChannelConfigType::polarity |
Initial polarity
| Pwm_OutputStateType Pwm_ChannelConfigType::idleState |
Initial idle state
| Pwm_ChannelClassType Pwm_ChannelConfigType::channelClass |
Fixed or Variable period
| uint32 Pwm_ChannelConfigType::prescale |
Initial Counter Mode Prescaler, part of PWM HW time-base clock Range - 0 <= prescale <= 7, TBCLK = SYSCLK / (prescale) 0x0 = /1 (No prescale) 0x1 = /2 0x2 = /4 0x3 = /8 0x4 = /16 0x5 = /32 0x6 = /64 0x7 = /128
| Pwm_NotifyFuncType Pwm_ChannelConfigType::notificationHandler |
Notification handler
| Pwm_ChannelConfigType Pwm_ConfigType::chCfg[PWM_NUM_CHANNELS] |
Channel configurations
| AUTOMATIC |
| PWM_PBCFG CfgPtr |
| Pwm_PeriodType uint16 DutyCycle |
| Pwm_PeriodType Period |
| Pwm_EdgeNotificationType Notification |
| PWM_APPL_DATA versioninfo |
|
extern |
PWM Configuration structure declaration.
|
extern |