embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

Module device

Module device 

Source
Expand description

GUD (Generic USB Display) class implementation.

Class driver for the Linux GUD driver. See https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/gud.

Pixel transfer can be done in a streaming manner: GudClass::read_packet returns one bulk packet and GudClass::read_buffer streams a whole update through a small caller-provided chunk buffer, so total framebuffer size can exceed microcontroller RAM.

Structs§

BufferInfo
Pixel rectangle announced by SET_BUFFER; the target of a streaming read.
Config
Static class driver configuration passed to GudClass::new.
ConnectorState
Current monitor data for one physical connector.
DisplayMode
A display mode (24 bytes on the wire, gud_display_mode_req).
DisplayState
Display state accepted by a SET_STATE_CHECK request.
GudClass
GUD USB display class.
GudConnector
Static connector descriptor.
Property
A property value (10 bytes on the wire, gud_property_req).
State
Internal state for the GUD class. Pass to GudClass::new.

Enums§

ConnectorUpdateError
Error publishing a connector’s current monitor data.
GudEvent
Events delivered to the user task in host request order.
PixelFormat
A pixel format (gud.h GUD_PIXEL_FORMAT_*).
ReadBufferError
Failure receiving a buffer or consuming its pixel data.

Constants§

CONNECTOR_FLAGS_DOUBLESCAN
Connector flag: doublescan modes are supported.
CONNECTOR_FLAGS_INTERLACE
Connector flag: interlaced modes are supported.
CONNECTOR_FLAGS_POLL_STATUS
Connector flag: status can change (host polls it every 10 s).
CONNECTOR_STATUS_CHANGED
Status bit set when the status changed since the last read. Internal.
CONNECTOR_STATUS_CONNECTED
Connector status: display attached.
CONNECTOR_STATUS_CONNECTED_MASK
Mask of the status bits reported in the status byte.
CONNECTOR_STATUS_DISCONNECTED
Connector status: no display attached.
CONNECTOR_STATUS_UNKNOWN
Connector status: attachment unknown.
CONNECTOR_TV_MODE_NAME_LEN
Length of one TV mode name entry.
CONNECTOR_TYPE_COMPONENT
Connector type: component.
CONNECTOR_TYPE_COMPOSITE
Connector type: composite TV out.
CONNECTOR_TYPE_DISPLAYPORT
Connector type: DisplayPort.
CONNECTOR_TYPE_DVI
Connector type: DVI.
CONNECTOR_TYPE_HDMI
Connector type: HDMI.
CONNECTOR_TYPE_PANEL
Connector type: laptop panel.
CONNECTOR_TYPE_SVIDEO
Connector type: S-Video.
CONNECTOR_TYPE_VGA
Connector type: VGA.
DISPLAY_MODE_FLAG_CLKDIV2
Mode flag: clock divided by 2.
DISPLAY_MODE_FLAG_CSYNC
Mode flag: composite sync.
DISPLAY_MODE_FLAG_DBLCLK
Mode flag: double clock mode.
DISPLAY_MODE_FLAG_DBLSCAN
Mode flag: doublescan mode.
DISPLAY_MODE_FLAG_HSKEW
Mode flag: hsync skew.
DISPLAY_MODE_FLAG_INTERLACE
Mode flag: interlaced mode.
DISPLAY_MODE_FLAG_NCSYNC
Mode flag: negative composite sync polarity.
DISPLAY_MODE_FLAG_NHSYNC
Mode flag: negative hsync polarity.
DISPLAY_MODE_FLAG_NVSYNC
Mode flag: negative vsync polarity.
DISPLAY_MODE_FLAG_PCSYNC
Mode flag: positive composite sync polarity.
DISPLAY_MODE_FLAG_PHSYNC
Mode flag: positive hsync polarity.
DISPLAY_MODE_FLAG_PREFERRED
Mode flag: internal protocol flag marking the preferred mode.
DISPLAY_MODE_FLAG_PVSYNC
Mode flag: positive vsync polarity.
DISPLAY_MODE_FLAG_USER_MASK
Mask of mode flag bits defined for user configuration.
GUD_COMPRESSION_LZ4
LZ4 compression bit. This driver advertises no compression.
GUD_CONNECTORS_MAX_NUM
Maximum number of connectors a device may advertise.
GUD_CONNECTOR_PROPERTIES_MAX_NUM
Maximum number of connector properties a device may advertise.
GUD_DISPLAY_MAGIC
Magic value in the display descriptor (gud.h GUD_DISPLAY_MAGIC).
GUD_FORMATS_MAX_NUM
Maximum number of pixel formats a device may advertise.
GUD_PRODUCT_ID
Product ID paired with GUD_VENDOR_ID.
GUD_PROTOCOL_VERSION
GUD protocol version reported in the display descriptor.
GUD_REQ_GET_CONNECTORS
Get connector descriptors (5 bytes each); wValue is the connector index.
GUD_REQ_GET_CONNECTOR_EDID
Get EDID data; wValue is the connector index.
GUD_REQ_GET_CONNECTOR_MODES
Get display modes (24 bytes each); wValue is the connector index.
GUD_REQ_GET_CONNECTOR_PROPERTIES
Get connector properties (10 bytes each); wValue is the connector index.
GUD_REQ_GET_CONNECTOR_STATUS
Get connector status (u8); wValue is the connector index.
GUD_REQ_GET_CONNECTOR_TV_MODE_VALUES
Get TV mode names (16 bytes each); wValue is the connector index.
GUD_REQ_GET_DESCRIPTOR
Get display descriptor (30 bytes).
GUD_REQ_GET_FORMATS
Get supported pixel formats as a byte array of GUD_PIXEL_FORMAT_*.
GUD_REQ_GET_PROPERTIES
Get non-connector properties (currently only PROPERTY_ROTATION).
GUD_REQ_GET_STATUS
Get status from the last GUD control request. Value is u8.
GUD_REQ_SET_BUFFER
Set buffer transfer info (25 bytes) right before a bulk OUT transfer.
GUD_REQ_SET_CONNECTOR_FORCE_DETECT
Issued when userspace checks connector status; wValue is the connector index.
GUD_REQ_SET_CONTROLLER_ENABLE
Enable/disable the display controller. Value is u8: 0/1.
GUD_REQ_SET_DISPLAY_ENABLE
Enable/disable display/output (DPMS). Value is u8: 0/1.
GUD_REQ_SET_STATE_CHECK
Check display configuration (mode + format + connector + properties).
GUD_REQ_SET_STATE_COMMIT
Apply the previously checked display configuration.
GUD_STATUS_BUSY
Result of the last GUD request: device busy, host should retry.
GUD_STATUS_ERROR
Result of the last GUD request: generic error.
GUD_STATUS_INVALID_PARAMETER
Result of the last GUD request: a parameter was invalid.
GUD_STATUS_OK
Result of the last GUD request: ok.
GUD_STATUS_PROTOCOL_ERROR
Result of the last GUD request: malformed request.
GUD_STATUS_REQUEST_NOT_SUPPORTED
Result of the last GUD request: the request is not supported.
GUD_VENDOR_ID
Vendor ID to use for the device so that the Linux GUD driver binds to it.
MAX_PROPERTIES
Maximum number of properties stored from a SET_STATE_CHECK request.
PROPERTY_BACKLIGHT_BRIGHTNESS
Property: backlight brightness percent, range 0-100.
PROPERTY_ROTATION
Non-connector property id: plane rotation (ROTATION_* bitmask).
PROPERTY_TV_BOTTOM_MARGIN
Property: bottom margin in pixels for overscan, range 0-100.
PROPERTY_TV_BRIGHTNESS
Property: brightness percent, range 0-100.
PROPERTY_TV_CONTRAST
Property: contrast percent, range 0-100.
PROPERTY_TV_FLICKER_REDUCTION
Property: flicker reduction percent, range 0-100.
PROPERTY_TV_HUE
Property: hue percent, range 0-100.
PROPERTY_TV_LEFT_MARGIN
Property: left margin in pixels for overscan, range 0-100.
PROPERTY_TV_MODE
Property: TV mode selector (index into tv_mode_values).
PROPERTY_TV_OVERSCAN
Property: overscan percent, range 0-100.
PROPERTY_TV_RIGHT_MARGIN
Property: right margin in pixels for overscan, range 0-100.
PROPERTY_TV_SATURATION
Property: saturation percent, range 0-100.
PROPERTY_TV_TOP_MARGIN
Property: top margin in pixels for overscan, range 0-100.
ROTATION_0
Rotation property bit: 0 degrees.
ROTATION_90
Rotation property bit: 90 degrees.
ROTATION_180
Rotation property bit: 180 degrees.
ROTATION_270
Rotation property bit: 270 degrees.
ROTATION_MASK
Mask of all rotation property bits.
ROTATION_REFLECT_X
Rotation property bit: horizontal reflection.
ROTATION_REFLECT_Y
Rotation property bit: vertical reflection.