[][src]Struct dw1000::hl::DW1000

pub struct DW1000<SPI, CS, State> { /* fields omitted */ }

Entry point to the DW1000 driver API

Methods

impl<SPI, CS> DW1000<SPI, CS, Uninitialized> where
    SPI: Transfer<u8> + Write<u8>,
    CS: OutputPin
[src]

pub fn new(spi: SPI, chip_select: CS) -> Self[src]

Create a new instance of DW1000

Requires the SPI peripheral and the chip select pin that are connected to the DW1000.

pub fn init(self) -> Result<DW1000<SPI, CS, Ready>, Error<SPI>>[src]

Initialize the DW1000

The DW1000's default configuration is somewhat inconsistent, and the user manual (section 2.5.5) has a long list of default configuration values that should be changed to guarantee everything works correctly. This method does just that.

Please note that this method assumes that you kept the default configuration. It is generally recommended not to change configuration before calling this method.

impl<SPI, CS> DW1000<SPI, CS, Ready> where
    SPI: Transfer<u8> + Write<u8>,
    CS: OutputPin
[src]

pub fn set_antenna_delay(
    &mut self,
    rx_delay: u16,
    tx_delay: u16
) -> Result<(), Error<SPI>>
[src]

Sets the RX and TX antenna delays

pub fn get_tx_antenna_delay(&mut self) -> Result<Duration, Error<SPI>>[src]

Returns the TX antenna delay

pub fn set_address(
    &mut self,
    pan_id: PanId,
    addr: ShortAddress
) -> Result<(), Error<SPI>>
[src]

Sets the network id and address used for sending and receiving

pub fn get_address(&mut self) -> Result<Address, Error<SPI>>[src]

Returns the network id and address used for sending and receiving

pub fn sys_time(&mut self) -> Result<Instant, Error<SPI>>[src]

Returns the current system time

pub fn send(
    &mut self,
    data: &[u8],
    destination: Address,
    delayed_time: Option<Instant>
) -> Result<TxFuture<SPI, CS>, Error<SPI>>
[src]

Send an IEEE 802.15.4 MAC frame

The data argument is wrapped into an IEEE 802.15.4 MAC frame and sent to destination.

This operation can be delayed to aid in distance measurement, by setting delayed_time to Some(instant). If you want to send the frame as soon as possible, just pass None instead.

This method starts the transmission and returns immediately thereafter. Use the returned TxFuture, to wait for the transmission to finish and check its result.

pub fn receive(&mut self) -> Result<RxFuture<SPI, CS>, Error<SPI>>[src]

Attempt to receive an IEEE 802.15.4 MAC frame

Initializes the receiver, then returns an RxFuture that allows the caller to wait for a message.

Only frames addressed to this device will be received.

pub fn force_idle(&mut self) -> Result<(), Error<SPI>>[src]

Force the DW1000 into IDLE mode

Any ongoing RX/TX operations will be aborted.

pub fn clear_interrupts(&mut self) -> Result<(), Error<SPI>>[src]

Clear all interrupt flags

impl<SPI, CS, State> DW1000<SPI, CS, State>[src]

pub fn ll(&mut self) -> &mut DW1000<SPI, CS>[src]

Provides direct access to the register-level API

Be aware that by using the register-level API, you can invalidate various assumptions that the high-level API makes about the operation of the DW1000. Don't use the register-level and high-level APIs in tandem, unless you know what you're doing.

Auto Trait Implementations

impl<SPI, CS, State> Send for DW1000<SPI, CS, State> where
    CS: Send,
    SPI: Send,
    State: Send

impl<SPI, CS, State> Sync for DW1000<SPI, CS, State> where
    CS: Sync,
    SPI: Sync,
    State: Sync

Blanket Implementations

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> From for T[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]