ChibiOS/HAL 9.0.0
USBDriver Struct Reference

Structure representing an USB driver. More...

#include <hal_usb_lld.h>

Collaboration diagram for USBDriver:
Collaboration graph

Data Fields

usbstate_t state
 Driver state.
const USBConfigconfig
 Current configuration data.
uint16_t transmitting
 Bit map of the transmitting IN endpoints.
uint16_t receiving
 Bit map of the receiving OUT endpoints.
const USBEndpointConfigepc [USB_MAX_ENDPOINTS+1]
 Active endpoints configurations.
void * in_params [USB_MAX_ENDPOINTS]
 Fields available to user, it can be used to associate an application-defined handler to an IN endpoint.
void * out_params [USB_MAX_ENDPOINTS]
 Fields available to user, it can be used to associate an application-defined handler to an OUT endpoint.
usbep0state_t ep0state
 Endpoint 0 state.
uint8_t * ep0next
 Next position in the buffer to be transferred through endpoint 0.
size_t ep0n
 Number of bytes yet to be transferred through endpoint 0.
usbcallback_t ep0endcb
 Endpoint 0 end transaction callback.
uint8_t setup [8]
 Setup packet buffer.
uint16_t status
 Current USB device status.
uint8_t address
 Assigned USB address.
uint8_t configuration
 Current USB device configuration.
usbstate_t saved_state
 State of the driver when a suspend happened.

Detailed Description

Structure representing an USB driver.

Definition at line 217 of file hal_usb_lld.h.

Field Documentation

◆ state

◆ config

const USBConfig* USBDriver::config

Current configuration data.

Definition at line 225 of file hal_usb_lld.h.

Referenced by _usb_ep0setup(), default_handler(), usbObjectInit(), usbStart(), and usbStop().

◆ transmitting

uint16_t USBDriver::transmitting

Bit map of the transmitting IN endpoints.

Definition at line 229 of file hal_usb_lld.h.

Referenced by _usb_reset(), _usb_suspend(), usbDisableEndpointsI(), usbObjectInit(), and usbStartTransmitI().

◆ receiving

uint16_t USBDriver::receiving

Bit map of the receiving OUT endpoints.

Definition at line 233 of file hal_usb_lld.h.

Referenced by _usb_reset(), _usb_suspend(), usbDisableEndpointsI(), usbObjectInit(), and usbStartReceiveI().

◆ epc

◆ in_params

void* USBDriver::in_params[USB_MAX_ENDPOINTS]

Fields available to user, it can be used to associate an application-defined handler to an IN endpoint.

Note
The base index is one, the endpoint zero does not have a reserved element in this array.

Definition at line 244 of file hal_usb_lld.h.

Referenced by sduDataTransmitted(), sduStart(), sduStop(), and usbObjectInit().

◆ out_params

void* USBDriver::out_params[USB_MAX_ENDPOINTS]

Fields available to user, it can be used to associate an application-defined handler to an OUT endpoint.

Note
The base index is one, the endpoint zero does not have a reserved element in this array.

Definition at line 251 of file hal_usb_lld.h.

Referenced by sduDataReceived(), sduStart(), sduStop(), and usbObjectInit().

◆ ep0state

usbep0state_t USBDriver::ep0state

Endpoint 0 state.

Definition at line 255 of file hal_usb_lld.h.

Referenced by _usb_ep0in(), _usb_ep0out(), _usb_ep0setup(), and _usb_reset().

◆ ep0next

uint8_t* USBDriver::ep0next

Next position in the buffer to be transferred through endpoint 0.

Definition at line 259 of file hal_usb_lld.h.

Referenced by _usb_ep0setup().

◆ ep0n

size_t USBDriver::ep0n

Number of bytes yet to be transferred through endpoint 0.

Definition at line 263 of file hal_usb_lld.h.

Referenced by _usb_ep0in(), and _usb_ep0setup().

◆ ep0endcb

usbcallback_t USBDriver::ep0endcb

Endpoint 0 end transaction callback.

Definition at line 267 of file hal_usb_lld.h.

Referenced by _usb_ep0in(), and _usb_ep0out().

◆ setup

uint8_t USBDriver::setup[8]

Setup packet buffer.

Definition at line 271 of file hal_usb_lld.h.

Referenced by _usb_ep0in(), _usb_ep0setup(), default_handler(), sduDataTransmitted(), sduRequestsHook(), and set_address().

◆ status

uint16_t USBDriver::status

Current USB device status.

Definition at line 275 of file hal_usb_lld.h.

Referenced by _usb_reset(), and default_handler().

◆ address

uint8_t USBDriver::address

Assigned USB address.

Definition at line 279 of file hal_usb_lld.h.

Referenced by _usb_reset(), and set_address().

◆ configuration

uint8_t USBDriver::configuration

Current USB device configuration.

Definition at line 283 of file hal_usb_lld.h.

Referenced by _usb_reset(), and default_handler().

◆ saved_state

usbstate_t USBDriver::saved_state

State of the driver when a suspend happened.

Definition at line 287 of file hal_usb_lld.h.

Referenced by _usb_suspend(), and _usb_wakeup().