Skip to main content

write

Function write 

Source
pub const fn write(target: u8, address: u16, value: u8) -> [u8; 4]
Expand description

Builds the transfer that writes one byte to a register.

§Arguments

  • target - which chip the transfer is for, one of the TARGET_ constants.
  • address - the register address.
  • value - the byte to write.

§Returns

The bytes to clock out, target byte first.

§Examples

use pamoja_radios::sx1302::spi::{write, TARGET_CONCENTRATOR};

// The version register lives at 0x5606.
assert_eq!(write(TARGET_CONCENTRATOR, 0x5606, 0x10), [0x00, 0xd6, 0x06, 0x10]);