⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

UsbHostController

Trait UsbHostController 

Source
pub trait UsbHostController: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn init(&mut self) -> Result<(), KernelError>;
    fn reset(&mut self) -> Result<(), KernelError>;
    fn get_port_count(&self) -> u8;
    fn get_port_status(&self, port: u8) -> Result<UsbPortStatus, KernelError>;
    fn reset_port(&mut self, port: u8) -> Result<(), KernelError>;
    fn enable_port(&mut self, port: u8) -> Result<(), KernelError>;
    fn disable_port(&mut self, port: u8) -> Result<(), KernelError>;
    fn transfer(
        &mut self,
        device_address: u8,
        transfer: UsbTransfer,
    ) -> Result<Vec<u8>, KernelError>;
    fn set_device_address(
        &mut self,
        old_address: u8,
        new_address: u8,
    ) -> Result<(), KernelError>;
}
Expand description

USB host controller trait

Required Methods§

Source

fn name(&self) -> &str

Get controller name

Source

fn init(&mut self) -> Result<(), KernelError>

Initialize the controller

Source

fn reset(&mut self) -> Result<(), KernelError>

Reset the controller

Source

fn get_port_count(&self) -> u8

Get number of ports

Source

fn get_port_status(&self, port: u8) -> Result<UsbPortStatus, KernelError>

Check port status

Source

fn reset_port(&mut self, port: u8) -> Result<(), KernelError>

Reset port

Source

fn enable_port(&mut self, port: u8) -> Result<(), KernelError>

Enable port

Source

fn disable_port(&mut self, port: u8) -> Result<(), KernelError>

Disable port

Source

fn transfer( &mut self, device_address: u8, transfer: UsbTransfer, ) -> Result<Vec<u8>, KernelError>

Perform USB transfer

Source

fn set_device_address( &mut self, old_address: u8, new_address: u8, ) -> Result<(), KernelError>

Set device address

Implementors§