HWA
Bare metal programming with style
Class _psb: clock prescaler

A class _psb object is a resettable clock prescaler that can be connected to one of 3 possible clocks:

It is used in:

Actions


configure:

hwa( configure, prescaler0,
clock, ioclk
| pll_32MHz
| pll_64MHz );

Note 1 pll_32MHz is not available when the PLL is used as system clock (HW_DEVICE_CLK_SRC is "`rc_pll_16MHz`").

Note 2 pll_64MHz is not available when supply voltage is below 2.7 V (HW_DEVICE_BODLEVEL is "`1700_2000mV`").

Note 3 It is highly recommended that the counter is stopped whenever the prescaler clock is switched between "`pll_32MHz`" and "`pll_64MHz`".

Note 4 Turning the PLL on requires a special procedure that taked about 100 µs to execute.

Note 5 The PLL is never stopped once it has been turned on.

Reset

The reset action resets the prescaler immediately without stopping it:

hw( reset, prescaler0 );
hwa
#define hwa(...)
hwa( action, object [,...] ) stores an action for an object into a HWA context.
Definition: hwa_macros.h:552
hw
#define hw(...)
hw( action, object [,...] ) executes an action immediately on an object.
Definition: hwa_macros.h:523