serial

Function serial 

Source
pub fn serial() -> &'static SpinLock<Serial>
Expand description

Returns a reference to the global serial device.

This function provides safe access to the global serial interface wrapped in a SpinLock. Users must lock the spinlock before performing any operations on the Serial instance.

§Example

use keos::teletype::Teletype;

let serial = serial().lock();
serial.write("Hello, serial output!").expect("Failed to write tty");

§Safety

  • Since this returns a reference to a global SpinLock, the caller must ensure proper locking before accessing the Serial device.

§Returns

A reference to the SpinLock wrapping the global Serial instance.