PWM_CCU4
|
DAVE_APP_VERSION_t | PWM_CCU4_GetAppVersion (void) |
Retrieves the version of the PWM_CCU4 APP. More... | |
PWM_CCU4_STATUS_t | PWM_CCU4_Init (PWM_CCU4_t *const handle_ptr) |
Initializes the PWM_CCU4 APP. More... | |
PWM_CCU4_STATUS_t | PWM_CCU4_Start (PWM_CCU4_t *const handle_ptr) |
Start the selected CCU4 slice. More... | |
PWM_CCU4_STATUS_t | PWM_CCU4_Stop (PWM_CCU4_t *const handle_ptr) |
Stop the selected CCU4 slice. More... | |
uint32_t | PWM_CCU4_GetTimerValue (PWM_CCU4_t *const handle_ptr) |
Returns the timer value. More... | |
bool | PWM_CCU4_GetTimerStatus (PWM_CCU4_t *const handle_ptr) |
Returns the timer status. More... | |
PWM_CCU4_STATUS_t | PWM_CCU4_SetFreq (PWM_CCU4_t *const handle_ptr, uint32_t pwm_freq_hz) |
Sets the PWM frequency. More... | |
PWM_CCU4_STATUS_t | PWM_CCU4_SetDutyCycle (PWM_CCU4_t *const handle_ptr, uint32_t duty_cycle) |
Sets the duty cycle of PWM. More... | |
PWM_CCU4_STATUS_t | PWM_CCU4_SetFreqAndDutyCycle (PWM_CCU4_t *const handle_ptr, uint32_t pwm_freq_hz, uint32_t duty) |
Sets the frequency duty cycle of PWM. More... | |
void | PWM_CCU4_SetDither (PWM_CCU4_t *const handle_ptr, bool dither_period, bool dither_comp, uint8_t dither_value) |
Sets the dither value for period , duty or both. More... | |
void | PWM_CCU4_ClearTrap (PWM_CCU4_t *const handle_ptr) |
Clears the trap event. More... | |
bool | PWM_CCU4_GetInterruptStatus (PWM_CCU4_t *const handle_ptr, XMC_CCU4_SLICE_IRQ_ID_t pwm_interrupt) |
Returns the interrupt status. More... | |
void | PWM_CCU4_ClearEvent (PWM_CCU4_t *const handle_ptr, XMC_CCU4_SLICE_IRQ_ID_t pwm_interrupt) |
Acknowledges the interrupt. More... | |
Detailed Description
Methods
Function Documentation
void PWM_CCU4_ClearEvent | ( | PWM_CCU4_t *const | handle_ptr, |
XMC_CCU4_SLICE_IRQ_ID_t | pwm_interrupt | ||
) |
Acknowledges the interrupt.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters. pwm_interrupt interrupt ID
- Returns
- Description:
- Clears the interrupt status flag, provided the interrupt condition no longer exists.
Example Usage:
Definition at line 586 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_slice_ptr.
void PWM_CCU4_ClearTrap | ( | PWM_CCU4_t *const | handle_ptr | ) |
Clears the trap event.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters.
- Returns
- void
- Description:
- Clears the trap event provided the trap condition no longer exists.
Example Usage:
Definition at line 563 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_slice_ptr.
DAVE_APP_VERSION_t PWM_CCU4_GetAppVersion | ( | void | ) |
Retrieves the version of the PWM_CCU4 APP.
- Parameters
-
None
- Returns
- DAVE_APP_VERSION_t APP version information (major, minor and patch number)
- Description:
- The function can be used to check application software compatibility with a specific version of the APP.
*Example Usage:
Definition at line 93 of file PWM_CCU4.c.
bool PWM_CCU4_GetInterruptStatus | ( | PWM_CCU4_t *const | handle_ptr, |
XMC_CCU4_SLICE_IRQ_ID_t | pwm_interrupt | ||
) |
Returns the interrupt status.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters. pwm_interrupt interrupt ID
- Returns
- bool
- Description:
- Returns true if the interrupt flag is set, else returns false.
Example Usage:
Definition at line 575 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_slice_ptr.
bool PWM_CCU4_GetTimerStatus | ( | PWM_CCU4_t *const | handle_ptr | ) |
Returns the timer status.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters.
- Returns
- XMC_CCU4_STATUS_t
- Description:
- Returns true is the timer is running else returns false.
Example Usage:
Definition at line 393 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_slice_ptr.
uint32_t PWM_CCU4_GetTimerValue | ( | PWM_CCU4_t *const | handle_ptr | ) |
Returns the timer value.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters.
- Returns
- uint32_t
- Description:
- Returns the timer value if the APP is initialized.
Example Usage:
Definition at line 383 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_slice_ptr.
PWM_CCU4_STATUS_t PWM_CCU4_Init | ( | PWM_CCU4_t *const | handle_ptr | ) |
Initializes the PWM_CCU4 APP.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters.
- Returns
- PWM_CCU4_STATUS_t
- Description:
- Configures the CCU4 slice registers with the selected PWM_CCU4 parameters. The slice is configured in PWM generation mode.
Example Usage:
Definition at line 105 of file PWM_CCU4.c.
References PWM_CCU4_ConfigType::automatic_shadow_transfer, PWM_CCU4_ConfigType::cascaded_shadow_txfr_enable, PWM_CCU4_ConfigType::ccu4_cc4_slice_timer_ptr, PWM_CCU4_HandleType::ccu4_module_ptr, PWM_CCU4_HandleType::ccu4_slice_ptr, PWM_CCU4_ConfigType::compare_value, PWM_CCU4_HandleType::config_ptr, PWM_CCU4_HandleType::dither_shadow_txfr_msk, PWM_CCU4_HandleType::frequency_tclk, PWM_CCU4_ConfigType::global_ccu4_handle, PWM_CCU4_ConfigType::gpio_ch_out_config_ptr, PWM_CCU4_ConfigType::gpio_ch_out_enable, PWM_CCU4_ConfigType::gpio_ch_out_pin, PWM_CCU4_ConfigType::gpio_ch_out_ptr, PWM_CCU4_ConfigType::immediate_write, PWM_CCU4_ConfigType::mcm_shadow_txfr_mode, PWM_CCU4_ConfigType::period_value, PWM_CCU4_Start(), PWM_CCU4_STATE_INITIALIZED, PWM_CCU4_STATE_UNINITIALIZED, PWM_CCU4_STATUS_ALREADY_INITIALIZED, PWM_CCU4_STATUS_FAILURE, PWM_CCU4_STATUS_SUCCESS, PWM_CCU4_ConfigType::shadow_transfer_mode, PWM_CCU4_HandleType::shadow_txfr_msk, PWM_CCU4_ConfigType::start_control, and PWM_CCU4_HandleType::state.
void PWM_CCU4_SetDither | ( | PWM_CCU4_t *const | handle_ptr, |
bool | dither_period, | ||
bool | dither_comp, | ||
uint8_t | dither_value | ||
) |
Sets the dither value for period , duty or both.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters. dither_period apply dither to period dither_comp apply dither to compare dither_value dither value
- Returns
- void
- Description:
- Sets the dither value for period , duty or both.
dither_value: is the dither value.
dither_period: when true, dither is applied to period.
dither_comp: when true, dither is applied to compare.
Example Usage:
Definition at line 550 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_module_ptr, PWM_CCU4_HandleType::ccu4_slice_ptr, and PWM_CCU4_HandleType::dither_shadow_txfr_msk.
PWM_CCU4_STATUS_t PWM_CCU4_SetDutyCycle | ( | PWM_CCU4_t *const | handle_ptr, |
uint32_t | duty_cycle | ||
) |
Sets the duty cycle of PWM.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters. duty_cycle channel duty cycle uint32_t
- Returns
- PWM_CCU4_STATUS_t
- Description:
- Sets the PWM duty. The APP should not be in "PWM_CCU4_UNINITIALIZED" state. Duty is scaled by 100.
The condition [duty < 100%] should be met.
Returns PWM_CCU4_STATUS_SUCCESS if operation update is success.
Example Usage:
Definition at line 458 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_module_ptr, PWM_CCU4_HandleType::ccu4_slice_ptr, PWM_CCU4_STATE_UNINITIALIZED, PWM_CCU4_STATUS_FAILURE, PWM_CCU4_STATUS_SUCCESS, PWM_CCU4_HandleType::shadow_txfr_msk, PWM_CCU4_HandleType::state, and PWM_CCU4_HandleType::sym_duty.
PWM_CCU4_STATUS_t PWM_CCU4_SetFreq | ( | PWM_CCU4_t *const | handle_ptr, |
uint32_t | pwm_freq_hz | ||
) |
Sets the PWM frequency.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters. pwm_freq_hz value in Hz (uint32_t)
- Returns
- PWM_CCU4_STATUS_t
- Description:
- Sets the PWM frequency of PWM generation. The APP should not be in "PWM_CCU4_UNINITIALIZED" state. Returns PWM_CCU4_STATUS_SUCCESS if frequency update is success.
Example Usage:
Definition at line 405 of file PWM_CCU4.c.
References PWM_CCU4_ConfigType::ccu4_cc4_slice_timer_ptr, PWM_CCU4_HandleType::ccu4_module_ptr, PWM_CCU4_HandleType::ccu4_slice_ptr, PWM_CCU4_HandleType::config_ptr, PWM_CCU4_HandleType::frequency_tclk, PWM_CCU4_STATE_UNINITIALIZED, PWM_CCU4_STATUS_FAILURE, PWM_CCU4_STATUS_SUCCESS, PWM_CCU4_HandleType::shadow_txfr_msk, PWM_CCU4_HandleType::state, and PWM_CCU4_HandleType::sym_duty.
PWM_CCU4_STATUS_t PWM_CCU4_SetFreqAndDutyCycle | ( | PWM_CCU4_t *const | handle_ptr, |
uint32_t | pwm_freq_hz, | ||
uint32_t | duty | ||
) |
Sets the frequency duty cycle of PWM.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters. pwm_freq_hz value in Hz (uint32_t) duty channel duty
- Returns
- PWM_CCU4_STATUS_t
- Description:
- Sets the frequency and duty of PWM. The APP should not be in "PWM_CCU4_UNINITIALIZED" state. Duty is scaled by 100.
The condition [duty < 100%] should be met.
Returns PWM_CCU4_STATUS_SUCCESS if operation update is success.
Example Usage:
Definition at line 495 of file PWM_CCU4.c.
References PWM_CCU4_ConfigType::ccu4_cc4_slice_timer_ptr, PWM_CCU4_HandleType::ccu4_module_ptr, PWM_CCU4_HandleType::ccu4_slice_ptr, PWM_CCU4_HandleType::config_ptr, PWM_CCU4_HandleType::frequency_tclk, PWM_CCU4_STATE_UNINITIALIZED, PWM_CCU4_STATUS_FAILURE, PWM_CCU4_STATUS_SUCCESS, PWM_CCU4_HandleType::shadow_txfr_msk, PWM_CCU4_HandleType::state, and PWM_CCU4_HandleType::sym_duty.
PWM_CCU4_STATUS_t PWM_CCU4_Start | ( | PWM_CCU4_t *const | handle_ptr | ) |
Start the selected CCU4 slice.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters.
- Returns
- PWM_CCU4_STATUS_t
- Description:
- Starts the selected CCU4 slice for PWM generation. Returns PWM_CCU4_STATUS_SUCCESS if the PWM_CCU4 APP state is in "PWM_CCU4_STATE_INITIALIZED" or "PWM_CCU4_STOPPED" else returns PWM_CCU4_STATUS_FAILURE.
PWM_CCU4_Start() is needed to be called if "Start during initialization" is unchecked to start PWM generation, else its called by DAVE_Init();
Example Usage:
Definition at line 339 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_module_ptr, PWM_CCU4_HandleType::ccu4_slice_ptr, PWM_CCU4_HandleType::config_ptr, PWM_CCU4_ConfigType::ext_start_event, PWM_CCU4_STATE_INITIALIZED, PWM_CCU4_STATE_RUNNING, PWM_CCU4_STATE_STOPPED, PWM_CCU4_STATUS_FAILURE, PWM_CCU4_STATUS_SUCCESS, PWM_CCU4_HandleType::slice_number, and PWM_CCU4_HandleType::state.
Referenced by PWM_CCU4_Init().
PWM_CCU4_STATUS_t PWM_CCU4_Stop | ( | PWM_CCU4_t *const | handle_ptr | ) |
Stop the selected CCU4 slice.
- Parameters
-
handle_ptr Pointer to PWM_CCU4_t structure containing APP parameters.
- Returns
- PWM_CCU4_STATUS_t
- Description:
- Stops the selected CCU4 slice form PWM generation. Returns PWM_CCU4_STATUS_SUCCESS if the PWM_CCU4 APP state is not "PWM_CCU4_STATE_UNINITIALIZED" else returns PWM_CCU4_STATUS_FAILURE.
Example Usage:
Definition at line 363 of file PWM_CCU4.c.
References PWM_CCU4_HandleType::ccu4_slice_ptr, PWM_CCU4_STATE_STOPPED, PWM_CCU4_STATE_UNINITIALIZED, PWM_CCU4_STATUS_FAILURE, PWM_CCU4_STATUS_SUCCESS, and PWM_CCU4_HandleType::state.