PebbleOS v4.43.0-108-gde23235b2
Loading...
Searching...
No Matches
SF32LB LPTIM PWM

PWM controller driver for the SF32LB low-power timers. More...

Data Structures

struct  pbl_pwm_sf32lb_lptim
 SF32LB LPTIM PWM controller. More...
 

Macros

#define PBL_PWM_SF32LB_LPTIM_DEFINE(sym, _name, _idx, _pinctrl, _deps)
 Define an SF32LB LPTIM PWM controller.
 

Detailed Description

PWM controller driver for the SF32LB low-power timers.

One channel, counting the RC10K low-power clock, so it keeps running in deep sleep. The period and duty cycle resolution is one RC10K cycle, about 100 us; the frequency is the calibrated one when the output is applied. The pin state can route the inverted output too.

SF32LB52_PA24_PBR_LPTIM2_OUT | PBL_PINCTRL_SF32LB52_INPUT,
SF32LB52_PA25_PBR_LPTIM2_INV_OUT | PBL_PINCTRL_SF32LB52_INPUT);
PBL_PWM_SF32LB_LPTIM_DEFINE(s_lptim2, "lptim2", 2, &s_lptim2_default, NULL);
#define SF32LB52_PINCTRL
HPSYS pin controller.
Definition sf32lb52.h:120
#define PBL_PINCTRL_SF32LB52_INPUT
Input buffer enabled.
Definition sf32lb52.h:85
#define PBL_PINCTRL_STATE_DEFINE(sym, _ctrl,...)
Define a pin state.
Definition pinctrl.h:97
#define PBL_PWM_SF32LB_LPTIM_DEFINE(sym, _name, _idx, _pinctrl, _deps)
Define an SF32LB LPTIM PWM controller.
Definition sf32lb_lptim.h:53

Data Structure Documentation

◆ pbl_pwm_sf32lb_lptim

struct pbl_pwm_sf32lb_lptim

SF32LB LPTIM PWM controller.

Data Fields
struct pbl_pwm_controller ctrl PWM controller.
uint8_t index Timer instance, 1 or 2.
struct pbl_pinctrl pinctrl Output pins.

Macro Definition Documentation

◆ PBL_PWM_SF32LB_LPTIM_DEFINE

#define PBL_PWM_SF32LB_LPTIM_DEFINE (   sym,
  _name,
  _idx,
  _pinctrl,
  _deps 
)
Value:
const struct pbl_pwm_sf32lb_lptim sym = { \
.ctrl = PBL_PWM_CONTROLLER_INIT(sym, _name, pbl_pwm_sf32lb_lptim_init, _deps, \
&pbl_pwm_sf32lb_lptim_ops), \
.pinctrl = PBL_PINCTRL(_pinctrl, nullptr, 0), \
.index = (_idx), \
}; \
PBL_DEVICE_REGISTER(sym, &sym.ctrl.dev)
#define PBL_PINCTRL(_default, _sleep, _reg)
Initializer for a struct pbl_pinctrl.
Definition pinctrl.h:131
struct pbl_pwm_controller ctrl
PWM controller.
Definition sf32lb_lptim.h:32
SF32LB LPTIM PWM controller.
Definition sf32lb_lptim.h:30
struct pbl_device dev
Device.
Definition pwm.h:112
#define PBL_PWM_CONTROLLER_INIT(sym, _name, _init, _deps, _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 LPTIM PWM controller.

Parameters
symSymbol of the controller.
_nameName.
_idxTimer instance, 1 or 2.
_pinctrlPin state with the outputs, from PBL_PINCTRL_STATE_DEFINE().
_depsDependencies from PBL_DEVICE_DEPS(), or NULL.