Skip to main content

steps

Function steps 

Source
pub const fn steps(mcu: Mcu) -> [Load; 7]
Expand description

The steps that load one microcontroller, in order.

§Arguments

  • mcu - which microcontroller to load.

§Returns

Hold it in reset, claim its memory, put the memory window on the first page, write, read back, release it, and check the parity the chip reports.

§Examples

use pamoja_radios::sx1302::firmware::{steps, Load, Mcu};
use pamoja_radios::sx1302::register;

let plan = steps(Mcu::Agc);

// The microcontroller is stopped before its memory is touched.
assert_eq!(plan[0], Load::Write(register::AGC_MCU_CLEAR, 1));
assert_eq!(plan[1], Load::Write(register::AGC_MCU_HOST_PROG, 1));

// And the chip has the last word on whether the firmware took.
assert_eq!(plan[6], Load::CheckParity(register::AGC_MCU_PARITY_ERROR));