Struct sam4l::usbc::Usbc
[−]
[src]
#[repr(C)]pub struct Usbc<'a> { descriptors: [Endpoint; 8], client: Option<&'a Client>, state: MapCell<State>, }
State for managing the USB controller
Fields
descriptors: [Endpoint; 8]
client: Option<&'a Client>
state: MapCell<State>
Methods
impl<'a> Usbc<'a>
[src]
const fn new() -> Self
[src]
fn _attach(&self)
[src]
Attach to the USB bus after enabling USB clock
fn _detach(&self)
[src]
Detach from the USB bus. Also disable USB clock to save energy.
pub fn _enable(&self, mode: Mode)
[src]
Enable the controller's clocks and interrupt and transition to Idle state (No effect if current state is not Reset)
fn _active(&self) -> bool
[src]
fn _disable(&self)
[src]
Disable the controller, its interrupt, and its clocks
pub fn endpoint_bank_set_buffer(
&self,
endpoint: EndpointIndex,
bank: BankIndex,
buf: &[VolatileCell<u8>]
)
[src]
&self,
endpoint: EndpointIndex,
bank: BankIndex,
buf: &[VolatileCell<u8>]
)
Provide a buffer for transfers in and out of the given endpoint
pub fn endpoint_enable(&self, endpoint: u32, cfg: EndpointConfig)
[src]
Configure and enable an endpoint (XX: include addr and packetsize?)
fn endpoint_configure(&self, endpoint: usize, cfg: EndpointConfig)
[src]
pub fn set_client(&mut self, client: &'a Client)
[src]
Set a client to receive data from the USBC
pub fn handle_interrupt(&mut self)
[src]
Handle an interrupt from the USBC
fn handle_device_interrupt(
&mut self,
speed: Speed,
config: &Option<EndpointConfig>,
dstate: &mut DeviceState
)
[src]
&mut self,
speed: Speed,
config: &Option<EndpointConfig>,
dstate: &mut DeviceState
)