[][src]Trait radio_sx127x::base::Base

pub trait Base<CommsError, PinError> {
    fn reset(&mut self) -> Result<(), Error<CommsError, PinError>>;
fn wait_busy(&mut self) -> Result<(), Error<CommsError, PinError>>;
fn delay_ms(&mut self, ms: u32);
fn write_regs(
        &mut self,
        reg: u8,
        data: &[u8]
    ) -> Result<(), Error<CommsError, PinError>>;
fn read_regs(
        &mut self,
        reg: u8,
        data: &mut [u8]
    ) -> Result<(), Error<CommsError, PinError>>;
fn write_buff(
        &mut self,
        data: &[u8]
    ) -> Result<(), Error<CommsError, PinError>>;
fn read_buff(
        &mut self,
        data: &mut [u8]
    ) -> Result<(), Error<CommsError, PinError>>; fn read_reg(&mut self, reg: u8) -> Result<u8, Error<CommsError, PinError>> { ... }
fn write_reg(
        &mut self,
        reg: u8,
        value: u8
    ) -> Result<(), Error<CommsError, PinError>> { ... }
fn update_reg(
        &mut self,
        reg: u8,
        mask: u8,
        value: u8
    ) -> Result<u8, Error<CommsError, PinError>> { ... } }

Base implementation can be generic over SPI or UART connections

Required methods

fn reset(&mut self) -> Result<(), Error<CommsError, PinError>>

Reset the device

fn wait_busy(&mut self) -> Result<(), Error<CommsError, PinError>>

Wait on radio device busy

fn delay_ms(&mut self, ms: u32)

Delay for the specified time

fn write_regs(
    &mut self,
    reg: u8,
    data: &[u8]
) -> Result<(), Error<CommsError, PinError>>

Write a slice of data to the specified register

fn read_regs(
    &mut self,
    reg: u8,
    data: &mut [u8]
) -> Result<(), Error<CommsError, PinError>>

Read a slice of data from the specified register

fn write_buff(&mut self, data: &[u8]) -> Result<(), Error<CommsError, PinError>>

Write to the specified FIFO buffer

fn read_buff(
    &mut self,
    data: &mut [u8]
) -> Result<(), Error<CommsError, PinError>>

Read from the specified FIFO buffer

Loading content...

Provided methods

fn read_reg(&mut self, reg: u8) -> Result<u8, Error<CommsError, PinError>>

Read a single u8 value from the specified register

fn write_reg(
    &mut self,
    reg: u8,
    value: u8
) -> Result<(), Error<CommsError, PinError>>

Write a single u8 value to the specified register

fn update_reg(
    &mut self,
    reg: u8,
    mask: u8,
    value: u8
) -> Result<u8, Error<CommsError, PinError>>

Update the specified register with the provided value & mask

Loading content...

Implementors

impl<T, CommsError, PinError> Base<CommsError, PinError> for T where
    T: Transactional<Error = WrapError<CommsError, PinError>>,
    T: Reset<Error = WrapError<CommsError, PinError>>,
    T: Busy<Error = WrapError<CommsError, PinError>>,
    T: DelayMs<u32>, 
[src]

Implement HAL for embedded helper trait implementers

fn reset(&mut self) -> Result<(), Error<CommsError, PinError>>[src]

Reset the radio

fn wait_busy(&mut self) -> Result<(), Error<CommsError, PinError>>[src]

Wait on radio device busy

fn delay_ms(&mut self, ms: u32)[src]

Delay for the specified time

fn read_regs<'a>(
    &mut self,
    reg: u8,
    data: &mut [u8]
) -> Result<(), Error<CommsError, PinError>>
[src]

Read from the specified register

fn write_regs(
    &mut self,
    reg: u8,
    data: &[u8]
) -> Result<(), Error<CommsError, PinError>>
[src]

Write to the specified register

fn write_buff(&mut self, data: &[u8]) -> Result<(), Error<CommsError, PinError>>[src]

Write to the specified buffer

fn read_buff<'a>(
    &mut self,
    data: &mut [u8]
) -> Result<(), Error<CommsError, PinError>>
[src]

Read from the specified buffer

Loading content...