Struct nrf51::uart::UART
[−]
[src]
pub struct UART {
regs: *const UartRegisters,
client: Cell<Option<&'static Client>>,
buffer: TakeCell<'static, [u8]>,
len: Cell<usize>,
index: Cell<usize>,
}Fields
regs: *const UartRegisters
client: Cell<Option<&'static Client>>
buffer: TakeCell<'static, [u8]>
len: Cell<usize>
index: Cell<usize>
Methods
impl UART[src]
pub const fn new() -> UART[src]
pub fn configure(&self, tx: Pinmux, rx: Pinmux, cts: Pinmux, rts: Pinmux)[src]
This UART implementation uses pins 8-11:
- pin 8: RTS
- pin 9: TX
- pin 10: CTS
- pin 11: RX
fn set_baud_rate(&self, baud_rate: u32)[src]
pub fn enable(&self)[src]
pub fn enable_rx_interrupts(&self)[src]
pub fn enable_tx_interrupts(&self)[src]
pub fn disable_rx_interrupts(&self)[src]
pub fn disable_tx_interrupts(&self)[src]
pub fn handle_interrupt(&mut self)[src]
pub unsafe fn send_byte(&self, byte: u8)[src]
pub fn tx_ready(&self) -> bool[src]
fn rx_ready(&self) -> bool[src]
Trait Implementations
impl UART for UART[src]
fn set_client(&self, client: &'static Client)[src]
Set the client for this UART peripheral. The client will be called when events finish. Read more
fn init(&self, params: UARTParams)[src]
Initialize UART Read more
fn transmit(&self, tx_data: &'static mut [u8], tx_len: usize)[src]
Transmit data.
fn receive(&self, rx_buffer: &'static mut [u8], rx_len: usize)[src]
Receive data until buffer is full.