Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/embedded/chip/esp32c6_lp"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
esp_lp_shared |
std/embedded/chip/esp_lp_shared |
esp32c6_lp.dodo |
hal |
std/embedded/hal |
esp32c6_lp.dodo |
mmio |
core/mmio |
esp32c6_lp.dodo |
PIN_COUNT
Constant · Source
GPIO 0 to PIN_COUNT - 1 are LP IO pads.
pub const PIN_COUNT: u32 = 8
SHARED_WORDS
Constant · Source
How many shared words the programs have, for
shared.
pub const SHARED_WORDS: u32 = esp_lp_shared.USER_WORDS
shared
Function · Source
Shared word
index, below SHARED_WORDS: what either core last wrote. Traps past the end.
pub fn shared(index: u32) -> u32
set_shared
Function · Source
pub fn set_shared(index: u32, value: u32)
runs
Function · Source
How many times the core has started since the main core loaded the program, this run included.
pub fn runs() -> u32
wake_hp
Function · Source
Wake the main core: end its hibernation, if it waits for the LP core (Hibernation.wake_on_lp_core), or, while it runs, raise the request that LpCore.take_wake_request reports.
pub fn wake_hp()
halt
Function · Source
Stop until the next wake, as returning from
maindoes. Does not return; the next wake startsmainagain.
pub fn halt()
set_period_us
Function · Source
Change the time from one start to the next, from the next halt on; 0 stops the periodic wakes, so the core runs again only when the main core starts it.
pub fn set_period_us(microseconds: u64)
ticks
Function · Source
The LP timer’s count, 48 bits of its RC slow clock, about 136 kHz.
pub fn ticks() -> u64
ticks_per_10ms
Function · Source
The LP timer’s counts per 10 ms, as the main core measured them; 1360, the oscillator’s nominal rate, if it has not.
pub fn ticks_per_10ms() -> u64
now_us
Function · Source
Microseconds on the LP timer, since some fixed start; it keeps counting through hibernation and every reset but a power cycle, in steps of about 7 us.
pub fn now_us() -> u64
Peripherals
Struct · Source
The LP core’s peripherals, from
take.
pub struct Peripherals {
pub pins: Pins
pub delay: Delay
}
take
Function · Source
The LP core’s peripherals. Each run of
maintakes them anew; a second take in one run hands out the same pads twice, so take once.
pub fn take() -> Peripherals
Delay
Struct · Source
A busy-waiting delay on the LP timer, implementing hal.Delay; it waits at least the time asked, rounded up to the timer’s 7 us steps.
pub struct Delay: hal.Delay {
}
Delay.delay_us
Function · Source
pub fn delay_us(&mut self, microseconds: u32)
Delay.delay_ms
Function · Source
pub fn delay_ms(&mut self, milliseconds: u32)
Pins
Struct · Source
The LP IO pads, GPIO 0 to 7, handed to the LP core as they are claimed. The main program must not claim the same pins.
pub struct Pins {
// Private implementation fields omitted.
}
Pins.output
Function · Source
GPIO
numberas an output, low. InvalidInput past GPIO 7, Busy if claimed already.
pub fn output(&mut self, number: u32) -> Pin!hal.Error
Pins.input
Function · Source
GPIO
numberas an input, without pulls.
pub fn input(&mut self, number: u32) -> Pin!hal.Error
Pins.release
Function · Source
Give a pin back: it becomes an input without pulls, and the main core’s IO MUX drives the pad again.
pub fn release(&mut self, pin: Pin)
Pin
Struct · Source
One LP IO pad. Implements the std/embedded/hal output and input pin protocols, so drivers written against them run on the LP core too.
pub struct Pin: hal.OutputPin + hal.InputPin {
// Private implementation fields omitted.
}
Pin.number
Function · Source
pub fn number(&self) -> u32
Pin.set_high
Function · Source
pub fn set_high(&mut self)
Pin.set_low
Function · Source
pub fn set_low(&mut self)
Pin.is_high
Function · Source
The level at the pad, whether the pin drives it or not.
pub fn is_high(&self) -> bool
Pin.set_as_output
Function · Source
pub fn set_as_output(&mut self)
Pin.set_as_input
Function · Source
pub fn set_as_input(&mut self)
Pin.set_pull
Function · Source
The pad’s pull-up and pull-down, which keep working while the main core hibernates.
pub fn set_pull(&mut self, up: bool, down: bool)
Pin.set_open_drain
Function · Source
Drive only low, and let the pad float otherwise, for shared lines such as I2C.
pub fn set_open_drain(&mut self, on: bool)