[−][src]Struct monotron_api::Api
This structure contains all the function pointers the application can use to access OS functions.
Fields
putchar: extern "C" fn(ch: u8) -> i32Old function for writing a single 8-bit character to the screen.
puts: extern "C" fn(string: *const u8) -> i32Old function for writing a null-terminated 8-bit string to the screen.
readc: extern "C" fn() -> i32Old function for reading one byte from stdin, blocking.
kbhit: extern "C" fn() -> i32Old function for checking if readc() would block.
move_cursor: extern "C" fn(row: u8, col: u8)Old function for moving the cursor on screen. To be replaced with ANSI escape codes.
play: extern "C" fn(frequency: u32, channel: u8, volume: u8, waveform: u8) -> i32Old function for playing a note.
change_font: extern "C" fn(font_id: u32, font_data: *const u8)Old function for changing the on-screen font.
get_joystick: extern "C" fn() -> u8Old function for reading the Joystick status.
set_cursor_visible: extern "C" fn(enabled: u8)Old function for turning the cursor on/off.
read_char_at: extern "C" fn(row: u8, col: u8) -> u16Old function for reading the contents of the screen.
wfvbi: extern "C" fn()Wait for next vertical blanking interval.
open: extern "C" fn(filename: BorrowedString, mode: OpenMode) -> HandleResultOpen/create a device/file. Returns a file handle, or an error.
close: extern "C" fn(handle: Handle) -> EmptyResultClose a previously opened handle.
read: extern "C" fn(handle: Handle, buffer: *mut u8, buffer_len: usize) -> SizeResultRead from a file handle into the given buffer. Returns an error, or
the number of bytes read (which may be less than buffer_len).
write: extern "C" fn(handle: Handle, buffer: *const u8, buffer_len: usize) -> SizeResultWrite the contents of the given buffer to a file handle. Returns an
error, or the number of bytes written (which may be less than
buffer_len).
write_then_read: extern "C" fn(handle: Handle, out_buffer: *const u8, out_buffer_len: usize, in_buffer: *mut u8, in_buffer_len: usize) -> SizeResultWrite to the handle and the read from the handle. Useful when doing an
I2C read of a specific address. It is an error if the complete
out_buffer could not be written.
seek: extern "C" fn(handle: Handle, offset: Offset) -> EmptyResultMove the read/write pointer in a file.
opendir: extern "C" fn(filename: BorrowedString) -> HandleResultOpen a directory. Returns a file handle, or an error.
readdir: extern "C" fn(handle: Handle, dir_entry: &mut DirEntry) -> EmptyResultRead directory entry into given buffer.
stat: extern "C" fn(filename: BorrowedString, stat_entry: &mut DirEntry) -> EmptyResultGet information about a file by path
gettime: extern "C" fn() -> TimestampGet the current time
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,