Struct capsules::nrf51822_serialization::Nrf51822Serialization
[−]
[src]
pub struct Nrf51822Serialization<'a, U: UARTAdvanced + 'a> { uart: &'a U, app: MapCell<App>, tx_buffer: TakeCell<'static, [u8]>, rx_buffer: TakeCell<'static, [u8]>, }
Fields
uart: &'a U
app: MapCell<App>
tx_buffer: TakeCell<'static, [u8]>
rx_buffer: TakeCell<'static, [u8]>
Methods
impl<'a, U: UARTAdvanced> Nrf51822Serialization<'a, U>
[src]
pub fn new(
uart: &'a U,
tx_buffer: &'static mut [u8],
rx_buffer: &'static mut [u8]
) -> Nrf51822Serialization<'a, U>
[src]
uart: &'a U,
tx_buffer: &'static mut [u8],
rx_buffer: &'static mut [u8]
) -> Nrf51822Serialization<'a, U>
pub fn initialize(&self)
[src]
Trait Implementations
impl<'a, U: UARTAdvanced> Driver for Nrf51822Serialization<'a, U>
[src]
fn allow(
&self,
_appid: AppId,
allow_type: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
[src]
&self,
_appid: AppId,
allow_type: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
Pass application space memory to this driver.
allow_num
0
: Provide a RX buffer.1
: Provide a TX buffer.
fn subscribe(&self, subscribe_type: usize, callback: Callback) -> ReturnCode
[src]
Register a callback to the Nrf51822Serialization driver.
The callback will be called when a TX finishes and when RX data is available.
subscribe_num
0
: Set callback.
fn command(
&self,
command_type: usize,
_: usize,
_: usize,
_: AppId
) -> ReturnCode
[src]
&self,
command_type: usize,
_: usize,
_: usize,
_: AppId
) -> ReturnCode
Issue a command to the Nrf51822Serialization driver.
command_type
0
: Driver check.1
: Send the allowed buffer to the nRF.
impl<'a, U: UARTAdvanced> Client for Nrf51822Serialization<'a, U>
[src]
fn transmit_complete(&self, buffer: &'static mut [u8], _error: Error)
[src]
UART transmit complete.
fn receive_complete(
&self,
buffer: &'static mut [u8],
rx_len: usize,
_error: Error
)
[src]
&self,
buffer: &'static mut [u8],
rx_len: usize,
_error: Error
)
UART receive complete.