PWM controller driver for the SF32LB general-purpose timers.
More...
PWM controller driver for the SF32LB general-purpose timers.
Four channels counting PCLK, sharing the period: a channel cannot change it while another one runs. Duty cycle changes take effect at the end of the running period, a period change restarts it. A disabled channel drives its inactive level. PCLK stops in deep sleep, so the system stays out of it while a channel runs.
&s_gptim1_default);
#define SF32LB57_HPSYS_CLK_GPTIM1
Definition sf32lb.h:135
#define PBL_CLK(_ctrl, _id)
Initializer for a struct pbl_clk.
Definition clk.h:132
#define SF32LB57_PINCTRL
HPSYS pin controller.
Definition sf32lb57.h:108
#define PBL_PINCTRL_STATE_DEFINE(sym, _ctrl,...)
Define a pin state.
Definition pinctrl.h:98
#define PBL_PWM_SF32LB_GPTIM_DEFINE(sym, _name, _base, _clk, _pinctrl)
Define an SF32LB GPTIM PWM controller.
Definition sf32lb_gptim.h:67
◆ pbl_pwm_sf32lb_gptim
| struct pbl_pwm_sf32lb_gptim |
SF32LB GPTIM PWM controller.
| Data Fields |
|
uintptr_t |
base |
Timer registers. |
|
struct pbl_clk |
clk |
Counter clock, PCLK. |
|
struct pbl_pwm_controller |
ctrl |
PWM controller. |
|
struct pbl_pinctrl |
pinctrl |
Output pins. |
|
struct pbl_pwm_sf32lb_gptim_state * |
state |
Runtime state. |
◆ PBL_PWM_SF32LB_GPTIM_DEFINE
| #define PBL_PWM_SF32LB_GPTIM_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_base, |
|
|
|
_clk, |
|
|
|
_pinctrl |
|
) |
| |
Value:
static struct pbl_pwm_sf32lb_gptim_state sym##_gptim_state; \
&pbl_pwm_sf32lb_gptim_ops), \
.pinctrl =
PBL_PINCTRL(_pinctrl,
nullptr, 0), .base = (_base), .clk = _clk, \
.state = &sym##_gptim_state, \
}
#define PBL_PINCTRL(_default, _sleep, _reg)
Initializer for a struct pbl_pinctrl.
Definition pinctrl.h:132
SF32LB GPTIM PWM controller.
Definition sf32lb_gptim.h:40
A PWM controller.
Definition pwm.h:110
#define PBL_PWM_CONTROLLER_INIT(sym, _name, _init, _parent, _ops)
Initializer for the struct pbl_pwm_controller of controller sym.
Definition pwm.h:141
#define PBL_PWM_CONTROLLER_STATE_DEFINE(sym, _num_channels)
Define the class state of PWM controller sym, for the driver's define macro.
Definition pwm.h:127
Define an SF32LB GPTIM PWM controller.
- Parameters
-