Skip to main content

start_arbiter

Function start_arbiter 

Source
pub fn start_arbiter(dual_demodulation: u8) -> impl Iterator<Item = Step>
Expand description

What the arbiter is told before it is let go.

The arbiter shares the receivers between the channels. It comes up halted, reports its version, takes a few settings in its own registers, and is then told to resume.

§Arguments

  • dual_demodulation - which spreading factors are demodulated twice over, one bit each counting from SF5. Demodulating twice buys a finer timestamp at the cost of capacity, so a gateway that does not need fine timestamps passes zero.

§Returns

The steps, in the order the arbiter takes them.

§Examples

use pamoja_radios::sx1302::mcu::{start_arbiter, Step};

let mut order = start_arbiter(0x00);
assert_eq!(order.next(), Some(Step::Await(0x01)));
assert_eq!(order.next(), Some(Step::Version(2)));

// It ends waiting for the arbiter to report that it is running again.
assert_eq!(start_arbiter(0x00).last(), Some(Step::Await(0x00)));