extern const struct pbl_timer_stm32_lptim_cs sym##_cs_inst; \
extern const struct pbl_timer_stm32_lptim_ce sym##_ce_inst; \
static struct pbl_timer_stm32_lptim_state sym##_state; \
static const struct pbl_timer_stm32_lptim sym##_lptim = { \
.state = &sym##_state, \
.cs = &sym##_cs_inst.cs, \
.ce = &sym##_ce_inst.ce, \
.base = (_base), \
.irq = _irq, \
.clk = _clk, \
.rst = _rst, \
}; \
PBL_DEVICE_STATE_DEFINE(sym##_cs); \
PBL_DEVICE_INSTANCE(sym##_cs,
struct pbl_timer_stm32_lptim_cs,
struct pbl_clocksource, cs){ \
.cs = \
PBL_CLOCKSOURCE_INIT(sym##_cs, _name, pbl_timer_stm32_lptim_cs_init, nullptr, \
&pbl_timer_stm32_lptim_cs_ops, PBL_TIMER_STM32_LPTIM__COUNTER_BITS), \
.lptim = &sym##_lptim, \
}; \
PBL_DEVICE_STATE_DEFINE(sym##_ce); \
PBL_DEVICE_INSTANCE(sym##_ce,
struct pbl_timer_stm32_lptim_ce,
struct pbl_clockevent, ce){ \
&pbl_timer_stm32_lptim_ce_ops, PBL_TIMER_STM32_LPTIM__MIN_DELTA, \
PBL_TIMER_STM32_LPTIM__MAX_DELTA), \
.lptim = &sym##_lptim, \
}; \
pbl_timer_stm32_lptim_sys_off, (void *)&sym##_lptim)
Clock event device: a one-shot timer interrupt.
Definition timer.h:73
Clock source: a free-running counter.
Definition timer.h:52
#define PBL_CLOCKEVENT_INIT(sym, _name, _init, _parent, _ops, _min, _max)
Clock event device initializer.
Definition timer.h:113
#define PBL_SYS_OFF_PRIO_LOW
Priority of handlers that must run after the others of their mode.
Definition reboot.h:56
@ PBL_SYS_OFF_POWER_OFF
Power off the system.
Definition reboot.h:50
Define the clock source and clock event device of an LPTIM.