206 #ifndef ti_drivers_PWM__include 207 #define ti_drivers_PWM__include 220 #define PWM_DUTY_FRACTION_MAX ((uint32_t) ~0) 233 #define PWM_CMD_RESERVED (32) 247 #define PWM_STATUS_RESERVED (-32) 256 #define PWM_STATUS_SUCCESS (0) 264 #define PWM_STATUS_ERROR (-1) 273 #define PWM_STATUS_UNDEFINEDCMD (-2) 281 #define PWM_STATUS_INVALID_PERIOD (-3) 289 #define PWM_STATUS_INVALID_DUTY (-4) 391 uint32_t duty, uint32_t period);
459 extern void PWM_close(PWM_Handle handle);
480 extern int_fast16_t
PWM_control(PWM_Handle handle, uint_fast16_t cmd,
545 extern int_fast16_t
PWM_setDuty(PWM_Handle handle, uint32_t duty);
566 extern int_fast16_t
PWM_setPeriod(PWM_Handle handle, uint32_t period);
611 extern void PWM_start(PWM_Handle handle);
624 extern void PWM_stop(PWM_Handle handle);
PWM_Duty_Units dutyUnits
Definition: PWM.h:336
int_fast16_t PWM_control(PWM_Handle handle, uint_fast16_t cmd, void *arg)
Function performs implementation specific features on a given PWM_Handle.
void PWM_close(PWM_Handle handle)
Function to close a PWM instance specified by the PWM handle.
struct PWM_Config_ * PWM_Handle
A handle that is returned from a PWM_open() call.
Definition: PWM.h:346
PWM_OpenFxn openFxn
Definition: PWM.h:418
PWM_SetDutyFxn setDutyFxn
Definition: PWM.h:420
PWM_Handle PWM_open(uint_least8_t index, PWM_Params *params)
This function opens a given PWM instance and sets the period, duty and idle level to those specified ...
PWM_Duty_Units
PWM duty cycle unit definitions. Refer to device specific implementation if using PWM_DUTY_COUNTS (ra...
Definition: PWM.h:306
uint32_t dutyValue
Definition: PWM.h:337
PWM Global configuration.
Definition: PWM.h:438
PWM_CloseFxn closeFxn
Definition: PWM.h:412
int_fast16_t PWM_setDutyAndPeriod(PWM_Handle handle, uint32_t duty, uint32_t period)
Function to set both the period and the duty cycle of the specified PWM handle. This API must be call...
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:295
int_fast16_t(* PWM_ControlFxn)(PWM_Handle handle, uint_fast16_t cmd, void *arg)
A function pointer to a driver specific implementation of PWM_control().
Definition: PWM.h:358
void(* PWM_CloseFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_close().
Definition: PWM.h:352
void(* PWM_StopFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_stop().
Definition: PWM.h:403
The definition of a PWM function table that contains the required set of functions to control a speci...
Definition: PWM.h:410
int_fast16_t(* PWM_SetDutyFxn)(PWM_Handle handle, uint32_t duty)
A function pointer to a driver specific implementation of PWM_setDuty().
Definition: PWM.h:376
PWM_SetPeriodFxn setPeriodFxn
Definition: PWM.h:422
PWM_StopFxn stopFxn
Definition: PWM.h:428
void * object
Definition: PWM.h:442
void const * hwAttrs
Definition: PWM.h:444
void(* PWM_StartFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_start().
Definition: PWM.h:397
PWM_FxnTable const * fxnTablePtr
Definition: PWM.h:440
int_fast16_t(* PWM_SetDutyAndPeriodFxn)(PWM_Handle handle, uint32_t duty, uint32_t period)
A function pointer to a driver specific implementation of PWM_setDutyAndPeriod(). ...
Definition: PWM.h:390
PWM_SetDutyAndPeriodFxn setDutyAndPeriodFxn
Definition: PWM.h:424
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:370
PWM Parameters.
Definition: PWM.h:333
PWM_Period_Units periodUnits
Definition: PWM.h:334
int_fast16_t 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...
void(* PWM_InitFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_init().
Definition: PWM.h:364
struct PWM_Config_ PWM_Config
PWM Global configuration.
PWM_ControlFxn controlFxn
Definition: PWM.h:414
int_fast16_t 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...
int_fast16_t(* PWM_SetPeriodFxn)(PWM_Handle handle, uint32_t period)
A function pointer to a driver specific implementation of PWM_setPeriod().
Definition: PWM.h:383
uint32_t periodValue
Definition: PWM.h:335
PWM_IdleLevel
Idle output level when PWM is not running (stopped / not started).
Definition: PWM.h:320
PWM_InitFxn initFxn
Definition: PWM.h:416
PWM_StartFxn startFxn
Definition: PWM.h:426
void * custom
Definition: PWM.h:339
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:338