Skip to main content

Board

Struct Board 

Source
pub struct Board {
    pub amplifier: PowerAmplifier,
    pub tcxo: Option<(TcxoVoltage, u32)>,
    pub dio2_rf_switch: bool,
    pub regulator: RegulatorMode,
    pub llcc68: bool,
}
Expand description

How a module wires its SX126x: the amplifier, the clock, the antenna switch, and the regulator.

The SPI interface cannot tell an SX1261 from an SX1262 or an LLCC68, and it cannot see the parts around the chip, so these come from the module’s schematic.

§Examples

use pamoja_radios::sx126x::config::{PowerAmplifier, RegulatorMode, TcxoVoltage};
use pamoja_radios::sx126x::Board;

// An SX1262 clocked by a 1.8 V TCXO that settles in 5 ms, with DIO2 on the antenna switch.
let board = Board::new(PowerAmplifier::HighPower)
    .with_tcxo(TcxoVoltage::V1_8, 5_000)
    .with_dio2_rf_switch()
    .with_dc_dc();
assert_eq!(board.regulator, RegulatorMode::DcDc);

Fields§

§amplifier: PowerAmplifier

The power amplifier: PowerAmplifier::LowPower for the SX1261 and PowerAmplifier::HighPower for the SX1262 and the LLCC68.

§tcxo: Option<(TcxoVoltage, u32)>

The voltage DIO3 supplies a TCXO with, and how long the TCXO takes to settle in microseconds, for a module clocked by a TCXO rather than a crystal.

§dio2_rf_switch: bool

Whether DIO2 drives the antenna switch, high while transmitting (section 13.3.5).

§regulator: RegulatorMode

The regulator: the DC-DC converter where the module fits its inductor, else the LDO.

§llcc68: bool

Whether the chip is an LLCC68, which Sx126x::configure holds to the spreading factors and bandwidths llcc68_supports allows.

Implementations§

Source§

impl Board

Source

pub const fn new(amplifier: PowerAmplifier) -> Board

A module with a crystal, no switch on DIO2, and the LDO, which are the chip’s defaults.

§Arguments
  • amplifier - the chip’s power amplifier.
§Returns

The board.

Source

pub const fn with_tcxo(self, voltage: TcxoVoltage, settle_us: u32) -> Board

Returns the board clocked by a TCXO that DIO3 powers.

§Arguments
  • voltage - the TCXO supply voltage.
  • settle_us - how long the TCXO takes to settle, in microseconds.
§Returns

The board.

Source

pub const fn with_dio2_rf_switch(self) -> Board

Returns the board with DIO2 driving the antenna switch.

§Returns

The board.

Source

pub const fn with_dc_dc(self) -> Board

Returns the board running on the DC-DC converter.

§Returns

The board.

Source

pub const fn with_llcc68(self) -> Board

Returns the board with an LLCC68, whose high power amplifier it must also name.

§Returns

The board.

Trait Implementations§

Source§

impl Clone for Board

Source§

fn clone(&self) -> Board

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Board

Source§

impl Debug for Board

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Board

Source§

impl Hash for Board

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Board

Source§

fn eq(&self, other: &Board) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Board

Auto Trait Implementations§

§

impl Freeze for Board

§

impl RefUnwindSafe for Board

§

impl Send for Board

§

impl Sync for Board

§

impl Unpin for Board

§

impl UnsafeUnpin for Board

§

impl UnwindSafe for Board

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.