Struct capsules::console::Console
[−]
[src]
pub struct Console<'a, U: UART + 'a> { uart: &'a U, apps: Grant<App>, in_progress: Cell<Option<AppId>>, tx_buffer: TakeCell<'static, [u8]>, baud_rate: u32, }
Fields
uart: &'a U
apps: Grant<App>
in_progress: Cell<Option<AppId>>
tx_buffer: TakeCell<'static, [u8]>
baud_rate: u32
Methods
impl<'a, U: UART> Console<'a, U>
[src]
pub fn new(
uart: &'a U,
baud_rate: u32,
tx_buffer: &'static mut [u8],
grant: Grant<App>
) -> Console<'a, U>
[src]
uart: &'a U,
baud_rate: u32,
tx_buffer: &'static mut [u8],
grant: Grant<App>
) -> Console<'a, U>
pub fn initialize(&self)
[src]
fn send_new(&self, app_id: AppId, app: &mut App, len: usize) -> ReturnCode
[src][−]
Internal helper function for setting up a new send transaction
fn send_continue(
&self,
app_id: AppId,
app: &mut App
) -> Result<bool, ReturnCode>
[src][−]
&self,
app_id: AppId,
app: &mut App
) -> Result<bool, ReturnCode>
Internal helper function for continuing a previously set up transaction Returns true if this send is still active, or false if it has completed
fn send(&self, app_id: AppId, app: &mut App, slice: AppSlice<Shared, u8>)
[src][−]
Internal helper function for sending data for an existing transaction. Cannot fail. If can't send now, it will schedule for sending later.
Trait Implementations
impl<'a, U: UART> Driver for Console<'a, U>
[src]
fn allow(
&self,
appid: AppId,
allow_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
[src][−]
&self,
appid: AppId,
allow_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode
[src][−]
fn command(
&self,
cmd_num: usize,
arg1: usize,
_: usize,
appid: AppId
) -> ReturnCode
[src][−]
&self,
cmd_num: usize,
arg1: usize,
_: usize,
appid: AppId
) -> ReturnCode
Initiate serial transfers
command_num
0
: Driver check.1
: Prints a buffer passed throughallow
up to the length passed inarg1
impl<'a, U: UART> Client for Console<'a, U>
[src]
fn transmit_complete(&self, buffer: &'static mut [u8], _error: Error)
[src][−]
UART transmit complete.
fn receive_complete(
&self,
_rx_buffer: &'static mut [u8],
_rx_len: usize,
_error: Error
)
[src][−]
&self,
_rx_buffer: &'static mut [u8],
_rx_len: usize,
_error: Error
)
UART receive complete.