241 #ifndef ti_drivers_PWM__include 242 #define ti_drivers_PWM__include 254 #define PWM_DUTY_FRACTION_MAX ((uint32_t) ~0) 267 #define PWM_CMD_RESERVED (32) 281 #define PWM_STATUS_RESERVED (-32) 290 #define PWM_STATUS_SUCCESS (0) 298 #define PWM_STATUS_ERROR (-1) 307 #define PWM_STATUS_UNDEFINEDCMD (-2) 315 #define PWM_STATUS_INVALID_PERIOD (-3) 323 #define PWM_STATUS_INVALID_DUTY (-4) 423 uint32_t duty, uint32_t period);
491 extern void PWM_close(PWM_Handle handle);
512 extern int_fast16_t
PWM_control(PWM_Handle handle, uint_fast16_t cmd,
577 extern int_fast16_t
PWM_setDuty(PWM_Handle handle, uint32_t duty);
598 extern int_fast16_t
PWM_setPeriod(PWM_Handle handle, uint32_t period);
642 extern void PWM_start(PWM_Handle handle);
655 extern void PWM_stop(PWM_Handle handle);
struct PWM_Params_ PWM_Params
PWM Parameters.
PWM_InitFxn initFxn
Definition: PWM.h:448
int_fast16_t PWM_control(PWM_Handle handle, uint_fast16_t cmd, void *arg)
Function performs implementation specific features on a given PWM_Handle.
uint32_t dutyValue
Definition: PWM.h:369
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:378
PWM_Duty_Units dutyUnits
Definition: PWM.h:368
PWM_IdleLevel_
Idle output level when PWM is not running (stopped / not started).
Definition: PWM.h:352
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 ...
uint32_t periodValue
Definition: PWM.h:367
PWM_SetDutyFxn setDutyFxn
Definition: PWM.h:452
PWM_Duty_Units_
PWM duty cycle unit definitions. Refer to device specific implementation if using PWM_DUTY_COUNTS (ra...
Definition: PWM.h:340
PWM Global configuration.
Definition: PWM.h:470
PWM_Period_Units_
PWM period unit definitions. Refer to device specific implementation if using PWM_PERIOD_COUNTS (raw ...
Definition: PWM.h:329
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.
The definition of a PWM function table that contains the required set of functions to control a speci...
Definition: PWM.h:442
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:390
void(* PWM_CloseFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_close().
Definition: PWM.h:384
PWM_Period_Units periodUnits
Definition: PWM.h:366
PWM_StartFxn startFxn
Definition: PWM.h:458
void(* PWM_StopFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_stop().
Definition: PWM.h:435
PWM_SetDutyAndPeriodFxn setDutyAndPeriodFxn
Definition: PWM.h:456
PWM_IdleLevel idleLevel
Definition: PWM.h:370
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:408
PWM Parameters.
Definition: PWM.h:365
enum PWM_Period_Units_ PWM_Period_Units
PWM period unit definitions. Refer to device specific implementation if using PWM_PERIOD_COUNTS (raw ...
void * object
Definition: PWM.h:474
void const * hwAttrs
Definition: PWM.h:476
PWM_StopFxn stopFxn
Definition: PWM.h:460
void(* PWM_StartFxn)(PWM_Handle handle)
A function pointer to a driver specific implementation of PWM_start().
Definition: PWM.h:429
PWM_FxnTable const * fxnTablePtr
Definition: PWM.h:472
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:422
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:402
PWM_ControlFxn controlFxn
Definition: PWM.h:446
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:396
struct PWM_Config_ PWM_Config
PWM Global configuration.
enum PWM_IdleLevel_ PWM_IdleLevel
Idle output level when PWM is not running (stopped / not started).
PWM_SetPeriodFxn setPeriodFxn
Definition: PWM.h:454
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:415
void * custom
Definition: PWM.h:371
PWM_CloseFxn closeFxn
Definition: PWM.h:444
struct PWM_FxnTable_ PWM_FxnTable
The definition of a PWM function table that contains the required set of functions to control a speci...
PWM_OpenFxn openFxn
Definition: PWM.h:450
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.
enum PWM_Duty_Units_ PWM_Duty_Units
PWM duty cycle unit definitions. Refer to device specific implementation if using PWM_DUTY_COUNTS (ra...