Skip to main content

spmi_write_contiguous

Macro spmi_write_contiguous 

Source
macro_rules! spmi_write_contiguous {
    (
        $regs:expr,
        $head:ident => $head_val:expr $(, $tail:ident => $tail_val:expr )* $(,)?
    ) => { ... };
}
Expand description

Writes multiple contiguous registers in a single async call to the hardware.

§Sub-Word Padding

When writing to word-addressed blocks (address_unit: u16) containing sub-word registers (e.g. u8), unwritten padding byte positions within a word unit are zero-filled before issuing the bulk write.

§Module Names and Paths

The macro expects register module names available directly in scope (e.g. my_reg). Module paths (e.g. submod::my_reg) are not supported as variable binding identifiers.

§Arguments

  1. $regs:expr: The block struct instance.
  2. $( $reg:ident => $val:expr ),*: A comma-separated mapping from register modules to their values.

§Examples

// Write both 'general' and 'status' registers together:
// let regs = MySpmiRegisters::new(spmi_proxy);
spmi_write_contiguous!(
    &regs,
    my_reg => val_a,
    status_be_reg => val_b
).await?;