Struct sam4l::usart::USART
[−]
[src]
pub struct USART { registers: *mut USARTRegisters, clock: Clock, usart_mode: Cell<UsartMode>, usart_tx_state: Cell<USARTStateTX>, usart_rx_state: Cell<USARTStateRX>, rx_dma: Cell<Option<&'static DMAChannel>>, rx_dma_peripheral: DMAPeripheral, rx_len: Cell<usize>, tx_dma: Cell<Option<&'static DMAChannel>>, tx_dma_peripheral: DMAPeripheral, tx_len: Cell<usize>, client: Cell<Option<UsartClient<'static>>>, spi_chip_select: Cell<Option<&'static Pin>>, }
Fields
registers: *mut USARTRegisters
clock: Clock
usart_mode: Cell<UsartMode>
usart_tx_state: Cell<USARTStateTX>
usart_rx_state: Cell<USARTStateRX>
rx_dma: Cell<Option<&'static DMAChannel>>
rx_dma_peripheral: DMAPeripheral
rx_len: Cell<usize>
tx_dma: Cell<Option<&'static DMAChannel>>
tx_dma_peripheral: DMAPeripheral
tx_len: Cell<usize>
client: Cell<Option<UsartClient<'static>>>
spi_chip_select: Cell<Option<&'static Pin>>
Methods
impl USART
[src]
const fn new(
base_addr: *mut USARTRegisters,
clock: PBAClock,
rx_dma_peripheral: DMAPeripheral,
tx_dma_peripheral: DMAPeripheral
) -> USART
[src]
base_addr: *mut USARTRegisters,
clock: PBAClock,
rx_dma_peripheral: DMAPeripheral,
tx_dma_peripheral: DMAPeripheral
) -> USART
pub fn set_dma(&self, rx_dma: &'static DMAChannel, tx_dma: &'static DMAChannel)
[src]
pub fn enable_rx(&self)
[src]
pub fn enable_tx(&self)
[src]
pub fn disable_rx(&self)
[src]
pub fn disable_tx(&self)
[src]
pub fn abort_rx(&self, error: Error)
[src]
pub fn abort_tx(&self, error: Error)
[src]
pub fn enable_tx_empty_interrupt(&self)
[src]
pub fn disable_tx_empty_interrupt(&self)
[src]
pub fn enable_rx_error_interrupts(&self)
[src]
pub fn disable_rx_interrupts(&self)
[src]
pub fn disable_tx_interrupts(&self)
[src]
pub fn disable_interrupts(&self)
[src]
pub fn reset(&self)
[src]
pub fn handle_interrupt(&self)
[src]
fn enable_clock(&self)
[src]
fn disable_clock(&self)
[src]
fn is_clock_enabled(&self) -> bool
[src]
fn set_mode(&self, mode: u32)
[src]
fn set_baud_rate(&self, baud_rate: u32)
[src]
fn rts_enable_spi_assert_cs(&self)
[src]
In non-SPI mode, this drives RTS low. In SPI mode, this asserts (drives low) the chip select line.
fn rts_disable_spi_deassert_cs(&self)
[src]
In non-SPI mode, this drives RTS high. In SPI mode, this de-asserts (drives high) the chip select line.
fn enable_rx_timeout(&self, timeout: u8)
[src]
fn disable_rx_timeout(&self)
[src]
fn enable_rx_terminator(&self, _terminator: u8)
[src]
pub fn send_byte(&self, byte: u8)
[src]
pub fn tx_ready(&self) -> bool
[src]
Trait Implementations
impl DMAClient for USART
[src]
fn xfer_done(&self, pid: DMAPeripheral)
[src]
impl UART for USART
[src]
Implementation of kernel::hil::UART
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.
impl UARTAdvanced for USART
[src]
fn receive_automatic(&self, rx_buffer: &'static mut [u8], interbyte_timeout: u8)
[src]
Receive data until interbyte_timeout
bit periods have passed since the last byte or buffer is full. Does not timeout until at least one byte has been received. Read more
fn receive_until_terminator(&self, rx_buffer: &'static mut [u8], terminator: u8)
[src]
Receive data until terminator
data byte has been received or buffer is full Read more
impl SpiMaster for USART
[src]
SPI
type ChipSelect = Option<&'static Pin>
fn init(&self)
[src]
fn set_client(&self, client: &'static SpiMasterClient)
[src]
fn is_busy(&self) -> bool
[src]
fn read_write_bytes(
&self,
write_buffer: &'static mut [u8],
read_buffer: Option<&'static mut [u8]>,
len: usize
) -> ReturnCode
[src]
&self,
write_buffer: &'static mut [u8],
read_buffer: Option<&'static mut [u8]>,
len: usize
) -> ReturnCode
Perform an asynchronous read/write operation, whose completion is signaled by invoking SpiMasterClient on the initialized client. write_buffer must be Some, read_buffer may be None. If read_buffer is Some, the length of the operation is the minimum of the size of the two buffers. Read more
fn write_byte(&self, val: u8)
[src]
fn read_byte(&self) -> u8
[src]
fn read_write_byte(&self, val: u8) -> u8
[src]
fn specify_chip_select(&self, cs: Self::ChipSelect)
[src]
Pass in a None to use the HW chip select pin on the USART (RTS).
fn set_rate(&self, rate: u32) -> u32
[src]
Returns the actual rate set