pub enum Chain {
A,
B,
}Expand description
Which of the two transmit chains a packet goes out on.
Variants§
Implementations§
Source§impl Chain
impl Chain
Sourcepub const fn base(&self) -> u16
pub const fn base(&self) -> u16
The block of registers that belong to this chain.
§Returns
The base address the chain’s registers are offsets from.
Sourcepub const fn write_buffer(&self) -> Register
pub const fn write_buffer(&self) -> Register
The control that hands this chain’s buffer to the host to write.
§Returns
The register, set before the payload is written and cleared after it.
Sourcepub const fn trigger(&self, trigger: Trigger) -> Register
pub const fn trigger(&self, trigger: Trigger) -> Register
The bit that starts a send of this kind.
§Arguments
trigger- what the send waits for.
§Returns
The register, which is cleared and then set to arm it.
§Examples
use pamoja_radios::sx1302::tx::{Chain, Trigger};
// All three share a byte and differ only in which bit they are.
let immediate = Chain::A.trigger(Trigger::Immediate);
let gps = Chain::A.trigger(Trigger::OnGps);
assert_eq!(immediate.address, gps.address);
assert_eq!((immediate.offset, gps.offset), (0, 2));Sourcepub const fn timer_byte(&self, index: u8) -> Register
pub const fn timer_byte(&self, index: u8) -> Register
One of the four bytes a timed send is programmed across.
The bytes run backward: the least significant sits at the highest address. So index
zero is the first byte trigger_bytes hands back, and each one after it is written
an address lower.
§Arguments
index- which byte, from zero to three. Anything higher is clamped to three.
§Returns
The register that byte is written to.
§Examples
use pamoja_radios::sx1302::tx::{trigger_bytes, Chain};
let bytes = trigger_bytes(0x1234_5678);
// The least significant byte goes to the highest of the four addresses.
assert_eq!(bytes[0], 0x78);
assert!(Chain::A.timer_byte(0).address > Chain::A.timer_byte(3).address);Sourcepub const fn start_delay_msb(&self) -> Register
pub const fn start_delay_msb(&self) -> Register
The high byte of the delay the chain starts early by.
§Returns
The register the first of start_delay_bytes is written to.
Sourcepub const fn start_delay_lsb(&self) -> Register
pub const fn start_delay_lsb(&self) -> Register
Sourcepub const fn modulation_type(&self) -> Register
pub const fn modulation_type(&self) -> Register
Sourcepub const fn if_source(&self) -> Register
pub const fn if_source(&self) -> Register
Where the modulator takes its samples from.
§Returns
The register that takes IF_SOURCE_LORA or IF_SOURCE_FSK. This is what parts
LoRa from an unmodulated carrier, since both name the same modulator.
Sourcepub const fn agc_bandwidth(&self) -> Register
pub const fn agc_bandwidth(&self) -> Register
The bandwidth the gain control works the transmission out against.
§Returns
The register that takes what bandwidth_value gives.
Sourcepub const fn power(&self) -> Register
pub const fn power(&self) -> Register
The power the chain transmits at.
§Returns
The register that takes what Gain::power_value gives, which is the amplifier and
the power index together rather than a number of decibels.
Sourcepub const fn digital_gain(&self) -> Register
pub const fn digital_gain(&self) -> Register
Sourcepub const fn frequency_byte(&self, index: u8) -> Register
pub const fn frequency_byte(&self, index: u8) -> Register
One byte of the carrier the chain transmits on, most significant first.
§Arguments
index- which byte, 0 to 2. Anything higher is taken as 2.
§Returns
The register that byte of frequency_value is written to.
Sourcepub const fn deviation_msb(&self) -> Register
pub const fn deviation_msb(&self) -> Register
The high bits of the frequency deviation, which is four bits rather than eight.
§Returns
The register.
Sourcepub const fn deviation_lsb(&self) -> Register
pub const fn deviation_lsb(&self) -> Register
Sourcepub const fn bandwidth(&self) -> Register
pub const fn bandwidth(&self) -> Register
The bandwidth the modulator runs at.
§Returns
The register, which shares a byte with the spreading factor.
Sourcepub const fn spreading_factor(&self) -> Register
pub const fn spreading_factor(&self) -> Register
The spreading factor it runs at.
§Returns
The register, which is the factor itself rather than an index.
Sourcepub const fn header_control(&self) -> Register
pub const fn header_control(&self) -> Register
Whether the header carries the low data rate setting.
§Returns
The register, which the reference leaves at zero.
Sourcepub const fn ppm_offset(&self) -> Register
pub const fn ppm_offset(&self) -> Register
Whether low data rate optimization is on.
§Returns
The register. A symbol longer than sixteen milliseconds needs it, and the airtime assumes it, so the two have to agree.
Sourcepub const fn coding_rate(&self) -> Register
pub const fn coding_rate(&self) -> Register
Sourcepub const fn fine_sync(&self) -> Register
pub const fn fine_sync(&self) -> Register
Whether the fine synchronization the two lowest spreading factors need is on.
§Returns
The register.
Sourcepub const fn modem_enable(&self) -> Register
pub const fn modem_enable(&self) -> Register
Sourcepub const fn cad_rx_tx(&self) -> Register
pub const fn cad_rx_tx(&self) -> Register
Which of listening, transmitting and channel activity detection the modem does.
§Returns
The register, which takes CAD_RX_TX_TRANSMIT for a send.
Sourcepub const fn implicit_header(&self) -> Register
pub const fn implicit_header(&self) -> Register
Sourcepub const fn crc_enable(&self) -> Register
pub const fn crc_enable(&self) -> Register
Whether the packet carries a physical layer checksum.
§Returns
The register. A LoRaWAN downlink goes out without one.
Sourcepub const fn payload_length(&self) -> Register
pub const fn payload_length(&self) -> Register
Sourcepub const fn modem_start(&self) -> Register
pub const fn modem_start(&self) -> Register
Sourcepub const fn preamble_lsb(&self) -> Register
pub const fn preamble_lsb(&self) -> Register
Sourcepub const fn preamble_msb(&self) -> Register
pub const fn preamble_msb(&self) -> Register
Sourcepub const fn chirp_lowpass(&self) -> Register
pub const fn chirp_lowpass(&self) -> Register
Sourcepub const fn continuous_chirp(&self) -> Register
pub const fn continuous_chirp(&self) -> Register
Sourcepub const fn chirp_invert(&self) -> Register
pub const fn chirp_invert(&self) -> Register
Sourcepub const fn continuous(&self) -> Register
pub const fn continuous(&self) -> Register
Sourcepub const fn sync_peak1(&self) -> Register
pub const fn sync_peak1(&self) -> Register
Where the first sync symbol goes, which says which network the packet belongs to.
§Returns
The register. It powers up holding the private position, as the receive side does.