Modules | Classes | Macros | Typedefs | Enumerations | Functions | Variables
USB Device Driver (UDD)
Collaboration diagram for USB Device Driver (UDD):

Modules

 USB High-Speed Port for device mode (USBHS)
 

Classes

struct  udd_ctrl_request_t
 Global variable to give and record information of the setup request management. More...
 

Macros

#define Udd_setup_is_in()   (USB_REQ_DIR_IN == (udd_g_ctrlreq.req.bmRequestType & USB_REQ_DIR_MASK))
 Return true if the setup request udd_g_ctrlreq indicates IN data transfer. More...
 
#define Udd_setup_is_out()   (USB_REQ_DIR_OUT == (udd_g_ctrlreq.req.bmRequestType & USB_REQ_DIR_MASK))
 Return true if the setup request udd_g_ctrlreq indicates OUT data transfer. More...
 
#define Udd_setup_recipient()   (udd_g_ctrlreq.req.bmRequestType & USB_REQ_RECIP_MASK)
 Return the recipient of the SETUP request udd_g_ctrlreq. More...
 
#define Udd_setup_type()   (udd_g_ctrlreq.req.bmRequestType & USB_REQ_TYPE_MASK)
 Return the type of the SETUP request udd_g_ctrlreq. More...
 

Typedefs

typedef void(* udd_callback_halt_cleared_t) (void)
 End of halt callback function type. Registered by routine udd_ep_wait_stall_clear() Callback called when endpoint stall is cleared. More...
 
typedef void(* udd_callback_trans_t) (udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep)
 End of transfer callback function type. Registered by routine udd_ep_run() Callback called by USB interrupt after data transfer or abort (reset,...). More...
 
typedef uint8_t udd_ep_id_t
 Endpoint identifier. More...
 

Enumerations

enum  udd_ep_status_t { UDD_EP_TRANSFER_OK = 0, UDD_EP_TRANSFER_ABORT = 1 }
 Endpoint transfer status Returned in parameters of callback register via udd_ep_run routine. More...
 

Functions

void udd_attach (void)
 Attach device to the bus when possible. More...
 
void udd_detach (void)
 Detaches the device from the bus. More...
 
void udd_disable (void)
 Disables the USB Device mode. More...
 
void udd_enable (void)
 Enables the USB Device mode. More...
 
uint16_t udd_get_frame_number (void)
 Returns the current start of frame number. More...
 
uint16_t udd_get_micro_frame_number (void)
 Returns the current micro start of frame number. More...
 
uint8_t udd_getaddress (void)
 Returns the USB address of device. More...
 
bool udd_include_vbus_monitoring (void)
 Authorizes the VBUS event. More...
 
bool udd_is_high_speed (void)
 Test whether the USB Device Controller is running at high speed or not. More...
 
void udd_send_remotewakeup (void)
 The USB driver sends a resume signal called Upstream Resume. More...
 
void udd_set_address (uint8_t address)
 Changes the USB address of device. More...
 
void udd_set_setup_payload (uint8_t *payload, uint16_t payload_size)
 Load setup payload. More...
 

Variables

udd_ctrl_request_t udd_g_ctrlreq
 Global variable to give and record information about setup request management. More...
 

High speed test mode management

The following functions allow the device to jump to a specific test mode required in high speed mode.

void udd_test_mode_j (void)
 
void udd_test_mode_k (void)
 
void udd_test_mode_se0_nak (void)
 
void udd_test_mode_packet (void)
 

UDC callbacks to provide for UDD

The following callbacks are used by UDD.

bool udc_process_setup (void)
 Decodes and manages a setup request. More...
 
void udc_reset (void)
 Reset the UDC. More...
 
void udc_sof_notify (void)
 To signal that a SOF is occurred. More...
 

Detailed Description

The UDD driver provides a low-level abstraction of the device controller hardware. Most events coming from the hardware such as interrupts, which may cause the UDD to call into the UDC and UDI.

Macro Definition Documentation

◆ Udd_setup_is_in

#define Udd_setup_is_in ( )    (USB_REQ_DIR_IN == (udd_g_ctrlreq.req.bmRequestType & USB_REQ_DIR_MASK))

Return true if the setup request udd_g_ctrlreq indicates IN data transfer.

Definition at line 96 of file udd.h.

◆ Udd_setup_is_out

#define Udd_setup_is_out ( )    (USB_REQ_DIR_OUT == (udd_g_ctrlreq.req.bmRequestType & USB_REQ_DIR_MASK))

Return true if the setup request udd_g_ctrlreq indicates OUT data transfer.

Definition at line 100 of file udd.h.

◆ Udd_setup_recipient

#define Udd_setup_recipient ( )    (udd_g_ctrlreq.req.bmRequestType & USB_REQ_RECIP_MASK)

Return the recipient of the SETUP request udd_g_ctrlreq.

See also
usb_recipient

Definition at line 108 of file udd.h.

◆ Udd_setup_type

#define Udd_setup_type ( )    (udd_g_ctrlreq.req.bmRequestType & USB_REQ_TYPE_MASK)

Return the type of the SETUP request udd_g_ctrlreq.

See also
usb_reqtype.

Definition at line 104 of file udd.h.

Typedef Documentation

◆ udd_callback_halt_cleared_t

typedef void(* udd_callback_halt_cleared_t) (void)

End of halt callback function type. Registered by routine udd_ep_wait_stall_clear() Callback called when endpoint stall is cleared.

Definition at line 116 of file udd.h.

◆ udd_callback_trans_t

typedef void(* udd_callback_trans_t) (udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep)

End of transfer callback function type. Registered by routine udd_ep_run() Callback called by USB interrupt after data transfer or abort (reset,...).

Parameters
statusUDD_EP_TRANSFER_OK, if transfer is complete
statusUDD_EP_TRANSFER_ABORT, if transfer is aborted
nnumber of data transfered

Definition at line 127 of file udd.h.

◆ udd_ep_id_t

typedef uint8_t udd_ep_id_t

Endpoint identifier.

Definition at line 59 of file udd.h.

Enumeration Type Documentation

◆ udd_ep_status_t

Endpoint transfer status Returned in parameters of callback register via udd_ep_run routine.

Enumerator
UDD_EP_TRANSFER_OK 
UDD_EP_TRANSFER_ABORT 

Definition at line 63 of file udd.h.

Function Documentation

◆ udc_process_setup()

bool udc_process_setup ( void  )

Decodes and manages a setup request.

The driver call it when a SETUP packet is received. The udd_g_ctrlreq contains the data of SETUP packet. If this callback accepts the setup request then it must return 1 and eventually update udd_g_ctrlreq to send or receive data.

Returns
1 if the request is accepted, otherwise 0.

Decodes and manages a setup request.

This function parses a USB SETUP request and submits an appropriate response back to the host or, in the case of SETUP OUT requests with data, sets up a buffer for receiving the data payload.

The main standard requests defined by the USB 2.0 standard are handled internally. The interface requests are sent to UDI, and the specific request sent to a specific application callback.

Returns
true if the request is supported, else the request is stalled by UDD

Definition at line 1092 of file udc.c.

◆ udc_reset()

void udc_reset ( void  )

Reset the UDC.

The UDC must reset all configuration.

Reset the UDC.

Definition at line 368 of file udc.c.

◆ udc_sof_notify()

void udc_sof_notify ( void  )

To signal that a SOF is occurred.

The UDC must send the signal to all UDIs enabled

Definition at line 395 of file udc.c.

◆ udd_attach()

void udd_attach ( void  )

Attach device to the bus when possible.

Warning
If a VBus control is included in driver, then it will attach device when an acceptable Vbus level from the host is detected.

Definition at line 898 of file usbhs_device.c.

◆ udd_detach()

void udd_detach ( void  )

Detaches the device from the bus.

The driver must remove pull-up on USB line D- or D+.

Definition at line 939 of file usbhs_device.c.

◆ udd_disable()

void udd_disable ( void  )

Disables the USB Device mode.

Definition at line 858 of file usbhs_device.c.

◆ udd_enable()

void udd_enable ( void  )

Enables the USB Device mode.

Definition at line 764 of file usbhs_device.c.

◆ udd_get_frame_number()

uint16_t udd_get_frame_number ( void  )

Returns the current start of frame number.

Returns
current start of frame number.

Definition at line 974 of file usbhs_device.c.

◆ udd_get_micro_frame_number()

uint16_t udd_get_micro_frame_number ( void  )

Returns the current micro start of frame number.

Returns
current micro start of frame number required in high speed mode.

Definition at line 979 of file usbhs_device.c.

◆ udd_getaddress()

uint8_t udd_getaddress ( void  )

Returns the USB address of device.

Returns
USB address

Definition at line 968 of file usbhs_device.c.

◆ udd_include_vbus_monitoring()

bool udd_include_vbus_monitoring ( void  )

Authorizes the VBUS event.

Returns
true, if the VBUS monitoring is possible.

Definition at line 754 of file usbhs_device.c.

◆ udd_is_high_speed()

bool udd_is_high_speed ( void  )

Test whether the USB Device Controller is running at high speed or not.

Returns
true if the Device is running at high speed mode, otherwise false.

Definition at line 950 of file usbhs_device.c.

◆ udd_send_remotewakeup()

void udd_send_remotewakeup ( void  )

The USB driver sends a resume signal called Upstream Resume.

Definition at line 984 of file usbhs_device.c.

◆ udd_set_address()

void udd_set_address ( uint8_t  address)

Changes the USB address of device.

Parameters
addressNew USB address

Definition at line 960 of file usbhs_device.c.

◆ udd_set_setup_payload()

void udd_set_setup_payload ( uint8_t *  payload,
uint16_t  payload_size 
)

Load setup payload.

Parameters
payloadPointer on payload
payload_sizeSize of payload

Definition at line 997 of file usbhs_device.c.

◆ udd_test_mode_j()

void udd_test_mode_j ( void  )

◆ udd_test_mode_k()

void udd_test_mode_k ( void  )

◆ udd_test_mode_packet()

void udd_test_mode_packet ( void  )

◆ udd_test_mode_se0_nak()

void udd_test_mode_se0_nak ( void  )

Variable Documentation

◆ udd_g_ctrlreq

udd_ctrl_request_t udd_g_ctrlreq

Global variable to give and record information about setup request management.

Definition at line 459 of file usbhs_device.c.



inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:07