[][src]Struct bluenrg::BlueNRG

pub struct BlueNRG<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> { /* fields omitted */ }

Handle for interfacing with the BlueNRG-MS.

Implementations

impl<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> BlueNRG<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> where
    OutputPin1: OutputPin<Error = GpioError>,
    OutputPin2: OutputPin<Error = GpioError>,
    InputPin: InputPin<Error = GpioError>, 
[src]

pub fn new(
    rx_buffer: &'buf mut [u8],
    cs: OutputPin1,
    dr: InputPin,
    rst: OutputPin2
) -> BlueNRG<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError>
[src]

Returns a new BlueNRG struct with the given RX Buffer and pins. Resets the controller.

pub fn with_spi<'spi, T, F, E>(&mut self, spi: &'spi mut SPI, body: F) -> T where
    F: FnOnce(&mut ActiveBlueNRG<SPI, OutputPin1, OutputPin2, InputPin, GpioError>) -> T,
    SPI: Default<u8, Error = E> + Default<u8, Error = E>, 
[src]

Invokes the given body function with an ActiveBlueNRG that uses this BlueNRG struct and the provided SPI bus handle.

Returns the result of the invoked body.

pub fn reset<T, Time>(
    &mut self,
    timer: &mut T,
    freq: Time
) -> Result<(), OutputPin2::Error> where
    T: CountDown<Time = Time>,
    Time: Copy
[src]

Resets the BlueNRG Controller. Uses the given timer to delay 1 cycle at freq Hz after toggling the reset pin.

Auto Trait Implementations

impl<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> Send for BlueNRG<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> where
    GpioError: Send,
    InputPin: Send,
    OutputPin1: Send,
    OutputPin2: Send,
    SPI: Send

impl<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> Sync for BlueNRG<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> where
    GpioError: Sync,
    InputPin: Sync,
    OutputPin1: Sync,
    OutputPin2: Sync,
    SPI: Sync

impl<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> Unpin for BlueNRG<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError> where
    GpioError: Unpin,
    InputPin: Unpin,
    OutputPin1: Unpin,
    OutputPin2: Unpin,
    SPI: Unpin

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.