CCU8PWMLIBApp
|
status_t | CCU8PWMLIB_Init (const CCU8PWMLIB_HandleType *HandlePtr) |
This function is used to initialize the APP. It will configure CCU8_CCy slice registers with the selected PWM parameters. | |
status_t | CCU8PWMLIB_Deinit (const CCU8PWMLIB_HandleType *HandlePtr) |
This will reset the CCU8_CCy slice registers to default state. | |
status_t | CCU8PWMLIB_EnableExtStart (const CCU8PWMLIB_HandleType *HandlePtr) |
This function enables the externat start feature. | |
status_t | CCU8PWMLIB_DisableExtStart (const CCU8PWMLIB_HandleType *HandlePtr) |
This function disables the externat start feature. This is useful for multiphase PWM app to disable this functionality to avoid spurious start of the slices due to other instances of the app. | |
status_t | CCU8PWMLIB_Start (const CCU8PWMLIB_HandleType *HandlePtr) |
This will start the Single Phase PWM with Dead Time APP which will in turn start the CCU8_CCy slice. This function needs to be called to start the App even if External Start feature of CCU8 is configured. | |
status_t | CCU8PWMLIB_Stop (const CCU8PWMLIB_HandleType *HandlePtr) |
This will stop the Single Phase PWM with Dead Time APP which will in turn stop the CCU8_CCy slice. This function needs to be called even if external stop feature is configured | |
status_t | CCU8PWMLIB_SetCompare (const CCU8PWMLIB_HandleType *HandlePtr, uint32_t Compare1, uint32_t Compare2) |
This function will modify the duty cycle of the output waveform which will change the pulse width. Duty cycle is given in terms of the compare register value and not in terms of the percentage. | |
status_t | CCU8PWMLIB_SetDutyCycle (const CCU8PWMLIB_HandleType *HandlePtr, float DutyCycle, uint32_t Shift, uint8_t Sign) |
This function will modify the duty cycle of the output waveform which will change the pulse width. Duty cycle is given in terms of percentage. | |
status_t | CCU8PWMLIB_SetPeriod (const CCU8PWMLIB_HandleType *HandlePtr, uint32_t PwmFreq) |
This function will modify the pwm frequency of the output waveform which will change the pulse width. In case of timer concatenation,given value is split into two 16-bit values and they are programmed in Second and First slice. e.g. 0x80000010 value is written as 0x8000 as Period register of Second slice and 0x0010 as period register of first slice. Total PWM period is ((0x8000 +1) * 0x0010) + 1. | |
status_t | CCU8PWMLIB_SetPeriodAndCompare (const CCU8PWMLIB_HandleType *HandlePtr, uint32_t PwmFreq, uint32_t Compare1, uint32_t Compare2) |
This function will modify the pwm frequency and duty cycle of the output waveform which will change the pulse width. Frequency is given as period register value and duty cycle is given as compare register value. In case of timer concatenation,given value is split into two 16-bit values and they are programmed in Second and First slice. e.g. 0x80000010 value is written as 0x8000 as Period register of Second slice and 0x0010 as period register of first slice. Total PWM period is ((0x8000 +1) * 0x0010) + 1. | |
status_t | CCU8PWMLIB_SetPwmFreq (const CCU8PWMLIB_HandleType *HandlePtr, float PwmFreq) |
This function will modify the pwm frequency of the output waveform . | |
status_t | CCU8PWMLIB_SetPwmFreqAndDutyCycle (const CCU8PWMLIB_HandleType *HandlePtr, float PwmFreq, float DutyCycle, uint32_t Shift, uint8_t Sign) |
This function will modify the pwm frequency and duty cycle of the output waveform . | |
status_t | CCU8PWMLIB_SetTimerVal (const CCU8PWMLIB_HandleType *HandlePtr, uint32_t TimerVal) |
This will update the timer register value when timer is stopped. This is used to set the starting value of the timer. It is useful API in the single shot mode. | |
status_t | CCU8PWMLIB_SWRequestShadowTransfer (const CCU8PWMLIB_HandleType *HandlePtr) |
This will request the update of the period register, compare register values from the respective shadow transfers. This function needs to be called when shadow compare and period registers are updated explicitely by top level app. NOTE: SetDutyCycle and SetPwmFreq functions handle shadow transfer request. No need to call this function after changing the duty cycle and PWM frequency. | |
status_t | CCU8PWMLIB_GetPeriodReg (const CCU8PWMLIB_HandleType *HandlePtr, uint32_t *PeriodRegPtr) |
This function will read the period register value.This will be useful to calculate the compare register values. | |
status_t | CCU8PWMLIB_ResetTrapFlag (const CCU8PWMLIB_HandleType *HandlePtr) |
This function will reset the trap flag by checking whether trap condition is reset. | |
status_t | CCU8PWMLIB_GetTimerRegsVal (const CCU8PWMLIB_HandleType *HandlePtr, CCU8PWMLIB_TimerRegsType *TimerRegsPtr) |
This function will read the timer values of compare register and period register. | |
status_t | CCU8PWMLIB_GetTimerStatus (const CCU8PWMLIB_HandleType *HandlePtr, uint32_t *TimerStatusPtr) |
This function will read the timer status whether timer is running or idle. | |
status_t | CCU8PWMLIB_EnableEvent (const CCU8PWMLIB_HandleType *HandlePtr, const CCU8PWMLIB_EventNameType Event) |
This function will enable the event. This should be called by the user first for interrupt handling. | |
status_t | CCU8PWMLIB_DisableEvent (const CCU8PWMLIB_HandleType *HandlePtr, const CCU8PWMLIB_EventNameType Event) |
This function will disable the event. | |
status_t | CCU8PWMLIB_ClearPendingEvent (const CCU8PWMLIB_HandleType *HandlePtr, const CCU8PWMLIB_EventNameType Event) |
This function will clear the pending event. | |
status_t | CCU8PWMLIB_SetPendingEvent (const CCU8PWMLIB_HandleType *HandlePtr, const CCU8PWMLIB_EventNameType Event) |
This function will forcefully set the event.This function should not be called within interrut handler to avoid infinite loop. | |
status_t | CCU8PWMLIB_GetPendingEvent (const CCU8PWMLIB_HandleType *HandlePtr, const CCU8PWMLIB_EventNameType Event, uint8_t *EvtStatus) |
This function will check whether given event is set. | |
status_t | CCU8PWMLIB_SetDutyEdgeAlignAsymmetric (const void *HdlPtr, float DutyCycle, uint32_t Shift, uint8_t Sign) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when edge aligned asymmetric mode is selected. | |
status_t | CCU8PWMLIB_SetDutyEdgeAlignSymmetric (const void *HdlPtr, float DutyCycle, uint32_t Shift, uint8_t Sign) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when edge aligned symmetric mode is selected. | |
status_t | CCU8PWMLIB_SetDutyEdgeAlignSymmetricTimerConcat (const void *HdlPtr, float DutyCycle, uint32_t Shift, uint8_t Sign) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when edge aligned symmetric with timer concatenation mode is selected. | |
status_t | CCU8PWMLIB_SetDutyCenterAlignSymmetric (const void *HandlePtr, float DutyCycle, uint32_t Shift, uint8_t Sign) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when center aligned symmetric mode is selected. | |
status_t | CCU8PWMLIB_SetDutyCenterAlignAsymmetric (const void *HandlePtr, float DutyCycle, uint32_t Shift, uint8_t Sign) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when center aligned symmetric mode is selected. | |
status_t | CCU8PWMLIB_SetCompareAsymmetric (const void *HdlPtr, uint32_t Compare1, uint32_t Compare2) |
This function will be internally called by CCU8PWMLIB_SetCompare when asymmetric mode is selected. | |
status_t | CCU8PWMLIB_SetCompareSymmetric (const void *HdlPtr, uint32_t Compare1, uint32_t Compare2) |
This function will be internally called by CCU8PWMLIB_SetCompare when symmetric mode is selected. | |
status_t | CCU8PWMLIB_SetCompareEdgeAlignSymmetricTimerConcat (const void *HdlPtr, uint32_t Compare1, uint32_t Compare2) |
This function will be internally called by CCU8PWMLIB_SetCompare when edge-aligned symmetric mode with timer concatenation is selected. |
status_t CCU8PWMLIB_ClearPendingEvent | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
const CCU8PWMLIB_EventNameType | Event | ||
) |
This function will clear the pending event.
[in] | HandlePtr | pointer to the Instance variable |
[in] | Event | Event to be cleared |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_Deinit | ( | const CCU8PWMLIB_HandleType * | HandlePtr | ) |
This will reset the CCU8_CCy slice registers to default state.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_DisableEvent | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
const CCU8PWMLIB_EventNameType | Event | ||
) |
This function will disable the event.
[in] | HandlePtr | pointer to the Instance variable |
[in] | Event | Event to be disabled |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_DisableExtStart | ( | const CCU8PWMLIB_HandleType * | HandlePtr | ) |
This function disables the externat start feature. This is useful for multiphase PWM app to disable this functionality to avoid spurious start of the slices due to other instances of the app.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_EnableEvent | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
const CCU8PWMLIB_EventNameType | Event | ||
) |
This function will enable the event. This should be called by the user first for interrupt handling.
[in] | HandlePtr | pointer to the Instance variable |
[in] | Event | Event to be enabled |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_EnableExtStart | ( | const CCU8PWMLIB_HandleType * | HandlePtr | ) |
This function enables the externat start feature.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_GetPendingEvent | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
const CCU8PWMLIB_EventNameType | Event, | ||
uint8_t * | EvtStatus | ||
) |
This function will check whether given event is set.
[in] | HandlePtr | pointer to the Instance variable |
[in] | Event | Event to be set |
[in] | EvtStatus | Status of the eventwhether it is set |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_GetPeriodReg | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
uint32_t * | PeriodRegPtr | ||
) |
This function will read the period register value.This will be useful to calculate the compare register values.
[out] | PeriodRegPtr | |
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_GetTimerRegsVal | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
CCU8PWMLIB_TimerRegsType * | TimerRegsPtr | ||
) |
This function will read the timer values of compare register and period register.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | TimerRegsPtr | Pointer to CCU8PWMLIB_TimerRegsType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_GetTimerStatus | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
uint32_t * | TimerStatusPtr | ||
) |
This function will read the timer status whether timer is running or idle.
[out] | TimerStatusPtr | |
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_Init | ( | const CCU8PWMLIB_HandleType * | HandlePtr | ) |
This function is used to initialize the APP. It will configure CCU8_CCy slice registers with the selected PWM parameters.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_ResetTrapFlag | ( | const CCU8PWMLIB_HandleType * | HandlePtr | ) |
This function will reset the trap flag by checking whether trap condition is reset.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SetCompare | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
uint32_t | Compare1, | ||
uint32_t | Compare2 | ||
) |
This function will modify the duty cycle of the output waveform which will change the pulse width.
Duty cycle is given in terms of the compare register value and not in terms of the percentage.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | Compare1 | It corresponds to compare register 1 value. |
[in] | Compare2 | It corresponds to compare register 2 value. |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SetCompareAsymmetric | ( | const void * | HdlPtr, |
uint32_t | Compare1, | ||
uint32_t | Compare2 | ||
) |
This function will be internally called by CCU8PWMLIB_SetCompare when asymmetric mode is selected.
[in] | HdlPtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | Compare1 | Compare register1 value |
[in] | Compare2 | Compare register 2 value |
status_t CCU8PWMLIB_SetCompareEdgeAlignSymmetricTimerConcat | ( | const void * | HdlPtr, |
uint32_t | Compare1, | ||
uint32_t | Compare2 | ||
) |
This function will be internally called by CCU8PWMLIB_SetCompare when edge-aligned symmetric mode with timer concatenation is selected.
[in] | HdlPtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | Compare1 | Compare register1 value |
[in] | Compare2 | Compare register 2 value |
status_t CCU8PWMLIB_SetCompareSymmetric | ( | const void * | HdlPtr, |
uint32_t | Compare1, | ||
uint32_t | Compare2 | ||
) |
This function will be internally called by CCU8PWMLIB_SetCompare when symmetric mode is selected.
[in] | HdlPtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | Compare1 | Compare register1 value |
[in] | Compare2 | Compare register 2 value |
status_t CCU8PWMLIB_SetDutyCenterAlignAsymmetric | ( | const void * | HandlePtr, |
float | DutyCycle, | ||
uint32_t | Shift, | ||
uint8_t | Sign | ||
) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when center aligned symmetric mode is selected.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | DutyCycle | It corresponds to compare register's value. |
[in] | Shift | It controls the duty cycle value. |
[in] | Sign | It controls addition and substraction of shift |
status_t CCU8PWMLIB_SetDutyCenterAlignSymmetric | ( | const void * | HandlePtr, |
float | DutyCycle, | ||
uint32_t | Shift, | ||
uint8_t | Sign | ||
) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when center aligned symmetric mode is selected.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | DutyCycle | It corresponds to compare register's value. |
[in] | Shift | It controls the duty cycle value. |
[in] | Sign | It controls addition and substraction of shift |
status_t CCU8PWMLIB_SetDutyCycle | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
float | DutyCycle, | ||
uint32_t | Shift, | ||
uint8_t | Sign | ||
) |
This function will modify the duty cycle of the output waveform which will change the pulse width.
Duty cycle is given in terms of percentage.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | DutyCycle | It corresponds to duty cycle in percentage. |
[in] | Shift | It controls the duty cycle value. |
[in] | Sign | It controls addition and subtraction of shift Sign = 0: Compare value is incremented by shift. This is not allowed in edge-aligned. Sign = 1: Compare value is decremented by shift. |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SetDutyEdgeAlignAsymmetric | ( | const void * | HdlPtr, |
float | DutyCycle, | ||
uint32_t | Shift, | ||
uint8_t | Sign | ||
) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when edge aligned asymmetric mode is selected.
[in] | HdlPtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | DutyCycle | It corresponds to compare register's value. |
[in] | Shift | It controls the duty cycle value. |
[in] | Sign | It controls addition and subtraction of shift |
status_t CCU8PWMLIB_SetDutyEdgeAlignSymmetric | ( | const void * | HdlPtr, |
float | DutyCycle, | ||
uint32_t | Shift, | ||
uint8_t | Sign | ||
) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when edge aligned symmetric mode is selected.
[in] | HdlPtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | DutyCycle | It corresponds to compare register's value. |
[in] | Shift | It controls the duty cycle value. |
[in] | Sign | It controls addition and subtraction of shift |
status_t CCU8PWMLIB_SetDutyEdgeAlignSymmetricTimerConcat | ( | const void * | HdlPtr, |
float | DutyCycle, | ||
uint32_t | Shift, | ||
uint8_t | Sign | ||
) |
This function will be internally called by CCU8PWMLIB_SetDutyCycle when edge aligned symmetric with timer concatenation mode is selected.
[in] | HdlPtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | DutyCycle | It corresponds to compare register's value. |
[in] | Shift | It controls the duty cycle value. |
[in] | Sign | It controls addition and subtraction of shift |
status_t CCU8PWMLIB_SetPendingEvent | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
const CCU8PWMLIB_EventNameType | Event | ||
) |
This function will forcefully set the event.This function should not be called within interrut handler to avoid infinite loop.
[in] | HandlePtr | pointer to the Instance variable |
[in] | Event | Event to be set |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SetPeriod | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
uint32_t | PwmFreq | ||
) |
This function will modify the pwm frequency of the output waveform which will change the pulse width.
In case of timer concatenation,given value is split into two 16-bit values and they are programmed in Second and First slice.
e.g. 0x80000010 value is written as 0x8000 as Period register of Second slice and 0x0010 as period register of first slice. Total PWM period is ((0x8000 +1) * 0x0010) + 1.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | PwmFreq | It corresponds to period register's value. |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SetPeriodAndCompare | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
uint32_t | PwmFreq, | ||
uint32_t | Compare1, | ||
uint32_t | Compare2 | ||
) |
This function will modify the pwm frequency and duty cycle of the output waveform which will change the pulse width.
Frequency is given as period register value and duty cycle is given as compare register value. In case of timer concatenation,given value is split into two 16-bit values and they are programmed in Second and First slice.
e.g. 0x80000010 value is written as 0x8000 as Period register of Second slice and 0x0010 as period register of first slice. Total PWM period is ((0x8000 +1) * 0x0010) + 1.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | PwmFreq | It corresponds to period register's value. |
[in] | Compare1 | It corresponds to compare register 1 value. |
[in] | Compare2 | It corresponds to compare register 2 value. |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SetPwmFreq | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
float | PwmFreq | ||
) |
This function will modify the pwm frequency of the output waveform
.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | PwmFreq | It corresponds to frequency in hertz |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SetPwmFreqAndDutyCycle | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
float | PwmFreq, | ||
float | DutyCycle, | ||
uint32_t | Shift, | ||
uint8_t | Sign | ||
) |
This function will modify the pwm frequency and duty cycle of the output waveform
.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | PwmFreq | It corresponds to frequency in hertz |
[in] | DutyCycle | It corresponds to duty cycle in percentage. |
[in] | Shift | It controls the duty cycle value. |
[in] | Sign | It controls addition and subtraction of shift Sign = 0: Compare value is incremented by shift. This is not allowed in edge-aligned. Sign = 1: Compare value is decremented by shift. |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SetTimerVal | ( | const CCU8PWMLIB_HandleType * | HandlePtr, |
uint32_t | TimerVal | ||
) |
This will update the timer register value when timer is stopped. This is used to set the starting value of the timer. It is useful API in the single shot mode.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
[in] | TimerVal |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_Start | ( | const CCU8PWMLIB_HandleType * | HandlePtr | ) |
This will start the Single Phase PWM with Dead Time APP which will in turn start the CCU8_CCy slice.
This function needs to be called to start the App even if External Start feature of CCU8 is configured.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_Stop | ( | const CCU8PWMLIB_HandleType * | HandlePtr | ) |
This will stop the Single Phase PWM with Dead Time APP which will in turn stop the CCU8_CCy slice.
This function needs to be called even if external stop feature is configured
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous
status_t CCU8PWMLIB_SWRequestShadowTransfer | ( | const CCU8PWMLIB_HandleType * | HandlePtr | ) |
This will request the update of the period register, compare register values from the respective shadow transfers. This function needs to be called when shadow compare and period registers are updated explicitely by top level app.
NOTE: SetDutyCycle and SetPwmFreq functions handle shadow transfer request. No need to call this function after changing the duty cycle and PWM frequency.
[in] | HandlePtr | Pointer to CCU8PWMLIB_HandleType structure |
Reentrancy: Yes
Sync/Async: Synchronous