Interface for PWM controller drivers.
More...
Interface for PWM controller drivers.
A driver embeds a struct pbl_pwm_controller in its instance, sets it up with PBL_PWM_CONTROLLER_STATE_DEFINE() and PBL_PWM_CONTROLLER_INIT(), and implements the struct pbl_pwm_controller_ops the class calls.
◆ pbl_pwm_controller
| struct pbl_pwm_controller |
◆ PBL_PWM_CONTROLLER_INIT
| #define PBL_PWM_CONTROLLER_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_init, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
.states = sym##_pwm_states, \
.num_channels = sizeof(sym##_pwm_states) / sizeof(sym##_pwm_states[0]), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
const struct pbl_device_class pbl_pwm_class
Class of the PWM controllers.
Initializer for the struct pbl_pwm_controller of controller sym.
- Parameters
-
| sym | Symbol of the controller instance, with its state defined by PBL_PWM_CONTROLLER_STATE_DEFINE(). |
| _name | Name. |
| _init | Device init function, or NULL. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
◆ PBL_PWM_CONTROLLER_STATE_DEFINE
| #define PBL_PWM_CONTROLLER_STATE_DEFINE |
( |
|
sym, |
|
|
|
_num_channels |
|
) |
| |
Value:
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
Output state.
Definition pwm.h:62
Define the class state of PWM controller sym, for the driver's define macro.
- Parameters
-
| sym | Symbol of the controller instance. |
| _num_channels | Number of channels. |
◆ pbl_pwm_class
Class of the PWM controllers.