luna_soc.gateware.core.usb2.ep_control module

Implementation of a Triple-FIFO endpoint manager.

Equivalent (but not binary-compatbile) implementation of ValentyUSB’s eptri.

For an example, see examples/usb/eptri or TinyUSB’s luna/dcd_eptri.c.

class luna_soc.gateware.core.usb2.ep_control.Peripheral(*args, src_loc_at=0, **kwargs)[source]

Bases: Component

Setup component of our eptri-equivalent interface.

Implements the USB Setup FIFO, which handles SETUP packets on any endpoint.

This interface is similar to an OutFIFOInterface, but always ACKs packets, and does not allow for any flow control; as a USB device must always be ready to accept control packets. [USB2.0: 8.6.1]

Attributes

interface: EndpointInterface

Our primary interface to the core USB device hardware.

class Control(*args, src_loc_at=0, **kwargs)[source]

Bases: Register

A CSR register.

Parameters

fieldsdict or list or Field

Collection of register fields. If None (default), a dict is populated from Python variable annotations. fields is used to create a FieldActionMap, FieldActionArray, or FieldAction, depending on its type (dict, list, or Field).

Interface attributes

elementElement

Interface between this register and a CSR bus primitive.

Attributes

fieldFieldActionMap or FieldActionArray or FieldAction

Collection of field instances.

fFieldActionMap or FieldActionArray or FieldAction

Shorthand for Register.field.

Raises

TypeError

If fields is neither None, a dict, a list, or a Field.

ValueError

If fields is not None and at least one variable annotation is a Field.

ValueError

If element.access is not readable and at least one field is readable.

ValueError

If element.access is not writable and at least one field is writable.

address: <amaranth_soc.csr.reg.Field object at 0x7f6320b0e900>
class Data(*args, src_loc_at=0, **kwargs)[source]

Bases: Register

A CSR register.

Parameters

fieldsdict or list or Field

Collection of register fields. If None (default), a dict is populated from Python variable annotations. fields is used to create a FieldActionMap, FieldActionArray, or FieldAction, depending on its type (dict, list, or Field).

Interface attributes

elementElement

Interface between this register and a CSR bus primitive.

Attributes

fieldFieldActionMap or FieldActionArray or FieldAction

Collection of field instances.

fFieldActionMap or FieldActionArray or FieldAction

Shorthand for Register.field.

Raises

TypeError

If fields is neither None, a dict, a list, or a Field.

ValueError

If fields is not None and at least one variable annotation is a Field.

ValueError

If element.access is not readable and at least one field is readable.

ValueError

If element.access is not writable and at least one field is writable.

byte: <amaranth_soc.csr.reg.Field object at 0x7f6320b0ecf0>
class Reset(*args, src_loc_at=0, **kwargs)[source]

Bases: Register

A CSR register.

Parameters

fieldsdict or list or Field

Collection of register fields. If None (default), a dict is populated from Python variable annotations. fields is used to create a FieldActionMap, FieldActionArray, or FieldAction, depending on its type (dict, list, or Field).

Interface attributes

elementElement

Interface between this register and a CSR bus primitive.

Attributes

fieldFieldActionMap or FieldActionArray or FieldAction

Collection of field instances.

fFieldActionMap or FieldActionArray or FieldAction

Shorthand for Register.field.

Raises

TypeError

If fields is neither None, a dict, a list, or a Field.

ValueError

If fields is not None and at least one variable annotation is a Field.

ValueError

If element.access is not readable and at least one field is readable.

ValueError

If element.access is not writable and at least one field is writable.

fifo: <amaranth_soc.csr.reg.Field object at 0x7f6320b0ebd0>
class Status(*args, src_loc_at=0, **kwargs)[source]

Bases: Register

A CSR register.

Parameters

fieldsdict or list or Field

Collection of register fields. If None (default), a dict is populated from Python variable annotations. fields is used to create a FieldActionMap, FieldActionArray, or FieldAction, depending on its type (dict, list, or Field).

Interface attributes

elementElement

Interface between this register and a CSR bus primitive.

Attributes

fieldFieldActionMap or FieldActionArray or FieldAction

Collection of field instances.

fFieldActionMap or FieldActionArray or FieldAction

Shorthand for Register.field.

Raises

TypeError

If fields is neither None, a dict, a list, or a Field.

ValueError

If fields is not None and at least one variable annotation is a Field.

ValueError

If element.access is not readable and at least one field is readable.

ValueError

If element.access is not writable and at least one field is writable.

address: <amaranth_soc.csr.reg.Field object at 0x7f6320b0e990>
epno: <amaranth_soc.csr.reg.Field object at 0x7f6320b0ea50>
have: <amaranth_soc.csr.reg.Field object at 0x7f6320b0eab0>
elaborate(platform)[source]