XU XUv0.13.1
中文

#embedded/chips/esp32

import: #embedded/chips/esp32

counts: 131 functions, 37 methods, 6 types, 166 constants, 0 method sets

ESP32 Chip Standard Library Package Provides MMIO registers, WDT, GPIO, IO_MUX, UART, SPI, Timer, Wi-Fi, and Bluetooth (BLE).

const BLE_ADV_TYPE_IND

XuAPI
pub const BLE_ADV_TYPE_IND         = 0x00

Purpose

BLE GAP Advertising Types

const BLE_ADV_TYPE_DIRECT_IND

XuAPI
pub const BLE_ADV_TYPE_DIRECT_IND  = 0x01

Purpose

Constant BLE_ADV_TYPE_DIRECT_IND, defining protocol or algorithm parameters.

const BLE_ADV_TYPE_SCAN_IND

XuAPI
pub const BLE_ADV_TYPE_SCAN_IND    = 0x02

Purpose

Constant BLE_ADV_TYPE_SCAN_IND, defining protocol or algorithm parameters.

const BLE_ADV_TYPE_NONCONN_IND

XuAPI
pub const BLE_ADV_TYPE_NONCONN_IND = 0x03

Purpose

Constant BLE_ADV_TYPE_NONCONN_IND, defining protocol or algorithm parameters.

const BLE_GAP_AD_FLAGS

XuAPI
pub const BLE_GAP_AD_FLAGS            = 0x01

Purpose

BLE GAP AD (Advertising Data) Types per Bluetooth SIG

const BLE_GAP_AD_UUID16_SOME

XuAPI
pub const BLE_GAP_AD_UUID16_SOME      = 0x02

Purpose

Constant BLE_GAP_AD_UUID16_SOME, defining protocol or algorithm parameters.

const BLE_GAP_AD_UUID16_ALL

XuAPI
pub const BLE_GAP_AD_UUID16_ALL       = 0x03

Purpose

Constant BLE_GAP_AD_UUID16_ALL, defining protocol or algorithm parameters.

const BLE_GAP_AD_UUID32_SOME

XuAPI
pub const BLE_GAP_AD_UUID32_SOME      = 0x04

Purpose

Constant BLE_GAP_AD_UUID32_SOME, defining protocol or algorithm parameters.

const BLE_GAP_AD_UUID32_ALL

XuAPI
pub const BLE_GAP_AD_UUID32_ALL       = 0x05

Purpose

Constant BLE_GAP_AD_UUID32_ALL, defining protocol or algorithm parameters.

const BLE_GAP_AD_UUID128_SOME

XuAPI
pub const BLE_GAP_AD_UUID128_SOME     = 0x06

Purpose

Constant BLE_GAP_AD_UUID128_SOME, defining protocol or algorithm parameters.

const BLE_GAP_AD_UUID128_ALL

XuAPI
pub const BLE_GAP_AD_UUID128_ALL      = 0x07

Purpose

Constant BLE_GAP_AD_UUID128_ALL, defining protocol or algorithm parameters.

const BLE_GAP_AD_NAME_SHORT

XuAPI
pub const BLE_GAP_AD_NAME_SHORT       = 0x08

Purpose

Constant BLE_GAP_AD_NAME_SHORT, defining protocol or algorithm parameters.

const BLE_GAP_AD_NAME_COMPLETE

XuAPI
pub const BLE_GAP_AD_NAME_COMPLETE    = 0x09

Purpose

Constant BLE_GAP_AD_NAME_COMPLETE, defining protocol or algorithm parameters.

const BLE_GAP_AD_TX_PWR

XuAPI
pub const BLE_GAP_AD_TX_PWR           = 0x0A

Purpose

Constant BLE_GAP_AD_TX_PWR, defining protocol or algorithm parameters.

const BLE_GAP_FLAG_LE_LIMITED_DISC

XuAPI
pub const BLE_GAP_FLAG_LE_LIMITED_DISC = 0x01

Purpose

BLE Advertising Flags

const BLE_GAP_FLAG_LE_GEN_DISC

XuAPI
pub const BLE_GAP_FLAG_LE_GEN_DISC     = 0x02

Purpose

Constant BLE_GAP_FLAG_LE_GEN_DISC, defining protocol or algorithm parameters.

const BLE_GAP_FLAG_BR_EDR_NOT_SUPP

XuAPI
pub const BLE_GAP_FLAG_BR_EDR_NOT_SUPP = 0x04

Purpose

Constant BLE_GAP_FLAG_BR_EDR_NOT_SUPP, defining protocol or algorithm parameters.

const BLE_UUID_SERV_HID

XuAPI
pub const BLE_UUID_SERV_HID       = 0x1812

Purpose

Standard GATT Service UUIDs

const BLE_UUID_SERV_BATTERY

XuAPI
pub const BLE_UUID_SERV_BATTERY   = 0x180F

Purpose

Constant BLE_UUID_SERV_BATTERY, defining protocol or algorithm parameters.

const BLE_UUID_SERV_DEVINFO

XuAPI
pub const BLE_UUID_SERV_DEVINFO   = 0x180A

Purpose

Constant BLE_UUID_SERV_DEVINFO, defining protocol or algorithm parameters.

const HID_MOUSE_BTN_NONE

XuAPI
pub const HID_MOUSE_BTN_NONE   = 0x00

Purpose

HID Mouse Button Masks

const HID_MOUSE_BTN_LEFT

XuAPI
pub const HID_MOUSE_BTN_LEFT   = 0x01

Purpose

Constant HID_MOUSE_BTN_LEFT, defining protocol or algorithm parameters.

const HID_MOUSE_BTN_RIGHT

XuAPI
pub const HID_MOUSE_BTN_RIGHT  = 0x02

Purpose

Constant HID_MOUSE_BTN_RIGHT, defining protocol or algorithm parameters.

const HID_MOUSE_BTN_MIDDLE

XuAPI
pub const HID_MOUSE_BTN_MIDDLE = 0x04

Purpose

Constant HID_MOUSE_BTN_MIDDLE, defining protocol or algorithm parameters.

const HID_MOD_LCTRL

XuAPI
pub const HID_MOD_LCTRL  = 0x01

Purpose

HID Keyboard Modifiers

const HID_MOD_LSHIFT

XuAPI
pub const HID_MOD_LSHIFT = 0x02

Purpose

Constant HID_MOD_LSHIFT, defining protocol or algorithm parameters.

const HID_MOD_LALT

XuAPI
pub const HID_MOD_LALT   = 0x04

Purpose

Constant HID_MOD_LALT, defining protocol or algorithm parameters.

const HID_MOD_LGUI

XuAPI
pub const HID_MOD_LGUI   = 0x08

Purpose

Constant HID_MOD_LGUI, defining protocol or algorithm parameters.

const HID_MOD_RCTRL

XuAPI
pub const HID_MOD_RCTRL  = 0x10

Purpose

Constant HID_MOD_RCTRL, defining protocol or algorithm parameters.

const HID_MOD_RSHIFT

XuAPI
pub const HID_MOD_RSHIFT = 0x20

Purpose

Constant HID_MOD_RSHIFT, defining protocol or algorithm parameters.

const HID_MOD_RALT

XuAPI
pub const HID_MOD_RALT   = 0x40

Purpose

Constant HID_MOD_RALT, defining protocol or algorithm parameters.

const HID_MOD_RGUI

XuAPI
pub const HID_MOD_RGUI   = 0x80

Purpose

Constant HID_MOD_RGUI, defining protocol or algorithm parameters.

const HID_KEY_A

XuAPI
pub const HID_KEY_A     = 0x04

Purpose

Standard HID Keycodes

const HID_KEY_B

XuAPI
pub const HID_KEY_B     = 0x05

Purpose

Constant HID_KEY_B, defining protocol or algorithm parameters.

const HID_KEY_C

XuAPI
pub const HID_KEY_C     = 0x06

Purpose

Constant HID_KEY_C, defining protocol or algorithm parameters.

const HID_KEY_H

XuAPI
pub const HID_KEY_H     = 0x0B

Purpose

Constant HID_KEY_H, defining protocol or algorithm parameters.

const HID_KEY_ENTER

XuAPI
pub const HID_KEY_ENTER = 0x28

Purpose

Constant HID_KEY_ENTER, defining protocol or algorithm parameters.

const HID_KEY_ESC

XuAPI
pub const HID_KEY_ESC   = 0x29

Purpose

Constant HID_KEY_ESC, defining protocol or algorithm parameters.

const HID_KEY_SPACE

XuAPI
pub const HID_KEY_SPACE = 0x2C

Purpose

Constant HID_KEY_SPACE, defining protocol or algorithm parameters.

const HID_CONSUMER_VOLUME_UP

XuAPI
pub const HID_CONSUMER_VOLUME_UP   = 0xE9

Purpose

HID Consumer Usage Codes (Volume / Media)

const HID_CONSUMER_VOLUME_DOWN

XuAPI
pub const HID_CONSUMER_VOLUME_DOWN = 0xEA

Purpose

Constant HID_CONSUMER_VOLUME_DOWN, defining protocol or algorithm parameters.

const HID_CONSUMER_MUTE

XuAPI
pub const HID_CONSUMER_MUTE        = 0xE2

Purpose

Constant HID_CONSUMER_MUTE, defining protocol or algorithm parameters.

const HID_CONSUMER_MENU

XuAPI
pub const HID_CONSUMER_MENU        = 0x40

Purpose

Constant HID_CONSUMER_MENU, defining protocol or algorithm parameters.

const DPORT_BT_LPCK_DIV_INT_REG

XuAPI
pub const DPORT_BT_LPCK_DIV_INT_REG   = 0x3FF000D4

Purpose

Bluetooth Baseband & Low-Power Clock Registers Corrected against components/soc/esp32/include/soc/dport_reg.h DR_REG_DPORT_BASE = 0x3FF00000 DPORT_BT_LPCK_DIV_INT_REG = DR_REG_DPORT_BASE + 0x0D4 = 0x3FF000D4 DPORT_BT_LPCK_DIV_FRAC_REG = DR_REG_DPORT_BASE + 0x0D8 = 0x3FF000D8 The previous values (0x3FF66044 / 0x3FF66048) point into DR_REG_APB_CTRL_BASE on ESP32 and never reached the Bluetooth low power clock divider.

const DPORT_BT_LPCK_DIV_FRAC_REG

XuAPI
pub const DPORT_BT_LPCK_DIV_FRAC_REG  = 0x3FF000D8

Purpose

Constant DPORT_BT_LPCK_DIV_FRAC_REG, defining protocol or algorithm parameters.

const BT_LPCLK_SEL_XTAL

XuAPI
pub const BT_LPCLK_SEL_XTAL     = 0

Purpose

Constant BT_LPCLK_SEL_XTAL, defining protocol or algorithm parameters.

const BT_LPCLK_SEL_XTAL32K

XuAPI
pub const BT_LPCLK_SEL_XTAL32K  = 1

Purpose

Constant BT_LPCLK_SEL_XTAL32K, defining protocol or algorithm parameters.

const BT_LPCLK_SEL_RTC_SLOW

XuAPI
pub const BT_LPCLK_SEL_RTC_SLOW = 2

Purpose

Constant BT_LPCLK_SEL_RTC_SLOW, defining protocol or algorithm parameters.

const BT_LPCLK_SEL_8M

XuAPI
pub const BT_LPCLK_SEL_8M       = 3

Purpose

Constant BT_LPCLK_SEL_8M, defining protocol or algorithm parameters.

const BT_LPCK_SEL_XTAL

XuAPI
pub const BT_LPCK_SEL_XTAL      = 0x04000000

Purpose

Constant BT_LPCK_SEL_XTAL, defining protocol or algorithm parameters.

const BT_LPCK_SEL_XTAL32K

XuAPI
pub const BT_LPCK_SEL_XTAL32K   = 0x08000000

Purpose

Constant BT_LPCK_SEL_XTAL32K, defining protocol or algorithm parameters.

const BT_LPCK_SEL_RTC_SLOW

XuAPI
pub const BT_LPCK_SEL_RTC_SLOW  = 0x01000000

Purpose

Constant BT_LPCK_SEL_RTC_SLOW, defining protocol or algorithm parameters.

const BT_LPCK_SEL_8M

XuAPI
pub const BT_LPCK_SEL_8M        = 0x02000000

Purpose

Constant BT_LPCK_SEL_8M, defining protocol or algorithm parameters.

const BT_LPCK_SEL_MASK

XuAPI
pub const BT_LPCK_SEL_MASK      = 0x0F000000

Purpose

Constant BT_LPCK_SEL_MASK, defining protocol or algorithm parameters.

const BT_LPCK_DIV_NUM_MASK

XuAPI
pub const BT_LPCK_DIV_NUM_MASK  = 0x00000FFF

Purpose

Constant BT_LPCK_DIV_NUM_MASK, defining protocol or algorithm parameters.

const DPORT_BB_CLK_EN_REG

XuAPI
pub const DPORT_BB_CLK_EN_REG           = 0x3FF000CC

Purpose

DPORT Wi-Fi & Baseband Clock & Reset Registers

const DPORT_BB_RST_EN_REG

XuAPI
pub const DPORT_BB_RST_EN_REG           = 0x3FF000D0

Purpose

Constant DPORT_BB_RST_EN_REG, defining protocol or algorithm parameters.

const DPORT_PRO_BT_MAC_INTR_MAP_REG

XuAPI
pub const DPORT_PRO_BT_MAC_INTR_MAP_REG = 0x3FF00110

Purpose

Constant DPORT_PRO_BT_MAC_INTR_MAP_REG, defining protocol or algorithm parameters.

const DPORT_PRO_BT_BB_INTR_MAP_REG

XuAPI
pub const DPORT_PRO_BT_BB_INTR_MAP_REG  = 0x3FF00114

Purpose

Constant DPORT_PRO_BT_BB_INTR_MAP_REG, defining protocol or algorithm parameters.

const DPORT_PRO_RWBT_IRQ_MAP_REG

XuAPI
pub const DPORT_PRO_RWBT_IRQ_MAP_REG   = 0x3FF0011C

Purpose

Constant DPORT_PRO_RWBT_IRQ_MAP_REG, defining protocol or algorithm parameters.

const DPORT_PRO_RWBLE_IRQ_MAP_REG

XuAPI
pub const DPORT_PRO_RWBLE_IRQ_MAP_REG  = 0x3FF00120

Purpose

Constant DPORT_PRO_RWBLE_IRQ_MAP_REG, defining protocol or algorithm parameters.

const DPORT_WIFI_CLK_WIFI_BT_COMMON_M

XuAPI
pub const DPORT_WIFI_CLK_WIFI_BT_COMMON_M = 0x000003C9

Purpose

DPORT Clock Enable bits for BT Baseband

const DPORT_WIFI_CLK_BT_EN_M

XuAPI
pub const DPORT_WIFI_CLK_BT_EN_M          = 0x00030800

Purpose

Constant DPORT_WIFI_CLK_BT_EN_M, defining protocol or algorithm parameters.

const DPORT_WIFI_CLK_BT_LC_EN_M

XuAPI
pub const DPORT_WIFI_CLK_BT_LC_EN_M       = 0x00030000

Purpose

Constant DPORT_WIFI_CLK_BT_LC_EN_M, defining protocol or algorithm parameters.

const DPORT_BT_RST_M

XuAPI
pub const DPORT_BT_RST_M                  = 0x00000008

Purpose

Constant DPORT_BT_RST_M, defining protocol or algorithm parameters.

bt_power_domain_on

XuAPI
pub fn bt_power_domain_on() bool

Purpose

Enable 2.4GHz RF Baseband Clocks & Release Reset

Parameters

No arguments are required.

Returns

bool — true or false

bt_rf_clock_enable

XuAPI
pub fn bt_rf_clock_enable()

Purpose

Bt rf clock enable.

Parameters

No arguments are required.

Returns

This call does not return a value.

bt_interrupt_route

XuAPI
pub fn bt_interrupt_route()

Purpose

Route the two link-layer level sources to one level-1 CPU interrupt. These are RWBT/RWBLE (sources 6/7), not BT_MAC/BT_BB (sources 3/4). BT_BB has a separate PHY/tracking handler and must not share this route.

Parameters

No arguments are required.

Returns

This call does not return a value.

bt_rf_bringup_sequence

XuAPI
pub fn bt_rf_bringup_sequence() bool

Purpose

Clock/reset prerequisites. PHY calibration and controller startup remain pending.

Parameters

No arguments are required.

Returns

bool — true or false

const PIN_INPUT

XuAPI
pub const PIN_INPUT          = 0

Purpose

Constant PIN_INPUT, defining protocol or algorithm parameters.

const PIN_OUTPUT

XuAPI
pub const PIN_OUTPUT         = 1

Purpose

Constant PIN_OUTPUT, defining protocol or algorithm parameters.

const PIN_INPUT_PULLUP

XuAPI
pub const PIN_INPUT_PULLUP   = 2

Purpose

Constant PIN_INPUT_PULLUP, defining protocol or algorithm parameters.

const PIN_INPUT_PULLDOWN

XuAPI
pub const PIN_INPUT_PULLDOWN = 3

Purpose

Constant PIN_INPUT_PULLDOWN, defining protocol or algorithm parameters.

const PIN_LOW

XuAPI
pub const PIN_LOW  = 0

Purpose

Constant PIN_LOW, defining protocol or algorithm parameters.

const PIN_HIGH

XuAPI
pub const PIN_HIGH = 1

Purpose

Constant PIN_HIGH, defining protocol or algorithm parameters.

gpio_pin_mask

XuAPI
pub fn gpio_pin_mask(pin int) int

Purpose

Gpio pin mask.

Parameters

pin int
pin (int)

Returns

int — a value of this type

gpio_config_mux

XuAPI
pub fn gpio_config_mux(pin int, mux_val int)

Purpose

Gpio config mux.

Parameters

pin int
pin (int)
mux_val int
mux_val (int)

Returns

This call does not return a value.

gpio_route_out

XuAPI
pub fn gpio_route_out(pin int)

Purpose

Routes the GPIO matrix output to the physical pad (SIG_GPIO_OUT_IDX = 0x100) Crucial for pins that default to JTAG or strapping functions at boot (e.g., 14, 13, 15, 2).

Parameters

pin int
pin (int)

Returns

This call does not return a value.

gpio_init

XuAPI
pub fn gpio_init(pin int, mode int)

Purpose

Gpio init.

Parameters

pin int
pin (int)
mode int
mode (int)

Returns

This call does not return a value.

gpio_set_high

XuAPI
pub fn gpio_set_high(pin int)

Purpose

Gpio set high.

Parameters

pin int
pin (int)

Returns

This call does not return a value.

gpio_set_low

XuAPI
pub fn gpio_set_low(pin int)

Purpose

Gpio set low.

Parameters

pin int
pin (int)

Returns

This call does not return a value.

gpio_set_high_mask

XuAPI
pub fn gpio_set_high_mask(mask int)

Purpose

Gpio set high mask.

Parameters

mask int
mask (int)

Returns

This call does not return a value.

gpio_set_low_mask

XuAPI
pub fn gpio_set_low_mask(mask int)

Purpose

Gpio set low mask.

Parameters

mask int
mask (int)

Returns

This call does not return a value.

gpio_set

XuAPI
pub fn gpio_set(pin int, val int)

Purpose

Gpio set.

Parameters

pin int
pin (int)
val int
value (int)

Returns

This call does not return a value.

gpio_get

XuAPI
pub fn gpio_get(pin int) int

Purpose

Gpio get.

Parameters

pin int
pin (int)

Returns

int — a value of this type

gpio_toggle

XuAPI
pub fn gpio_toggle(pin int)

Purpose

Gpio toggle.

Parameters

pin int
pin (int)

Returns

This call does not return a value.

bt_irq_rom_recover_assertion

XuAPI
pub fn bt_irq_rom_recover_assertion(file int, line int, detail int) bool

Purpose

This is an exact, evidence-bound recovery, not a general assert handler. The application's assertion callback must retain its fatal behavior when this returns false, including unknown/new ERRORSTAT values during repair.

Parameters

file int
file (int)
line int
line (int)
detail int
detail (int)

Returns

bool — true or false

bt_irq_rom_recovery_error

XuAPI
pub fn bt_irq_rom_recovery_error() int

Purpose

Bt irq rom recovery error.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_recovery_count

XuAPI
pub fn bt_irq_rom_recovery_count() int

Purpose

Bt irq rom recovery count.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_bb_service

XuAPI
pub fn bt_irq_rom_bb_service() int

Purpose

Bt irq rom bb service.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_bb_attach

XuAPI
pub fn bt_irq_rom_bb_attach() bool

Purpose

Bt irq rom bb attach.

Parameters

No arguments are required.

Returns

bool — true or false

bt_irq_rom_bb_enable

XuAPI
pub fn bt_irq_rom_bb_enable() bool

Purpose

Bt irq rom bb enable.

Parameters

No arguments are required.

Returns

bool — true or false

bt_irq_rom_bb_error

XuAPI
pub fn bt_irq_rom_bb_error() int

Purpose

Bt irq rom bb error.

Parameters

No arguments are required.

Returns

int — a value of this type

irq_rom_mask

XuAPI
pub fn irq_rom_mask(mask int) int

Purpose

Irq rom mask.

Parameters

mask int
mask (int)

Returns

int — a value of this type

irq_rom_unmask

XuAPI
pub fn irq_rom_unmask(mask int) int

Purpose

Irq rom unmask.

Parameters

mask int
mask (int)

Returns

int — a value of this type

irq_rom_set_level

XuAPI
pub fn irq_rom_set_level(level int) int

Purpose

Irq rom set level.

Parameters

level int
level (int)

Returns

int — a value of this type

irq_rom_attach_bt

XuAPI
pub fn irq_rom_attach_bt(callback_address int, context int) bool

Purpose

CPU 4 is a level-1 external level interrupt, used by RWBT/RWBLE sources. ROM indexes its handler table in reverse CPU-interrupt order.

Parameters

callback_address int
callback_address (int)
context int
context (int)

Returns

bool — true or false

irq_rom_attach_timer0

XuAPI
pub fn irq_rom_attach_timer0(callback_address int, context int) bool

Purpose

CPU 6 is CCOMPARE0, a level-1 timer interrupt. The hardware source is acknowledged by writing a new CCOMPARE0 value, not by raise_irq.

Parameters

callback_address int
callback_address (int)
context int
context (int)

Returns

bool — true or false

irq_rom_timer0_arm

XuAPI
pub fn irq_rom_timer0_arm(cycle_count int)

Purpose

Irq rom timer0 arm.

Parameters

cycle_count int
cycle_count (int)

Returns

This call does not return a value.

irq_rom_cycle_count

XuAPI
pub fn irq_rom_cycle_count() int

Purpose

Irq rom cycle count.

Parameters

No arguments are required.

Returns

int — a value of this type

irq_rom_pending

XuAPI
pub fn irq_rom_pending() int

Purpose

Irq rom pending.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_service

XuAPI
pub fn bt_irq_rom_service() int

Purpose

RAM intc.o's r_rwbtdm_isr calls the ROM BLE and BR/EDR handlers in this order. Both inspect/acknowledge their own peripheral status, so sharing one CPU level input is valid (the IDF wrapper does this on CPU IRQ 5). The controller task consumes the work flag outside the interrupt frame. State: count 3FFD73D0, pending work 3FFD73D4, last CPU pending 3FFD73D8. Never enable this before complete LL/RF/platform table initialization.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_attach

XuAPI
pub fn bt_irq_rom_attach() bool

Purpose

Attaching and enabling are separate: bringing up the controller can bind its tables while all link-layer interrupt sources remain masked.

Parameters

No arguments are required.

Returns

bool — true or false

bt_irq_rom_enable

XuAPI
pub fn bt_irq_rom_enable() bool

Purpose

Bt irq rom enable.

Parameters

No arguments are required.

Returns

bool — true or false

bt_irq_rom_disable

XuAPI
pub fn bt_irq_rom_disable()

Purpose

Bt irq rom disable.

Parameters

No arguments are required.

Returns

This call does not return a value.

bt_irq_rom_count

XuAPI
pub fn bt_irq_rom_count() int

Purpose

Bt irq rom count.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_take_work

XuAPI
pub fn bt_irq_rom_take_work() bool

Purpose

Bt irq rom take work.

Parameters

No arguments are required.

Returns

bool — true or false

bt_irq_rom_last_cycles

XuAPI
pub fn bt_irq_rom_last_cycles() int

Purpose

Bt irq rom last cycles.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_max_cycles

XuAPI
pub fn bt_irq_rom_max_cycles() int

Purpose

Bt irq rom max cycles.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_bb_last_cycles

XuAPI
pub fn bt_irq_rom_bb_last_cycles() int

Purpose

Bt irq rom bb last cycles.

Parameters

No arguments are required.

Returns

int — a value of this type

bt_irq_rom_bb_max_cycles

XuAPI
pub fn bt_irq_rom_bb_max_cycles() int

Purpose

Bt irq rom bb max cycles.

Parameters

No arguments are required.

Returns

int — a value of this type

llc_auth_rom_install

XuAPI
pub fn llc_auth_rom_install(enabled bool) bool

Purpose

Llc auth rom install.

Parameters

enabled bool
enabled (bool)

Returns

bool — true or false

llc_auth_rom_error

XuAPI
pub fn llc_auth_rom_error() int

Purpose

Llc auth rom error.

Parameters

No arguments are required.

Returns

int — a value of this type

llc_auth_rom_margin_count

XuAPI
pub fn llc_auth_rom_margin_count() int

Purpose

Llc auth rom margin count.

Parameters

No arguments are required.

Returns

int — a value of this type

llc_auth_rom_timeout_count

XuAPI
pub fn llc_auth_rom_timeout_count() int

Purpose

Llc auth rom timeout count.

Parameters

No arguments are required.

Returns

int — a value of this type

llc_auth_rom_last_state

XuAPI
pub fn llc_auth_rom_last_state() int

Purpose

Llc auth rom last state.

Parameters

No arguments are required.

Returns

int — a value of this type

llc_auth_rom_last_margin

XuAPI
pub fn llc_auth_rom_last_margin() int

Purpose

Llc auth rom last margin.

Parameters

No arguments are required.

Returns

int — a value of this type

llc_auth_rom_last_timeout

XuAPI
pub fn llc_auth_rom_last_timeout() int

Purpose

Llc auth rom last timeout.

Parameters

No arguments are required.

Returns

int — a value of this type

llc_auth_rom_last_procedure

XuAPI
pub fn llc_auth_rom_last_procedure() int

Purpose

Llc auth rom last procedure.

Parameters

No arguments are required.

Returns

int — a value of this type

phy_prepare_analog_bus

XuAPI
pub fn phy_prepare_analog_bus() bool

Purpose

Analog-bus prerequisites recovered from ESP32 libphy reg_init_begin(0) and i2cmst_reg_init. This does not run RF/PLL/IQ/TX-power calibration. The ROM PHY function table must be populated before using its I2C slots.

Parameters

No arguments are required.

Returns

bool — true or false

phy_select_analog_block

XuAPI
pub fn phy_select_analog_block(block int) bool

Purpose

Cold-start probe only: select one analog slave before using the ROM's raw I2C primitives. libphy's ram_chip_i2c_readReg adds this selection the ROM implementation itself does not. No controller/ISR may use the analog bus concurrently with this operation.

Parameters

block int
block (int)

Returns

bool — true or false

phy_cal_bb_registers_init

XuAPI
pub fn phy_cal_bb_registers_init() bool

Purpose

Phy cal bb registers init.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_hw_frequency_disable

XuAPI
pub fn phy_cal_hw_frequency_disable() bool

Purpose

Cold-start BT baseband register port, not PHY calibration. Recovered from librtc.a:bt_bb.o, bt_bb_init_cmplx and BT_init_rx_filters. The 0x600xxxxx APB addresses use their equivalent 0x3FFxxxxx aliases here.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_hw_frequency_enable

XuAPI
pub fn phy_cal_hw_frequency_enable()

Purpose

Phy cal hw frequency enable.

Parameters

No arguments are required.

Returns

This call does not return a value.

phy_cal_bt_baseband_init

XuAPI
pub fn phy_cal_bt_baseband_init() bool

Purpose

Requires the PHY analog bus and Xu I2C callbacks to be installed. This supplies the register work of import_rf_phy slot +4, but does not claim RF/PLL/IQ/TX calibration or permission to start a radio event.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_channel_programmer

XuAPI
pub fn phy_cal_channel_programmer() bool

Purpose

Specialized eleven-command cold-start channel programmer from bt_get_i2c_data + bt_i2c_write_set, with the same RX/TX address maps. The shared RF frequency memory must already contain the 85 calibrated three-word tuples. This does not perform DC/IQ/TX-power calibration.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_rc_40mhz

XuAPI
pub fn phy_cal_rc_40mhz() bool

Purpose

Real RC oscillator calibration: enable the reference, pulse the RC calibration start bit, wait 100 us, capture the six-bit result, and disable both reference and test mode. Captured values are retained for the later BB/IQ/power calibration stages, not substituted by constants.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_bt_priority

XuAPI
pub fn phy_cal_bt_priority() bool

Purpose

ESP32 esp_phy_enable's post-calibration coex_bt_high_prio contract. Call while controller events/IRQs are stopped. This enables hardware arbitration and gives BT priority; it is not the force_bt_mode override. Keep each native RMW separate because intermediate values reach hardware.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_tx_release

XuAPI
pub fn phy_cal_tx_release() bool

Purpose

Native force_txrxoff(0) followed by the register_chipv7_phy tail. Caller must finish static BB initialization first. This releases the calibrated TX/PLL path to the MAC; it does not certify RX DC/IQ or start advertising, and does not commit the separate IRQ tracking ready marker.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_bt_gain_memory

XuAPI
pub fn phy_cal_bt_gain_memory() bool

Purpose

Phy cal bt gain memory.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_install_i2c

XuAPI
pub fn phy_cal_install_i2c() bool

Purpose

Install after bt_power_domain_on, bt_rf_clock_enable and phy_prepare_analog_bus. All ROM PHY functions then use the Xu slave selection and bounded polling through their existing raw I2C slots.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_i2c_error

XuAPI
pub fn phy_cal_i2c_error() int

Purpose

Phy cal i2c error.

Parameters

No arguments are required.

Returns

int — a value of this type

phy_cal_restore_i2c

XuAPI
pub fn phy_cal_restore_i2c()

Purpose

Phy cal restore i2c.

Parameters

No arguments are required.

Returns

This call does not return a value.

phy_cal_pbus_memory_init

XuAPI
pub fn phy_cal_pbus_memory_init() bool

Purpose

ram_set_pbus_mem's complete Wi-Fi/BT RX/TX/PA transition microsequences. These are PHY register commands generated by Xu, not executable machine code imported from an archive. Call while controller events/IRQs are off.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_analog_defaults

XuAPI
pub fn phy_cal_analog_defaults() bool

Purpose

Phy cal analog defaults.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_rf_bus_init

XuAPI
pub fn phy_cal_rf_bus_init() bool

Purpose

Phy cal rf bus init.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_pll_40mhz

XuAPI
pub fn phy_cal_pll_40mhz() bool

Purpose

ESP32 / 40 MHz XTAL only. Calibrate all 85 frequencies 2400..2484 MHz used by the ROM PHY's Wi-Fi/BT shared lookup memory. Hardware PLL done is checked at every frequency, with a maximum 2 ms wait per sample. Calling this does not mark the complete PHY or channel programmer ready.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_install_sar

XuAPI
pub fn phy_cal_install_sar() bool

Purpose

Phy cal install sar.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_txcap_bt

XuAPI
pub fn phy_cal_txcap_bt() bool

Purpose

Calibrate PA tank capacitance at channels 1/7/11. The three-byte native records and fourth fallback record are kept at 0x3FFD7540..754B.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_txpower_bt

XuAPI
pub fn phy_cal_txpower_bt() bool

Purpose

Phy cal txpower bt.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_cold_reset

XuAPI
pub fn phy_cal_cold_reset() bool

Purpose

Cold-start prefix from the working C image's register_chipv7_phy reset_rf_dig -> phy_dis_hw_set_freq -> i2c_master_reset. Call only after RF power/clocks are on, with controller IRQs/events stopped, before any calibration. This is not the runtime BT-only recovery reset.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_rx_error

XuAPI
pub fn phy_cal_rx_error() int

Purpose

Phy cal rx error.

Parameters

No arguments are required.

Returns

int — a value of this type

phy_cal_rx_stages

XuAPI
pub fn phy_cal_rx_stages() int

Purpose

Phy cal rx stages.

Parameters

No arguments are required.

Returns

int — a value of this type

phy_cal_rx_bt_calibrated

XuAPI
pub fn phy_cal_rx_bt_calibrated() bool

Purpose

Phy cal rx bt calibrated.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_rx_bt_dc

XuAPI
pub fn phy_cal_rx_bt_dc(index int) int

Purpose

Phy cal rx bt dc.

Parameters

index int
index (int)

Returns

int — a value of this type

phy_cal_rx_bt_result

XuAPI
pub fn phy_cal_rx_bt_result(index int, component int) int

Purpose

component 0/1 is signed I/Q differential residual; 2 is iterations.

Parameters

index int
index (int)
component int
component (int)

Returns

int — a value of this type

phy_cal_rx_bt

XuAPI
pub fn phy_cal_rx_bt() bool

Purpose

Phy cal rx bt.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_rx_bt_rf_gain

XuAPI
pub fn phy_cal_rx_bt_rf_gain(index int) int

Purpose

Pure arithmetic specialization of ram_gen_rx_gain_table for the native BT sweep (8 RF gains, LPF maximum 28, final baseband gain 6). Index 72 is deliberately included: the native generator emits before testing >28.

Parameters

index int
index (int)

Returns

int — a value of this type

phy_cal_rx_bt_gain_at

XuAPI
pub fn phy_cal_rx_bt_gain_at(index int) int

Purpose

Phy cal rx bt gain at.

Parameters

index int
index (int)

Returns

int — a value of this type

phy_cal_power_detector_init

XuAPI
pub fn phy_cal_power_detector_init() bool

Purpose

ram_en_pwdet + pwdet_sar2_init. The ROM's older power-detector setup does not initialize the revised SAR2 path used by the 12-bit RAM reader.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_shared_tx_calibrate

XuAPI
pub fn phy_cal_shared_tx_calibrate() bool

Purpose

BLE on this ESP32 profile consumes the common TX bank (base110), even though the separate BT bank at base+8 is also initialized. A same-boot address-step probe established that distinction. Native set_tx_gain_table writes one common gain row eight times; it does not copy the BT rows. Scratch: 7498/749C are the measured common DC pair after PA-cap calibration 74BC is common IQ, 74DC its commit, 75B8..75C4 retain upload metadata.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_shared_gain_memory

XuAPI
pub fn phy_cal_shared_gain_memory() bool

Purpose

Phy cal shared gain memory.

Parameters

No arguments are required.

Returns

bool — true or false

const PHY_TRACKING_READY

XuAPI
pub const PHY_TRACKING_READY = 0x5452414B

Purpose

BT-only runtime PLL-cap tracking, ported from libphy's bt_track_pll_cap, pll_correct_dcap, phy_dis_hw_set_freq and phy_en_hw_set_freq. The calibration driver owns the commit at 3FFD7780: write TRACKING_READY only after complete TX RF/channel-table initialization and readback pass. This runtime PLL marker does not authorize receiving or BLE connections. PLL1 alone only validates the PLL sweep, not the remaining PHY work.

phy_tracking_is_ready

XuAPI
pub fn phy_tracking_is_ready() bool

Purpose

Whether phy_tracking is ready.

Parameters

No arguments are required.

Returns

bool — true or false

phy_tracking_error

XuAPI
pub fn phy_tracking_error() int

Purpose

Phy tracking error.

Parameters

No arguments are required.

Returns

int — a value of this type

phy_tracking_count

XuAPI
pub fn phy_tracking_count() int

Purpose

Phy tracking count.

Parameters

No arguments are required.

Returns

int — a value of this type

phy_bt_track_pll_cap

XuAPI
pub fn phy_bt_track_pll_cap() bool

Purpose

Phy bt track pll cap.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_install_pbus

XuAPI
pub fn phy_cal_install_pbus() bool

Purpose

Phy cal install pbus.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_txdc_bt

XuAPI
pub fn phy_cal_txdc_bt() bool

Purpose

Phy cal txdc bt.

Parameters

No arguments are required.

Returns

bool — true or false

phy_cal_tone_power

XuAPI
pub fn phy_cal_tone_power() int

Purpose

ROM txtone_linear_pwr(false), using the RAM revision's twelve-bit SAR reader and bounded acquisition instead of the older ROM SAR primitive.

Parameters

No arguments are required.

Returns

int — a value of this type

phy_cal_txiq_bt

XuAPI
pub fn phy_cal_txiq_bt() bool

Purpose

Phy cal txiq bt.

Parameters

No arguments are required.

Returns

bool — true or false

const VENDOR_PHY_GET_ROMFUNC_ADDR

XuAPI
pub const VENDOR_PHY_GET_ROMFUNC_ADDR = 0x40153E4C

Purpose

Blob symbol addresses. Regenerated by build_vendor_phy_blob.sh; keep in sync with examples/esp32/tools/vendor_phy_blob_map.txt. Blob segments: DRAM 0x3FFD9000, IRAM 0x4008C000, IROM 0x40150000.

const VENDOR_BT_BB_INIT_CMPLX

XuAPI
pub const VENDOR_BT_BB_INIT_CMPLX = 0x4008E294

Purpose

Constant VENDOR_BT_BB_INIT_CMPLX, defining protocol or algorithm parameters.

const PHY_ROM_TABLE

XuAPI
pub const PHY_ROM_TABLE = 0x3FFAE0C4

Purpose

ROM DRAM base of the PHY function table.

const PHY_ROM_DEFAULT_SLOT0

XuAPI
pub const PHY_ROM_DEFAULT_SLOT0 = 0x40002F6C

Purpose

ROM default of slot 0 (rom_phy_disable_agc). Used as the "not overridden" witness: the vendor installer replaces it with ram_disable_agc.

const PHY_ROM_IMPORT

XuAPI
pub const PHY_ROM_IMPORT = 0x3FFB8354

Purpose

ROM import table (r_import_rf_phy_func). Slot 1 is the baseband init hook.

phy_rom_table_base

XuAPI
pub fn phy_rom_table_base() int

Purpose

Phy rom table base name.

Parameters

No arguments are required.

Returns

int — a value of this type

phy_rom_vendor_install

XuAPI
pub fn phy_rom_vendor_install() bool

Purpose

Call the vendor installer and check that the ROM table now holds the vendor PHY entries instead of the ROM defaults. Call this after the PHY calibration chain and before the controller is started: the calibration wants the Xu analog I2C replacements, the radio wants the vendor PHY entries.

Parameters

No arguments are required.

Returns

bool — true or false

phy_rom_vendor_bb_install

XuAPI
pub fn phy_rom_vendor_bb_install() bool

Purpose

Install the vendor baseband init into the ROM import table, so the ROM RF init calls the official bt_bb_init_cmplx sequence.

Parameters

No arguments are required.

Returns

bool — true or false

phy_rom_slot

XuAPI
pub fn phy_rom_slot(index int) int

Purpose

Read one PHY table slot at runtime.

Parameters

index int
index (int)

Returns

int — a value of this type

radio_rf_error

XuAPI
pub fn radio_rf_error() int

Purpose

Radio rf error.

Parameters

No arguments are required.

Returns

int — a value of this type

radio_rf_stages

XuAPI
pub fn radio_rf_stages() int

Purpose

Radio rf stages.

Parameters

No arguments are required.

Returns

int — a value of this type

radio_controller_memory_init

XuAPI
pub fn radio_controller_memory_init() bool

Purpose

Cold boot only, with controller IRQs masked and before PHY/RF/LL init. ROM DATA_INIT does not clear exchange memory. IDF's caller supplies this separate initialization; this Xu profile reserves the whole 32 KiB EM.

Parameters

No arguments are required.

Returns

bool — true or false

radio_clock_xtal_40mhz

XuAPI
pub fn radio_clock_xtal_40mhz() bool

Purpose

Radio clock xtal 40mhz.

Parameters

No arguments are required.

Returns

bool — true or false

radio_rf_readback

XuAPI
pub fn radio_rf_readback() bool

Purpose

Also call after LL initialization, before enabling radio IRQs/events, to detect any later initializer overwriting the reserved frequency map.

Parameters

No arguments are required.

Returns

bool — true or false

radio_rf_cold_init

XuAPI
pub fn radio_rf_cold_init() bool

Purpose

Radio rf cold init.

Parameters

No arguments are required.

Returns

bool — true or false

radio_event_arbiter_init

XuAPI
pub fn radio_event_arbiter_init() bool

Purpose

Radio event arbiter init.

Parameters

No arguments are required.

Returns

bool — true or false

const GPIO_OUT_REG

XuAPI
pub const GPIO_OUT_REG          = 0x3FF44004

Purpose

GPIO registers (Base: 0x3FF44000)

const GPIO_OUT_W1TS_REG

XuAPI
pub const GPIO_OUT_W1TS_REG     = 0x3FF44008

Purpose

Constant GPIO_OUT_W1TS_REG, defining protocol or algorithm parameters.

const GPIO_OUT_W1TC_REG

XuAPI
pub const GPIO_OUT_W1TC_REG     = 0x3FF4400C

Purpose

Constant GPIO_OUT_W1TC_REG, defining protocol or algorithm parameters.

const GPIO_OUT1_REG

XuAPI
pub const GPIO_OUT1_REG         = 0x3FF44010

Purpose

Constant GPIO_OUT1_REG, defining protocol or algorithm parameters.

const GPIO_OUT1_W1TS_REG

XuAPI
pub const GPIO_OUT1_W1TS_REG    = 0x3FF44014

Purpose

Constant GPIO_OUT1_W1TS_REG, defining protocol or algorithm parameters.

const GPIO_OUT1_W1TC_REG

XuAPI
pub const GPIO_OUT1_W1TC_REG    = 0x3FF44018

Purpose

Constant GPIO_OUT1_W1TC_REG, defining protocol or algorithm parameters.

const GPIO_ENABLE_REG

XuAPI
pub const GPIO_ENABLE_REG       = 0x3FF44020

Purpose

Constant GPIO_ENABLE_REG, defining protocol or algorithm parameters.

const GPIO_ENABLE_W1TS_REG

XuAPI
pub const GPIO_ENABLE_W1TS_REG  = 0x3FF44024

Purpose

Constant GPIO_ENABLE_W1TS_REG, defining protocol or algorithm parameters.

const GPIO_ENABLE_W1TC_REG

XuAPI
pub const GPIO_ENABLE_W1TC_REG  = 0x3FF44028

Purpose

Constant GPIO_ENABLE_W1TC_REG, defining protocol or algorithm parameters.

const GPIO_ENABLE1_REG

XuAPI
pub const GPIO_ENABLE1_REG      = 0x3FF4402C

Purpose

Constant GPIO_ENABLE1_REG, defining protocol or algorithm parameters.

const GPIO_ENABLE1_W1TS_REG

XuAPI
pub const GPIO_ENABLE1_W1TS_REG = 0x3FF44030

Purpose

Constant GPIO_ENABLE1_W1TS_REG, defining protocol or algorithm parameters.

const GPIO_ENABLE1_W1TC_REG

XuAPI
pub const GPIO_ENABLE1_W1TC_REG = 0x3FF44034

Purpose

Constant GPIO_ENABLE1_W1TC_REG, defining protocol or algorithm parameters.

const GPIO_IN_REG

XuAPI
pub const GPIO_IN_REG           = 0x3FF4403C

Purpose

Constant GPIO_IN_REG, defining protocol or algorithm parameters.

const GPIO_IN1_REG

XuAPI
pub const GPIO_IN1_REG          = 0x3FF44040

Purpose

Constant GPIO_IN1_REG, defining protocol or algorithm parameters.

const IO_MUX_PIN_CTRL

XuAPI
pub const IO_MUX_PIN_CTRL     = 0x3FF49000

Purpose

IO MUX registers (Base: 0x3FF49000)

const IO_MUX_GPIO0_REG

XuAPI
pub const IO_MUX_GPIO0_REG    = 0x3FF49044

Purpose

Constant IO_MUX_GPIO0_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO2_REG

XuAPI
pub const IO_MUX_GPIO2_REG    = 0x3FF49040

Purpose

Constant IO_MUX_GPIO2_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO4_REG

XuAPI
pub const IO_MUX_GPIO4_REG    = 0x3FF49048

Purpose

Constant IO_MUX_GPIO4_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO5_REG

XuAPI
pub const IO_MUX_GPIO5_REG    = 0x3FF4906C

Purpose

Constant IO_MUX_GPIO5_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO12_REG

XuAPI
pub const IO_MUX_GPIO12_REG   = 0x3FF49034

Purpose

Constant IO_MUX_GPIO12_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO13_REG

XuAPI
pub const IO_MUX_GPIO13_REG   = 0x3FF49038

Purpose

Constant IO_MUX_GPIO13_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO14_REG

XuAPI
pub const IO_MUX_GPIO14_REG   = 0x3FF49030

Purpose

Constant IO_MUX_GPIO14_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO15_REG

XuAPI
pub const IO_MUX_GPIO15_REG   = 0x3FF4903C

Purpose

Constant IO_MUX_GPIO15_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO16_REG

XuAPI
pub const IO_MUX_GPIO16_REG   = 0x3FF4904C

Purpose

Constant IO_MUX_GPIO16_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO17_REG

XuAPI
pub const IO_MUX_GPIO17_REG   = 0x3FF49050

Purpose

Constant IO_MUX_GPIO17_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO18_REG

XuAPI
pub const IO_MUX_GPIO18_REG   = 0x3FF49070

Purpose

Constant IO_MUX_GPIO18_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO19_REG

XuAPI
pub const IO_MUX_GPIO19_REG   = 0x3FF49074

Purpose

Constant IO_MUX_GPIO19_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO21_REG

XuAPI
pub const IO_MUX_GPIO21_REG   = 0x3FF4907C

Purpose

Constant IO_MUX_GPIO21_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO22_REG

XuAPI
pub const IO_MUX_GPIO22_REG   = 0x3FF49080

Purpose

Constant IO_MUX_GPIO22_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO23_REG

XuAPI
pub const IO_MUX_GPIO23_REG   = 0x3FF49084

Purpose

Constant IO_MUX_GPIO23_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO25_REG

XuAPI
pub const IO_MUX_GPIO25_REG   = 0x3FF49024

Purpose

Constant IO_MUX_GPIO25_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO26_REG

XuAPI
pub const IO_MUX_GPIO26_REG   = 0x3FF49028

Purpose

Constant IO_MUX_GPIO26_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO27_REG

XuAPI
pub const IO_MUX_GPIO27_REG   = 0x3FF4902C

Purpose

Constant IO_MUX_GPIO27_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO32_REG

XuAPI
pub const IO_MUX_GPIO32_REG   = 0x3FF4901C

Purpose

Constant IO_MUX_GPIO32_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO33_REG

XuAPI
pub const IO_MUX_GPIO33_REG   = 0x3FF49020

Purpose

Constant IO_MUX_GPIO33_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO34_REG

XuAPI
pub const IO_MUX_GPIO34_REG   = 0x3FF49014

Purpose

Constant IO_MUX_GPIO34_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO35_REG

XuAPI
pub const IO_MUX_GPIO35_REG   = 0x3FF49018

Purpose

Constant IO_MUX_GPIO35_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO36_REG

XuAPI
pub const IO_MUX_GPIO36_REG   = 0x3FF49004

Purpose

Constant IO_MUX_GPIO36_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO37_REG

XuAPI
pub const IO_MUX_GPIO37_REG   = 0x3FF49008

Purpose

Constant IO_MUX_GPIO37_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO38_REG

XuAPI
pub const IO_MUX_GPIO38_REG   = 0x3FF4900C

Purpose

Constant IO_MUX_GPIO38_REG, defining protocol or algorithm parameters.

const IO_MUX_GPIO39_REG

XuAPI
pub const IO_MUX_GPIO39_REG   = 0x3FF49010

Purpose

Constant IO_MUX_GPIO39_REG, defining protocol or algorithm parameters.

const UART0_FIFO_REG

XuAPI
pub const UART0_FIFO_REG      = 0x3FF40000

Purpose

UART0 registers (Base: 0x3FF40000)

const UART0_INT_RAW_REG

XuAPI
pub const UART0_INT_RAW_REG   = 0x3FF40004

Purpose

Constant UART0_INT_RAW_REG, defining protocol or algorithm parameters.

const UART0_STATUS_REG

XuAPI
pub const UART0_STATUS_REG    = 0x3FF4001C

Purpose

Constant UART0_STATUS_REG, defining protocol or algorithm parameters.

const TIMG0_T0CONFIG_REG

XuAPI
pub const TIMG0_T0CONFIG_REG   = 0x3FF5F000

Purpose

Timer Group 0 & Watchdog registers

const TIMG0_T0LO_REG

XuAPI
pub const TIMG0_T0LO_REG       = 0x3FF5F004

Purpose

Constant TIMG0_T0LO_REG, defining protocol or algorithm parameters.

const TIMG0_T0HI_REG

XuAPI
pub const TIMG0_T0HI_REG       = 0x3FF5F008

Purpose

Constant TIMG0_T0HI_REG, defining protocol or algorithm parameters.

const TIMG0_T0UPDATE_REG

XuAPI
pub const TIMG0_T0UPDATE_REG   = 0x3FF5F00C

Purpose

Constant TIMG0_T0UPDATE_REG, defining protocol or algorithm parameters.

const TIMG0_WDTCONFIG0_REG

XuAPI
pub const TIMG0_WDTCONFIG0_REG = 0x3FF5F048

Purpose

Constant TIMG0_WDTCONFIG0_REG, defining protocol or algorithm parameters.

const TIMG0_WDTFEED_REG

XuAPI
pub const TIMG0_WDTFEED_REG    = 0x3FF5F060

Purpose

Constant TIMG0_WDTFEED_REG, defining protocol or algorithm parameters.

const TIMG0_WDTWPROTECT_REG

XuAPI
pub const TIMG0_WDTWPROTECT_REG= 0x3FF5F064

Purpose

Constant TIMG0_WDTWPROTECT_REG, defining protocol or algorithm parameters.

const TIMG1_WDTCONFIG0_REG

XuAPI
pub const TIMG1_WDTCONFIG0_REG = 0x3FF60048

Purpose

Timer Group 1 Watchdog registers

const TIMG1_WDTFEED_REG

XuAPI
pub const TIMG1_WDTFEED_REG    = 0x3FF60060

Purpose

Constant TIMG1_WDTFEED_REG, defining protocol or algorithm parameters.

const TIMG1_WDTWPROTECT_REG

XuAPI
pub const TIMG1_WDTWPROTECT_REG= 0x3FF60064

Purpose

Constant TIMG1_WDTWPROTECT_REG, defining protocol or algorithm parameters.

const RTC_CNTL_WDTCONFIG0_REG

XuAPI
pub const RTC_CNTL_WDTCONFIG0_REG = 0x3FF4808C

Purpose

RTC Controller Watchdog registers

const RTC_CNTL_WDTFEED_REG

XuAPI
pub const RTC_CNTL_WDTFEED_REG    = 0x3FF480A0

Purpose

Constant RTC_CNTL_WDTFEED_REG, defining protocol or algorithm parameters.

const RTC_CNTL_WDTWPROTECT_REG

XuAPI
pub const RTC_CNTL_WDTWPROTECT_REG= 0x3FF480A4

Purpose

Constant RTC_CNTL_WDTWPROTECT_REG, defining protocol or algorithm parameters.

const WDT_WKEY

XuAPI
pub const WDT_WKEY                = 0x50D83AA1

Purpose

Constant WDT_WKEY, defining protocol or algorithm parameters.

const ROM_ETS_GET_CPU_FREQUENCY

XuAPI
pub const ROM_ETS_GET_CPU_FREQUENCY = 0x4000855C

Purpose

ESP32 mask-ROM addresses from IDF components/esp_rom/esp32/ld/esp32.rom.ld. Calls use the windowed ROM ABI, not Xu's call0/function-value ABI.

const ROM_ETS_DELAY_US

XuAPI
pub const ROM_ETS_DELAY_US = 0x40008534

Purpose

Constant ROM_ETS_DELAY_US, defining protocol or algorithm parameters.

const ROM_MEMSET

XuAPI
pub const ROM_MEMSET = 0x4000C44C

Purpose

Constant ROM_MEMSET, defining protocol or algorithm parameters.

const ROM_MEMCPY

XuAPI
pub const ROM_MEMCPY = 0x4000C2C8

Purpose

Constant ROM_MEMCPY, defining protocol or algorithm parameters.

const ROM_BTDM_VERSION_GET

XuAPI
pub const ROM_BTDM_VERSION_GET = 0x40010078

Purpose

Constant ROM_BTDM_VERSION_GET, defining protocol or algorithm parameters.

const ROM_BTDM_DATA_INIT

XuAPI
pub const ROM_BTDM_DATA_INIT = 0x4001002C

Purpose

Constant ROM_BTDM_DATA_INIT, defining protocol or algorithm parameters.

const ROM_PHY_GET_ROMFUNCS

XuAPI
pub const ROM_PHY_GET_ROMFUNCS = 0x40004100

Purpose

Constant ROM_PHY_GET_ROMFUNCS, defining protocol or algorithm parameters.

const ROM_BTDM_BSS_START

XuAPI
pub const ROM_BTDM_BSS_START = 0x3FFB8000

Purpose

Constant ROM_BTDM_BSS_START, defining protocol or algorithm parameters.

const ROM_BTDM_BSS_BYTES

XuAPI
pub const ROM_BTDM_BSS_BYTES = 32624

Purpose

Constant ROM_BTDM_BSS_BYTES, defining protocol or algorithm parameters.

rom_cpu_mhz

XuAPI
pub fn rom_cpu_mhz() int

Purpose

Rom cpu mhz.

Parameters

No arguments are required.

Returns

int — a value of this type

rom_delay_us

XuAPI
pub fn rom_delay_us(us int)

Purpose

Rom delay us.

Parameters

us int
us (int)

Returns

This call does not return a value.

rom_bt_version

XuAPI
pub fn rom_bt_version() int

Purpose

Rom bt version.

Parameters

No arguments are required.

Returns

int — a value of this type

rom_phy_functions

XuAPI
pub fn rom_phy_functions() int

Purpose

Rom phy functions.

Parameters

No arguments are required.

Returns

int — a value of this type

smp_aes128_le

XuAPI
pub fn smp_aes128_le(key &[]int, block &[]int) []int

Purpose

Encrypt one BLE e(k, plaintext) block. Key, plaintext and result are exactly 16 octets, least-significant byte first. Empty result signals invalid input, hardware configuration failure or the bounded timeout. No software AES tables are linked and no key is cached between calls.

Parameters

key &[]int
key (read-only borrow; caller keeps the original; type &[]int)
block &[]int
block (read-only borrow; caller keeps the original; type &[]int)

Returns

[]int — slice result

struct SpiBus

XuAPI
pub struct SpiBus {
    pub sck_pin int
    pub mosi_pin int
    pub miso_pin int
    pub cs_pin int
    pub sck_mask int
    pub mosi_mask int
    pub cs_mask int
}

Purpose

Structure encapsulating sck_pin, mosi_pin, miso_pin, cs_pin, sck_mask.

Public fields

sck_pin int
field (int)
mosi_pin int
field (int)
miso_pin int
field (int)
cs_pin int
field (int)
sck_mask int
field (int)
mosi_mask int
field (int)
cs_mask int
field (int)

spi_init

XuAPI
pub fn spi_init(sck int, mosi int, miso int, cs int) SpiBus

Purpose

Spi init.

Parameters

sck int
sck (int)
mosi int
mosi (int)
miso int
miso (int)
cs int
cs (int)

Returns

SpiBus — a value of this type

(&SpiBus) cs_low

XuAPI
pub fn (bus &SpiBus) cs_low()

Purpose

Operation on &SpiBus: cs low.

Parameters

bus &SpiBus
The SpiBus instance used by this call (borrow).

Returns

This call does not return a value.

(&SpiBus) cs_high

XuAPI
pub fn (bus &SpiBus) cs_high()

Purpose

Operation on &SpiBus: cs high.

Parameters

bus &SpiBus
The SpiBus instance used by this call (borrow).

Returns

This call does not return a value.

(&SpiBus) write_byte

XuAPI
pub fn (bus &SpiBus) write_byte(b int)

Purpose

Operation on &SpiBus: write one byte.

Parameters

bus &SpiBus
The SpiBus instance used by this call (borrow).
b int
b (int)

Returns

This call does not return a value.

(&SpiBus) write_word

XuAPI
pub fn (bus &SpiBus) write_word(w int)

Purpose

Operation on &SpiBus: write word.

Parameters

bus &SpiBus
The SpiBus instance used by this call (borrow).
w int
writer or width (int)

Returns

This call does not return a value.

(&SpiBus) write_fill

XuAPI
pub fn (bus &SpiBus) write_fill(val16 int, count int)

Purpose

Operation on &SpiBus: write fill.

Parameters

bus &SpiBus
The SpiBus instance used by this call (borrow).
val16 int
val16 (int)
count int
count (int)

Returns

This call does not return a value.

delay_cycles

XuAPI
pub fn delay_cycles(cycles int)

Purpose

Delay cycles.

Parameters

cycles int
cycles (int)

Returns

This call does not return a value.

delay_us

XuAPI
pub fn delay_us(us int)

Purpose

Delay us.

Parameters

us int
us (int)

Returns

This call does not return a value.

delay_ms

XuAPI
pub fn delay_ms(ms int)

Purpose

Delay ms.

Parameters

ms int
ms (int)

Returns

This call does not return a value.

uart_write_char

XuAPI
pub fn uart_write_char(ch int)

Purpose

Uart write char.

Parameters

ch int
character code (int)

Returns

This call does not return a value.

uart_rx_available

XuAPI
pub fn uart_rx_available() bool

Purpose

Uart rx available.

Parameters

No arguments are required.

Returns

bool — true or false

uart_read_char

XuAPI
pub fn uart_read_char() int

Purpose

Uart read char.

Parameters

No arguments are required.

Returns

int — a value of this type

uart_write

XuAPI
pub fn uart_write(s string)

Purpose

Uart write.

Parameters

s string
source string (string)

Returns

This call does not return a value.

uart_print

XuAPI
pub fn uart_print(s string)

Purpose

Uart print.

Parameters

s string
source string (string)

Returns

This call does not return a value.

uart_println

XuAPI
pub fn uart_println(s string)

Purpose

Uart println.

Parameters

s string
source string (string)

Returns

This call does not return a value.

uart_print_int

XuAPI
pub fn uart_print_int(n int)

Purpose

Uart print int.

Parameters

n int
count, length, or limit (int)

Returns

This call does not return a value.

uart_println_int

XuAPI
pub fn uart_println_int(n int)

Purpose

Uart println int.

Parameters

n int
count, length, or limit (int)

Returns

This call does not return a value.

uart_print_hex

XuAPI
pub fn uart_print_hex(n int)

Purpose

Uart print hex.

Parameters

n int
count, length, or limit (int)

Returns

This call does not return a value.

wdt_disable

XuAPI
pub fn wdt_disable()

Purpose

Wdt disable.

Parameters

No arguments are required.

Returns

This call does not return a value.

wdt_feed

XuAPI
pub fn wdt_feed()

Purpose

Wdt feed.

Parameters

No arguments are required.

Returns

This call does not return a value.

init

XuAPI
pub fn init()

Purpose

Global initialization for ESP32 hardware

Parameters

No arguments are required.

Returns

This call does not return a value.

const WIFI_MODE_NULL

XuAPI
pub const WIFI_MODE_NULL   = 0

Purpose

Wi-Fi Operating Modes

const WIFI_MODE_STA

XuAPI
pub const WIFI_MODE_STA    = 1

Purpose

Constant WIFI_MODE_STA, defining protocol or algorithm parameters.

const WIFI_MODE_AP

XuAPI
pub const WIFI_MODE_AP     = 2

Purpose

Constant WIFI_MODE_AP, defining protocol or algorithm parameters.

const WIFI_MODE_APSTA

XuAPI
pub const WIFI_MODE_APSTA  = 3

Purpose

Constant WIFI_MODE_APSTA, defining protocol or algorithm parameters.

const WIFI_AUTH_UNKNOWN

XuAPI
pub const WIFI_AUTH_UNKNOWN      = -1

Purpose

Wi-Fi Authentication Modes

const WIFI_AUTH_OPEN

XuAPI
pub const WIFI_AUTH_OPEN         = 0

Purpose

Constant WIFI_AUTH_OPEN, defining protocol or algorithm parameters.

const WIFI_AUTH_WEP

XuAPI
pub const WIFI_AUTH_WEP          = 1

Purpose

Constant WIFI_AUTH_WEP, defining protocol or algorithm parameters.

const WIFI_AUTH_WPA_PSK

XuAPI
pub const WIFI_AUTH_WPA_PSK      = 2

Purpose

Constant WIFI_AUTH_WPA_PSK, defining protocol or algorithm parameters.

const WIFI_AUTH_WPA2_PSK

XuAPI
pub const WIFI_AUTH_WPA2_PSK     = 3

Purpose

Constant WIFI_AUTH_WPA2_PSK, defining protocol or algorithm parameters.

const WIFI_AUTH_WPA_WPA2_PSK

XuAPI
pub const WIFI_AUTH_WPA_WPA2_PSK = 4

Purpose

Constant WIFI_AUTH_WPA_WPA2_PSK, defining protocol or algorithm parameters.

const WIFI_AUTH_WPA3_PSK

XuAPI
pub const WIFI_AUTH_WPA3_PSK     = 5

Purpose

Constant WIFI_AUTH_WPA3_PSK, defining protocol or algorithm parameters.

const WIFI_STATUS_IDLE

XuAPI
pub const WIFI_STATUS_IDLE         = 0

Purpose

Wi-Fi Connection States

const WIFI_STATUS_SCANNING

XuAPI
pub const WIFI_STATUS_SCANNING     = 1

Purpose

Constant WIFI_STATUS_SCANNING, defining protocol or algorithm parameters.

const WIFI_STATUS_CONNECTING

XuAPI
pub const WIFI_STATUS_CONNECTING   = 2

Purpose

Constant WIFI_STATUS_CONNECTING, defining protocol or algorithm parameters.

const WIFI_STATUS_CONNECTED

XuAPI
pub const WIFI_STATUS_CONNECTED    = 3

Purpose

Constant WIFI_STATUS_CONNECTED, defining protocol or algorithm parameters.

const WIFI_STATUS_DISCONNECTED

XuAPI
pub const WIFI_STATUS_DISCONNECTED = 4

Purpose

Constant WIFI_STATUS_DISCONNECTED, defining protocol or algorithm parameters.

const WIFI_STATUS_AP_ACTIVE

XuAPI
pub const WIFI_STATUS_AP_ACTIVE    = 5

Purpose

Constant WIFI_STATUS_AP_ACTIVE, defining protocol or algorithm parameters.

const WIFI_STATUS_ERROR

XuAPI
pub const WIFI_STATUS_ERROR        = 6

Purpose

Constant WIFI_STATUS_ERROR, defining protocol or algorithm parameters.

const DPORT_WIFI_CLK_EN_REG

XuAPI
pub const DPORT_WIFI_CLK_EN_REG     = 0x3FF000CC

Purpose

Wi-Fi Hardware Baseband & DPORT Power Domain Registers

const DPORT_CORE_RST_EN_REG

XuAPI
pub const DPORT_CORE_RST_EN_REG     = 0x3FF000D0

Purpose

Constant DPORT_CORE_RST_EN_REG, defining protocol or algorithm parameters.

const DPORT_WIFI_RST_EN_REG

XuAPI
pub const DPORT_WIFI_RST_EN_REG     = 0x3FF000D0

Purpose

Constant DPORT_WIFI_RST_EN_REG, defining protocol or algorithm parameters.

const DPORT_WIFI_CLK_WIFI_EN

XuAPI
pub const DPORT_WIFI_CLK_WIFI_EN    = 0x00000406

Purpose

Constant DPORT_WIFI_CLK_WIFI_EN, defining protocol or algorithm parameters.

dhcp_lease_ip

XuAPI
pub fn dhcp_lease_ip(subnet int, slot int) string

Purpose

No DHCP client/server has provided a lease yet. Preserve API compatibility.

Parameters

subnet int
subnet (int)
slot int
slot (int)

Returns

string — result string

dhcp_gateway

XuAPI
pub fn dhcp_gateway(subnet int) string

Purpose

Dhcp gateway.

Parameters

subnet int
subnet (int)

Returns

string — result string

struct WifiApConfig

XuAPI
pub struct WifiApConfig {
    pub ssid string
    pub password string
    pub channel int
    pub authmode int
    pub max_connections int
    pub hidden bool
}

Purpose

Esp32 Configuration parameters and options set.

Public fields

ssid string
field (string)
password string
field (string)
channel int
field (int)
authmode int
field (int)
max_connections int
field (int)
hidden bool
field (bool)

struct WifiStaConfig

XuAPI
pub struct WifiStaConfig {
    pub ssid string
    pub password string
    pub channel int
    pub authmode int
}

Purpose

Esp32 Configuration parameters and options set.

Public fields

ssid string
field (string)
password string
field (string)
channel int
field (int)
authmode int
field (int)

struct WifiScanResult

XuAPI
pub struct WifiScanResult {
    pub ssid string
    pub rssi int
    pub channel int
    pub authmode int
    pub bssid string
}

Purpose

Structure encapsulating ssid, rssi, channel, authmode, bssid.

Public fields

ssid string
field (string)
rssi int
field (int)
channel int
field (int)
authmode int
field (int)
bssid string
field (string)

struct WifiBackend

XuAPI
pub struct WifiBackend {
    pub initialize fn($&session.State) bool
    pub connect fn($&session.State, &string, &string, int) bool
    pub service fn($&session.State, int) bool
    pub disconnect fn($&session.State)
    pub ping_gateway fn($&session.State, int) bool
}

Purpose

Structure encapsulating initialize, connect, service, disconnect, ping_gateway.

Public fields

initialize fn($&session.State) bool
field (function value; type fn($&session.State) bool)
connect fn($&session.State, &string, &string, int) bool
field (function value; type fn($&session.State, &string, &string, int) bool)
service fn($&session.State, int) bool
field (function value; type fn($&session.State, int) bool)
disconnect fn($&session.State)
field (function value; type fn($&session.State))
ping_gateway fn($&session.State, int) bool
field (function value; type fn($&session.State, int) bool)

wifi_default_backend

XuAPI
pub fn wifi_default_backend() WifiBackend

Purpose

Wifi default backend.

Parameters

No arguments are required.

Returns

WifiBackend — a value of this type

struct WifiDevice

XuAPI
pub struct WifiDevice {
    pub backend WifiBackend
    pub session session.State
    pub mode int
    pub status int
    pub ssid string
    pub password string
    pub ip string
    pub gateway string
    pub netmask string
    pub dns string
    pub mac string
    pub channel int
    pub rssi int
    pub ap_active bool
    pub sta_connected bool
    pub dhcp_enabled bool
    pub static_ip string
    pub static_gateway string
    pub static_netmask string
    pub static_dns string
    pub ap_client_pool_next int
}

Purpose

Structure encapsulating backend, session, mode, status, ssid.

Public fields

backend WifiBackend
field (WifiBackend)
session session.State
field (session.State)
mode int
mode
status int
field (int)
ssid string
field (string)
password string
field (string)
ip string
field (string)
gateway string
field (string)
netmask string
field (string)
dns string
field (string)
mac string
field (string)
channel int
field (int)
rssi int
field (int)
ap_active bool
field (bool)
sta_connected bool
field (bool)
dhcp_enabled bool
field (bool)
static_ip string
field (string)
static_gateway string
field (string)
static_netmask string
field (string)
static_dns string
field (string)
ap_client_pool_next int
field (int)

wifi_create

XuAPI
pub fn wifi_create() WifiDevice

Purpose

Wifi create.

Parameters

No arguments are required.

Returns

WifiDevice — a value of this type

($&WifiDevice) init

XuAPI
pub fn (dev $&WifiDevice) init() bool

Purpose

Initialize internal state and default parameters.

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).

Returns

bool — true or false

($&WifiDevice) install_backend

XuAPI
pub fn (dev $&WifiDevice) install_backend(backend WifiBackend) bool

Purpose

Operation on $&WifiDevice: install backend.

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
backend WifiBackend
backend (WifiBackend)

Returns

bool — true or false

($&WifiDevice) poll

XuAPI
pub fn (dev $&WifiDevice) poll(wait_ms int) bool

Purpose

Call regularly from the application loop; this backend has no OS thread.

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
wait_ms int
wait_ms (int)

Returns

bool — true or false

($&WifiDevice) ping_gateway

XuAPI
pub fn (dev $&WifiDevice) ping_gateway(timeout_ms int) bool

Purpose

Operation on $&WifiDevice: ping gateway.

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
timeout_ms int
timeout_ms (int)

Returns

bool — true or false

($&WifiDevice) set_mode

XuAPI
pub fn (dev $&WifiDevice) set_mode(mode int)

Purpose

Operation on $&WifiDevice: set mode.

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
mode int
mode (int)

Returns

This call does not return a value.

($&WifiDevice) config_static_ip

XuAPI
pub fn (dev $&WifiDevice) config_static_ip(ip string, gateway string, netmask string, dns string)

Purpose

Configure static IP (disables automatic DHCP)

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
ip string
ip (string)
gateway string
gateway (string)
netmask string
netmask (string)
dns string
dns (string)

Returns

This call does not return a value.

($&WifiDevice) config_dhcp

XuAPI
pub fn (dev $&WifiDevice) config_dhcp(enable bool)

Purpose

Enable or disable dynamic DHCP client

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
enable bool
enable (bool)

Returns

This call does not return a value.

($&WifiDevice) start_ap

XuAPI
pub fn (dev $&WifiDevice) start_ap(ssid string, password string, channel int) bool

Purpose

Start Wi-Fi Access Point (SoftAP) with default subnet

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
ssid string
ssid (string)
password string
password (string)
channel int
channel (int)

Returns

bool — true or false

($&WifiDevice) start_ap_ip

XuAPI
pub fn (dev $&WifiDevice) start_ap_ip(ssid string, password string, channel int, ap_ip string, gateway string) bool

Purpose

Start Wi-Fi Access Point (SoftAP) with custom IP configuration

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
ssid string
ssid (string)
password string
password (string)
channel int
channel (int)
ap_ip string
ap_ip (string)
gateway string
gateway (string)

Returns

bool — true or false

($&WifiDevice) allocate_client_ip

XuAPI
pub fn (dev $&WifiDevice) allocate_client_ip() string

Purpose

No address can be leased without an active DHCP server.

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).

Returns

string — result string

($&WifiDevice) connect

XuAPI
pub fn (dev $&WifiDevice) connect(ssid string, password string) bool

Purpose

Connect to target Wi-Fi AP (Station mode) with dynamic DHCP or static IP

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
ssid string
ssid (string)
password string
password (string)

Returns

bool — true or false

($&WifiDevice) connect_timeout

XuAPI
pub fn (dev $&WifiDevice) connect_timeout(ssid string, password string, timeout_ms int) bool

Purpose

Operation on $&WifiDevice: connect timeout.

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).
ssid string
ssid (string)
password string
password (string)
timeout_ms int
timeout_ms (int)

Returns

bool — true or false

($&WifiDevice) disconnect

XuAPI
pub fn (dev $&WifiDevice) disconnect()

Purpose

Disconnect from currently connected Wi-Fi network

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&WifiDevice) reconnect

XuAPI
pub fn (dev $&WifiDevice) reconnect() bool

Purpose

Reconnect to previously saved network

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).

Returns

bool — true or false

(&WifiDevice) is_connected

XuAPI
pub fn (dev &WifiDevice) is_connected() bool

Purpose

Check whether Station is currently connected to an AP

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

bool — true or false

(&WifiDevice) get_ip

XuAPI
pub fn (dev &WifiDevice) get_ip() string

Purpose

Get assigned IP address string

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

string — result string

(&WifiDevice) get_gateway

XuAPI
pub fn (dev &WifiDevice) get_gateway() string

Purpose

Get gateway IP address string

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

string — result string

(&WifiDevice) get_netmask

XuAPI
pub fn (dev &WifiDevice) get_netmask() string

Purpose

Get netmask string

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

string — result string

(&WifiDevice) get_dns

XuAPI
pub fn (dev &WifiDevice) get_dns() string

Purpose

Get DNS server IP string

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

string — result string

(&WifiDevice) has_rssi

XuAPI
pub fn (dev &WifiDevice) has_rssi() bool

Purpose

No calibrated RSSI is supplied by the fixed-profile backend yet.

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

bool — true or false

(&WifiDevice) get_rssi

XuAPI
pub fn (dev &WifiDevice) get_rssi() int

Purpose

Legacy getter; check has_rssi before interpreting this value.

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

int — a value of this type

(&WifiDevice) get_ssid

XuAPI
pub fn (dev &WifiDevice) get_ssid() string

Purpose

Get SSID

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

string — result string

($&WifiDevice) scan

XuAPI
pub fn (dev $&WifiDevice) scan() int

Purpose

Scan for available 2.4GHz Wi-Fi networks (returns number of detected networks)

Parameters

dev $&WifiDevice
The WifiDevice instance used by this call (exclusive borrow).

Returns

int — a value of this type

(&WifiDevice) scan_get_ssid

XuAPI
pub fn (dev &WifiDevice) scan_get_ssid(idx int) string

Purpose

Get scanned network SSID by index

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).
idx int
idx (int)

Returns

string — result string

(&WifiDevice) scan_get_rssi

XuAPI
pub fn (dev &WifiDevice) scan_get_rssi(idx int) int

Purpose

Get scanned network RSSI signal in dBm by index

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).
idx int
idx (int)

Returns

int — a value of this type

(&WifiDevice) scan_get_channel

XuAPI
pub fn (dev &WifiDevice) scan_get_channel(idx int) int

Purpose

Get scanned network channel by index

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).
idx int
idx (int)

Returns

int — a value of this type

(&WifiDevice) scan_get_auth

XuAPI
pub fn (dev &WifiDevice) scan_get_auth(idx int) int

Purpose

Get scanned network authentication mode by index

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).
idx int
idx (int)

Returns

int — a value of this type

(&WifiDevice) scan_get_auth_str

XuAPI
pub fn (dev &WifiDevice) scan_get_auth_str(idx int) string

Purpose

Get scanned network authentication mode name string by index

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).
idx int
idx (int)

Returns

string — result string

(&WifiDevice) scan_get_bssid

XuAPI
pub fn (dev &WifiDevice) scan_get_bssid(idx int) string

Purpose

Get scanned network BSSID MAC by index

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).
idx int
idx (int)

Returns

string — result string

(&WifiDevice) get_scan_result

XuAPI
pub fn (dev &WifiDevice) get_scan_result(idx int) WifiScanResult

Purpose

Get scanned network item as a value struct

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).
idx int
idx (int)

Returns

WifiScanResult — a value of this type

(&WifiDevice) print_scan_list

XuAPI
pub fn (dev &WifiDevice) print_scan_list(count int)

Purpose

Print formatted Wi-Fi scan list to UART console

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).
count int
count (int)

Returns

This call does not return a value.

authmode_to_string

XuAPI
pub fn authmode_to_string(auth int) string

Purpose

Authmode to string.

Parameters

auth int
auth (int)

Returns

string — result string

(&WifiDevice) get_status_str

XuAPI
pub fn (dev &WifiDevice) get_status_str() string

Purpose

Operation on &WifiDevice: read status str.

Parameters

dev &WifiDevice
The WifiDevice instance used by this call (borrow).

Returns

string — result string

wifi_phy_coexist_enable

XuAPI
pub fn wifi_phy_coexist_enable(channel int) bool

Purpose

Wifi phy coexist enable.

Parameters

channel int
channel (int)

Returns

bool — true or false

wifi_coexist_pause_receive

XuAPI
pub fn wifi_coexist_pause_receive() int

Purpose

Cache-off flash work requires BLE disconnected, advertising stopped, the event list empty and all PRO IRQs masked by the caller. Pause DMA without revoking the station lease/keys; the caller must resume with this token.

Parameters

No arguments are required.

Returns

int — a value of this type

wifi_coexist_resume_receive

XuAPI
pub fn wifi_coexist_resume_receive(saved int) bool

Purpose

Wifi coexist resume receive.

Parameters

saved int
saved (int)

Returns

bool — true or false

wifi_phy_calibrate

XuAPI
pub fn wifi_phy_calibrate() bool

Purpose

Wifi phy calibrate.

Parameters

No arguments are required.

Returns

bool — true or false

wifi_phy_select

XuAPI
pub fn wifi_phy_select(channel int) bool

Purpose

Wifi phy select.

Parameters

channel int
channel (int)

Returns

bool — true or false