components

Module console

Source
Expand description

Components for Console and ConsoleOrdered.

These are two alternative implementations of the serial console system call interface. Console allows prints of arbitrary length but does not have ordering or atomicity guarantees. ConsoleOrdered, in contrast, has limits on the maximum lengths of prints but provides a temporal ordering and ensures a print is atomic at least up to particular length (typically 200 bytes). Console is useful when userspace is printing large messages. ConsoleOrdered is useful when you are debugging and there are inter-related messages from the kernel and userspace, whose ordering is important to maintain.

This provides three Components, ConsoleComponent and ConsoleOrderedComponent, which implement a buffered read/write console over a serial port, and UartMuxComponent, which provides multiplexed access to hardware UART. As an example, the serial port used for console on Imix is typically USART3 (the DEBUG USB connector).

§Usage

let uart_mux = UartMuxComponent::new(&sam4l::usart::USART3,
                                     115200,
                                     deferred_caller).finalize(components::uart_mux_component_static!());
let console = ConsoleComponent::new(board_kernel, uart_mux)
   .finalize(console_component_static!());

Structs§