139 #ifndef ti_drivers_PWM__include
140 #define ti_drivers_PWM__include
152 #define PWM_DUTY_FRACTION_MAX ((uint32_t) ~0)
165 #define PWM_CMD_RESERVED (32)
179 #define PWM_STATUS_RESERVED (-32)
188 #define PWM_STATUS_SUCCESS (0)
196 #define PWM_STATUS_ERROR (-1)
205 #define PWM_STATUS_UNDEFINEDCMD (-2)
213 #define PWM_STATUS_INVALID_PERIOD (-3)
221 #define PWM_STATUS_INVALID_DUTY (-4)
312 uint32_t periodValue);
378 extern void PWM_close(PWM_Handle handle);
399 extern int PWM_control(PWM_Handle handle,
unsigned int cmd,
void *arg);
463 extern int PWM_setDuty(PWM_Handle handle, uint32_t duty);
484 extern int PWM_setPeriod(PWM_Handle handle, uint32_t period);
496 extern void PWM_start(PWM_Handle handle);
509 extern void PWM_stop(PWM_Handle handle);
PWM_Duty_Units dutyUnits
Definition: PWM.h:262
int PWM_setPeriod(PWM_Handle handle, uint32_t period)
Function to set the period of the specified PWM handle. This API can be called while the PWM is runni...
void PWM_close(PWM_Handle handle)
Function to close a PWM instance specified by the PWM handle.
PWM Global configuration.
Definition: PWM.h:357
PWM_OpenFxn openFxn
Definition: PWM.h:339
PWM_SetDutyFxn setDutyFxn
Definition: PWM.h:341
PWM_FxnTable const * fxnTablePtr
Definition: PWM.h:359
PWM_Duty_Units
PWM duty cycle unit definitions. Refer to device specific implementation if using PWM_DUTY_COUNTS (ra...
Definition: PWM.h:237
PWM_Handle PWM_open(unsigned int index, PWM_Params *params)
This function opens a given PWM instance and sets the period, duty and idle level to those specified ...
uintptr_t custom
Definition: PWM.h:265
int PWM_setDuty(PWM_Handle handle, uint32_t duty)
Function to set the duty cycle of the specified PWM handle. PWM instances run in active high output m...
uint32_t dutyValue
Definition: PWM.h:263
struct PWM_Config PWM_Config
PWM Global configuration.
PWM_CloseFxn closeFxn
Definition: PWM.h:333
void * object
Definition: PWM.h:361
void PWM_init(void)
This function initializes the PWM module.
PWM_Period_Units
PWM period unit definitions. Refer to device specific implementation if using PWM_PERIOD_COUNTS (raw ...
Definition: PWM.h:227
struct PWM_Params PWM_Params
PWM Parameters.
void(* PWM_CloseFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_close().
Definition: PWM.h:278
int PWM_control(PWM_Handle handle, unsigned int cmd, void *arg)
Function performs implementation specific features on a given PWM_Handle.
void(* PWM_StopFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_stop().
Definition: PWM.h:324
The definition of a PWM function table that contains the required set of functions to control a speci...
Definition: PWM.h:331
int(* PWM_SetPeriodFxn)(PWM_Handle handle, uint32_t periodValue)
A function pointer to a driver specific implementation of PWM_setPeriod().
Definition: PWM.h:311
struct PWM_Config * PWM_Handle
A handle that is returned from a PWM_open() call.
Definition: PWM.h:272
PWM_SetPeriodFxn setPeriodFxn
Definition: PWM.h:343
PWM_StopFxn stopFxn
Definition: PWM.h:347
void const * hwAttrs
Definition: PWM.h:363
void(* PWM_StartFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_start().
Definition: PWM.h:318
struct PWM_FxnTable PWM_FxnTable
The definition of a PWM function table that contains the required set of functions to control a speci...
void PWM_Params_init(PWM_Params *params)
Function to initialize the PWM_Params structure to default values.
PWM_Handle(* PWM_OpenFxn)(PWM_Handle handle, PWM_Params *params)
A function pointer to a driver specific implementation of PWM_open().
Definition: PWM.h:297
PWM Parameters.
Definition: PWM.h:259
PWM_Period_Units periodUnits
Definition: PWM.h:260
void(* PWM_InitFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_init().
Definition: PWM.h:291
int(* PWM_SetDutyFxn)(PWM_Handle handle, uint32_t dutyValue)
A function pointer to a driver specific implementation of PWM_setDuty().
Definition: PWM.h:304
int(* PWM_ControlFxn)(PWM_Handle handle, unsigned int cmd, void *arg)
A function pointer to a driver specific implementation of PWM_control().
Definition: PWM.h:284
PWM_ControlFxn controlFxn
Definition: PWM.h:335
uint32_t periodValue
Definition: PWM.h:261
PWM_IdleLevel
Idle output level when PWM is not running (stopped / not started).
Definition: PWM.h:246
PWM_InitFxn initFxn
Definition: PWM.h:337
PWM_StartFxn startFxn
Definition: PWM.h:345
void PWM_stop(PWM_Handle handle)
Function to stop the specified PWM handle. Output will set to the idle level specified by params in P...
void PWM_start(PWM_Handle handle)
Function to start the specified PWM handle with current settings.
PWM_IdleLevel idleLevel
Definition: PWM.h:264