[−][src]Struct bluenrg::BlueNRG
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]
OutputPin1: OutputPin<Error = GpioError>,
OutputPin2: OutputPin<Error = GpioError>,
InputPin: InputPin<Error = GpioError>,
pub fn new(
rx_buffer: &'buf mut [u8],
cs: OutputPin1,
dr: InputPin,
rst: OutputPin2
) -> BlueNRG<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError>
[src]
rx_buffer: &'buf mut [u8],
cs: OutputPin1,
dr: InputPin,
rst: OutputPin2
) -> BlueNRG<'buf, SPI, OutputPin1, OutputPin2, InputPin, GpioError>
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]
F: FnOnce(&mut ActiveBlueNRG<SPI, OutputPin1, OutputPin2, InputPin, GpioError>) -> T,
SPI: Default<u8, Error = E> + Default<u8, Error = E>,
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]
&mut self,
timer: &mut T,
freq: Time
) -> Result<(), OutputPin2::Error> where
T: CountDown<Time = Time>,
Time: Copy,
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,
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,
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,
GpioError: Unpin,
InputPin: Unpin,
OutputPin1: Unpin,
OutputPin2: Unpin,
SPI: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,