API reference Dodo 0.1.5

std/embedded/wireless/cyw43

Public declarations, types, methods, and source contracts for std/embedded/wireless/cyw43.

On this page

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/wireless/cyw43"

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
hal std/embedded/hal cyw43.dodo

CHIP_ID

Constant · Source

The chip ID in the low 16 bits of ChipCommon’s first register.

pub const CHIP_ID: u32 = 43439

GPIO_COUNT

Constant · Source

GPIOs of the chip itself, WL_GPIO0 to WL_GPIO2 on the Pico W boards.

pub const GPIO_COUNT: u32 = 3

command

Function · Source

A gSPI command word.

pub fn command(write: bool, function: u32, address: u32, length: u32) -> u32

swap16

Function · Source

Exchange the 16-bit halves. Until the bus is set to 32-bit words, the chip sends and receives 16-bit words, so 32-bit values travel low half first.

pub fn swap16(word: u32) -> u32

Spi

Struct · Source

gSPI bit-banged on three pins: select (active low), clock (idles low), and data, which the host drives while sending and releases while the chip replies. data needs set_as_output and set_as_input besides the output and input pin protocols. The chip samples on the rising clock edge; replies are read just before it.

pub struct Spi<S, C, D> {
    // Private implementation fields omitted.
}

Spi.new

Function · Source

pub fn new(select: S, clock: C, data: D) -> Spi<S, C, D>

Spi.prepare_reset

Function · Source

pub fn prepare_reset(&mut self)

Spi.write

Function · Source

pub fn write(&mut self, words: &[u32]) -> u32

Spi.read

Function · Source

pub fn read(&mut self, command: u32, words: &mut[u32]) -> u32

Device

Struct · Source

A CYW43439 on gSPI bus bus, powered through power (high is on).

pub struct Device<B, P> {
    // Private implementation fields omitted.
}

Device.new

Function · Source

pub fn new(bus: B, power: P) -> Device<B, P>

Device.init

Function · Source

Power-cycle the chip and bring up its bus and backplane clock. Takes about 270 ms. Returns Timeout if the chip does not answer, Bus if the bus test patterns read back wrong, and Unsupported for another chip.

pub fn init<D>(&mut self, delay: &mut D) -> void!hal.Error

Device.chip_id

Function · Source

The chip ID from ChipCommon: CHIP_ID (43439) for a CYW43439.

pub fn chip_id(&mut self) -> u32

Device.set_gpio

Function · Source

Drive chip GPIO pin (0 to GPIO_COUNT - 1) as an output at high. The first call for a pin also connects it to its GPIO; later calls are one gSPI write.

pub fn set_gpio(&mut self, pin: u32, high: bool) -> void!hal.Error

Device.gpio_is_high

Function · Source

The level on chip GPIO pin, whether the chip or something else drives it.

pub fn gpio_is_high(&mut self, pin: u32) -> bool!hal.Error

Device.backplane_read32

Function · Source

One 32-bit word of the chip’s backplane address space.

pub fn backplane_read32(&mut self, address: u32) -> u32

Device.backplane_write32

Function · Source

pub fn backplane_write32(&mut self, address: u32, value: u32)

Device.power_off

Function · Source

Power the chip off. init powers it up again.

pub fn power_off(&mut self)

Type to search all documentation.

Keyboard shortcuts

Search documentation
Ctrl K or /
Move through results
↑ ↓
Open selected result
Enter
Close a dialog
Esc
Show these shortcuts
?