206 #ifndef ti_drivers_PWM__include 207 #define ti_drivers_PWM__include 219 #define PWM_DUTY_FRACTION_MAX ((uint32_t)~0) 232 #define PWM_CMD_RESERVED (32) 246 #define PWM_STATUS_RESERVED (-32) 255 #define PWM_STATUS_SUCCESS (0) 263 #define PWM_STATUS_ERROR (-1) 272 #define PWM_STATUS_UNDEFINEDCMD (-2) 280 #define PWM_STATUS_INVALID_PERIOD (-3) 288 #define PWM_STATUS_INVALID_DUTY (-4) 361 typedef int_fast16_t (*
PWM_ControlFxn)(PWM_Handle handle, uint_fast16_t cmd,
void *arg);
460 extern void PWM_close(PWM_Handle handle);
481 extern int_fast16_t
PWM_control(PWM_Handle handle, uint_fast16_t cmd,
void *arg);
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:339
ADC_Params params
Definition: Driver_Init.h:11
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:349
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:340
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:294
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:361
void(* PWM_CloseFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_close().
Definition: PWM.h:355
void(* PWM_StopFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_stop().
Definition: PWM.h:402
The definition of a PWM function table that contains the required set of functions to control a speci...
Definition: PWM.h:409
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:378
PWM_SetPeriodFxn setPeriodFxn
Definition: PWM.h:422
PWM_StopFxn stopFxn
Definition: PWM.h:428
void * object
Definition: PWM.h:443
void const * hwAttrs
Definition: PWM.h:445
void(* PWM_StartFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_start().
Definition: PWM.h:396
PWM_FxnTable const * fxnTablePtr
Definition: PWM.h:441
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:372
PWM Parameters.
Definition: PWM.h:335
PWM_Period_Units periodUnits
Definition: PWM.h:337
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:366
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:384
uint32_t periodValue
Definition: PWM.h:338
PWM_IdleLevel
Idle output level when PWM is not running (stopped / not started).
Definition: PWM.h:321
PWM_InitFxn initFxn
Definition: PWM.h:416
PWM_StartFxn startFxn
Definition: PWM.h:426
void * custom
Definition: PWM.h:342
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:341