CCU8PWMLIBApp
Data Structures
CCU8PWMLIB.h File Reference

This file contains all public data structures,enums and function prototypes for SinglePhPWM with dead time APP. Revision History 30 Nov 2012 v1.0.4 taken as base version 13 Dec 2012 v1.0.6 coding guidelines. More...


Detailed Description

This file contains all public data structures,enums and function prototypes for SinglePhPWM with dead time APP. Revision History 30 Nov 2012 v1.0.4 taken as base version 13 Dec 2012 v1.0.6 coding guidelines.

Definition in file CCU8PWMLIB.h.

#include <DAVE3.h>

Data Structures

struct  CCU8PWMLIB_TimerRegsType
struct  CCU8PWMLIB_DynamicHandleType
struct  CCU8PWMLIB_HandleType

Functions

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.
#define CCU8PWMLIB_EVENT_0   0x01U
#define CCU8PWMLIB_EVENT_1   0x02U
#define CCU8PWMLIB_EVENT_2   0x03U
#define CCU8PWMLIB_ACTIVE_LOW   0x00U
#define CCU8PWMLIB_ACTIVE_HIGH   0x01U
#define CCU8PWMLIB_ALL_CCU8_INTR_CLEAR   0x00000F3FU
#define CCU8PWMLIB_SLICE_CLEAR   0x07U
#define CCU8PWMLIB_LPF   0x0U
#define CCU8PWMLIB_COUNT(PwmTime, Res)   (uint32_t)(PwmTime/Res)
#define CCU8PWMLIB_EDGE_PERIOD_VAL(count)   (uint32_t)(count -1U)
#define CCU8PWMLIB_CENTER_PERIOD_VAL(count)   (uint32_t)((count <<1U) -1U )
#define CCU8PWMLIB_COMPARE_MODE   0x00U
enum  CCU8PWMLIB_StateType { CCU8PWMLIB_UNINITIALIZED, CCU8PWMLIB_INITIALIZED, CCU8PWMLIB_RUNNING, CCU8PWMLIB_STOPPED }
enum  CCU8PWMLIB_CCUInUseType { CCU8PWMLIB_SLICE0, CCU8PWMLIB_SLICE1, CCU8PWMLIB_SLICE2, CCU8PWMLIB_SLICE3 }
enum  CCU8PWMLIB_ErrorCodesType {
  CCU8PWMLIB_OPER_NOT_ALLOWED_ERROR = 1, CCU8PWMLIB_INVALID_PARAM_ERROR, CCU8PWMLIB_IN_TRAP_ERROR, CCU8PWMLIB_FUNCTION_ENTRY,
  CCU8PWMLIB_FUNCTION_EXIT
}
enum  CCU8PWMLIB_DeadTimeConfType { CCU8PWMLIB_DISABLE, CCU8PWMLIB_ENABLE, CCU8PWMLIB_ENABLEDIRECTOUTPUT, CCU8PWMLIB_ENABLEINVERTEDOUTPUT }
enum  CCU8PWMLIB_CompareModeType { CCU8PWMLIB_SYMMETRIC, CCU8PWMLIB_ASYMMETRIC }
enum  CCU8PWMLIB_EdgeTriggerType { CCU8PWMLIB_NOTRIGGER, CCU8PWMLIB_RISINGEDGE, CCU8PWMLIB_FALLINGEDGE, CCU8PWMLIB_BOTHEDGES }
enum  CCU8PWMLIB_CountingModeType { CCU8PWMLIB_EDGE_ALIGNED, CCU8PWMLIB_CENTER_ALIGNED }
enum  CCU8PWMLIB_ExtStartConfigType { CCU8PWMLIB_START_TIMER, CCU8PWMLIB_CLEAR_START_TIMER }
enum  CCU8PWMLIB_ExtStopConfigType { CCU8PWMLIB_STOP_TIMER, CCU8PWMLIB_CLEAR_TIMER, CCU8PWMLIB_CLEAR_STOP_TIMER }
enum  CCU8PWMLIB_EventNameType {
  CCU8PWMLIB_PERIODMATCHEVENT = 0, CCU8PWMLIB_COMPAREMATCHEVENT = 2, CCU8PWMLIB_EXTSTARTEVENT = 8, CCU8PWMLIB_EXTSTOPEVENT = 9,
  CCU8PWMLIB_TRAPEVENT = 10
}
typedef enum CCU8PWMLIB_StateType CCU8PWMLIB_StateType
typedef enum
CCU8PWMLIB_CCUInUseType 
CCU8PWMLIB_CCUInUseType
typedef enum
CCU8PWMLIB_ErrorCodesType 
CCU8PWMLIB_ErrorCodesType
typedef enum
CCU8PWMLIB_DeadTimeConfType 
CCU8PWMLIB_DeadTimeConfType
typedef enum
CCU8PWMLIB_CompareModeType 
CCU8PWMLIB_CompareModeType
typedef enum
CCU8PWMLIB_CountingModeType 
CCU8PWMLIB_CountingModeType
typedef enum
CCU8PWMLIB_ExtStartConfigType 
CCU8PWMLIB_ExtStartConfigType
typedef enum
CCU8PWMLIB_ExtStopConfigType 
CCU8PWMLIB_ExtStopConfigType
typedef enum
CCU8PWMLIB_EventNameType 
CCU8PWMLIB_EventNameType
typedef struct
CCU8PWMLIB_TimerRegsType 
CCU8PWMLIB_TimerRegsType
typedef struct
CCU8PWMLIB_DynamicHandleType 
CCU8PWMLIB_DynamicHandleType
typedef struct
CCU8PWMLIB_HandleType 
CCU8PWMLIB_HandleType

Go to the source code of this file.