#[repr(C)]pub struct RegisterBlock { /* private fields */ }Expand description
Register block
Implementations§
Source§impl RegisterBlock
impl RegisterBlock
Sourcepub const fn endpoint(&self) -> &ENDPOINT
pub const fn endpoint(&self) -> &ENDPOINT
0x00 - Endpoint register number: Contains the endpoint the enqueued packet is to be transmitted on. Writing to this field marks the relevant packet as ready to transmit; and thus should only be written after a full packet has been written into the FIFO. If no data has been placed into the DATA FIFO, a zero-length packet is generated. Note that any IN requests that do not match the endpoint number are automatically NAK’d.
Sourcepub const fn stall(&self) -> &STALL
pub const fn stall(&self) -> &STALL
0x01 - Stall register stalled: When this field contains ‘1’, any IN tokens targeting epno will be responded to with a STALL token, rather than DATA or a NAK. For EP0, this field will automatically be cleared when a new SETUP token is received.
Sourcepub const fn pid(&self) -> &PID
pub const fn pid(&self) -> &PID
0x02 - Pid register toggle: Sets the current PID toggle bit for the given endpoint.
Sourcepub const fn status(&self) -> &STATUS
pub const fn status(&self) -> &STATUS
0x04 - Status register nak: Contains a bitmask of endpoints that have responded with a NAK since the last read of this register. epno: Contains the endpoint being transmitted on. idle: This value is 1 if no packet is actively being transmitted. have: This value is 1 if data is present in the transmit FIFO. pid: Contains the current PID toggle bit for the given endpoint.
Sourcepub const fn reset(&self) -> &RESET
pub const fn reset(&self) -> &RESET
0x08 - Reset register fifo: A write to this field Clears the FIFO without transmitting.
Sourcepub const fn data(&self) -> &DATA
pub const fn data(&self) -> &DATA
0x09 - Data register Each write enqueues a byte to be transmitted; gradually building a single packet to be transmitted. This queue should only ever contain a single packet; it is the software’s responsibility to handle breaking requests down into packets.
Sourcepub const fn ev_enable(&self) -> &EV_ENABLE
pub const fn ev_enable(&self) -> &EV_ENABLE
0x10 - A CSR register. Parameters ––––– fields : :class:dict or :class:list or :class:Field Collection of register fields. If None (default), a dict is populated from Python :term:variable annotations <python:variable annotations>. fields is used to create a :class:FieldActionMap, :class:FieldActionArray, or :class:FieldAction, depending on its type (dict, list, or Field). Interface attributes –––––––––– element : :class:Element Interface between this register and a CSR bus primitive. Attributes ––––– field : :class:FieldActionMap or :class:FieldActionArray or :class:FieldAction Collection of field instances. f : :class:FieldActionMap or :class:FieldActionArray or :class:FieldAction Shorthand for :attr:Register.field. Raises —— :exc:TypeError If fields is neither None, a :class:dict, a :class:list, or a :class:Field. :exc:ValueError If fields is not None and at least one variable annotation is a :class:Field. :exc:ValueError If element.access is not readable and at least one field is readable. :exc:ValueError If element.access is not writable and at least one field is writable.
Sourcepub const fn ev_pending(&self) -> &EV_PENDING
pub const fn ev_pending(&self) -> &EV_PENDING
0x11 - A CSR register. Parameters ––––– fields : :class:dict or :class:list or :class:Field Collection of register fields. If None (default), a dict is populated from Python :term:variable annotations <python:variable annotations>. fields is used to create a :class:FieldActionMap, :class:FieldActionArray, or :class:FieldAction, depending on its type (dict, list, or Field). Interface attributes –––––––––– element : :class:Element Interface between this register and a CSR bus primitive. Attributes ––––– field : :class:FieldActionMap or :class:FieldActionArray or :class:FieldAction Collection of field instances. f : :class:FieldActionMap or :class:FieldActionArray or :class:FieldAction Shorthand for :attr:Register.field. Raises —— :exc:TypeError If fields is neither None, a :class:dict, a :class:list, or a :class:Field. :exc:ValueError If fields is not None and at least one variable annotation is a :class:Field. :exc:ValueError If element.access is not readable and at least one field is readable. :exc:ValueError If element.access is not writable and at least one field is writable.