luna_soc.gateware.core.usb2.ep_out 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_out.Peripheral(*args, src_loc_at=0, **kwargs)[source]

Bases: Component

OUT component of our eptri

Implements the OUT FIFO, which handles receiving packets from our host.

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 0x7f6320b0f920>
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 0x7f632074c500>
class Enable(*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.

enabled: <amaranth_soc.csr.reg.Field object at 0x7f6320b0faa0>
class Endpoint(*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.

number: <amaranth_soc.csr.reg.Field object at 0x7f6320b0f980>
class Pid(*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.

toggle: <amaranth_soc.csr.reg.Field object at 0x7f6320b0fe60>
class Prime(*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.

primed: <amaranth_soc.csr.reg.Field object at 0x7f6320b0fc20>
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 0x7f632074c350>
class Stall(*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.

stalled: <amaranth_soc.csr.reg.Field object at 0x7f6320b0fd40>
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.

epno: <amaranth_soc.csr.reg.Field object at 0x7f6320b0ff80>
have: <amaranth_soc.csr.reg.Field object at 0x7f632074c0e0>
pid: <amaranth_soc.csr.reg.Field object at 0x7f632074c1a0>
__init__(max_packet_size=512)[source]

Parameters

max_packet_size: int, optional

Sets the maximum packet size that can be transmitted on this endpoint. This should match the value provided in the relevant endpoint descriptor.

elaborate(platform)[source]