PebbleOS v4.47.0-505-g4bbc630fa
Loading...
Searching...
No Matches
SF32LB52 crystal trim

Load capacitance trim of the 48 MHz crystal, from the SoC factory configuration in the flash OTP area. More...

Data Structures

struct  pbl_clk_sf32lb52_hxt
 Crystal trim, a child of the flash holding the configuration. More...
 

Macros

#define PBL_CLK_SF32LB52_HXT_DEFINE(sym, _name, _base, _flash, ...)
 Define the crystal trim.
 

Detailed Description

Load capacitance trim of the 48 MHz crystal, from the SoC factory configuration in the flash OTP area.

The configuration is a list of records (one byte id, one byte length, data) in the OTP cells given, searched in order. The first crystal record found is applied once the flash is up.

PBL_CLK_SF32LB52_HXT_DEFINE(s_hxt48, "hxt48", 0x500ca000, &s_flash, "soc-config-user");
#define PBL_CLK_SF32LB52_HXT_DEFINE(sym, _name, _base, _flash,...)
Define the crystal trim.
Definition sf32lb52_hxt.h:54

Data Structure Documentation

◆ pbl_clk_sf32lb52_hxt

struct pbl_clk_sf32lb52_hxt

Crystal trim, a child of the flash holding the configuration.

Data Fields
uintptr_t base PMUC registers.
const char *const * cells Names of the OTP cells holding it, in search order.
struct pbl_device dev Device.
const struct pbl_flash * flash Flash holding the configuration.
uint8_t num_cells Number of cells.

Macro Definition Documentation

◆ PBL_CLK_SF32LB52_HXT_DEFINE

#define PBL_CLK_SF32LB52_HXT_DEFINE (   sym,
  _name,
  _base,
  _flash,
  ... 
)
Value:
static const char *const sym##_cells[] = {__VA_ARGS__}; \
extern const struct pbl_clk_sf32lb52_hxt sym##_inst; \
PBL_DEVICE_REGISTER(sym##_inst, &sym##_inst.dev); \
PBL_DEVICE_ALIAS(sym, sym##_inst, struct pbl_clk_sf32lb52_hxt, struct pbl_device, dev); \
const struct pbl_clk_sf32lb52_hxt sym##_inst = { \
.dev = PBL_DEVICE_INIT(sym, _name, pbl_clk_sf32lb52_hxt_init, &(_flash)->dev), \
.base = (_base), \
.flash = (_flash), \
.cells = sym##_cells, \
.num_cells = PBL_ARRAY_SIZE(sym##_cells), \
}
const struct pbl_flash * flash
Flash holding the configuration.
Definition sf32lb52_hxt.h:34
struct pbl_device dev
Device.
Definition sf32lb52_hxt.h:30
Crystal trim, a child of the flash holding the configuration.
Definition sf32lb52_hxt.h:28
#define PBL_DEVICE_INIT(sym, _name, _init, _parent)
Initializer for the struct pbl_device of device instance sym.
Definition device.h:169
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
#define PBL_ARRAY_SIZE(array)
Get the number of elements of an array.
Definition size.h:40
A hardware device.
Definition device.h:90

Define the crystal trim.

Parameters
symSymbol of the device.
_nameName.
_basePMUC registers.
_flashFlash, a struct pbl_flash.
...Names of the OTP cells holding the configuration, in search order.