Mbed OS Reference
|
Public Member Functions | |
virtual void | init (USBPhyEvents *events) |
Initialize this USBPhy instance. More... | |
virtual void | deinit () |
Power down this USBPhy instance. More... | |
virtual bool | powered () |
Check if USB power is present. More... | |
virtual void | connect () |
Make the USB phy visible to the USB host. More... | |
virtual void | disconnect () |
Detach the USB phy. More... | |
virtual void | configure () |
Set this device to the configured state. More... | |
virtual void | unconfigure () |
Leave the configured state. More... | |
virtual void | sof_enable () |
Enable the start of frame interrupt. More... | |
virtual void | sof_disable () |
Disable the start of frame interrupt. More... | |
virtual void | set_address (uint8_t address) |
Set the USBPhy's address. More... | |
virtual void | remote_wakeup () |
Wake upstream devices. More... | |
virtual const usb_ep_table_t * | endpoint_table () |
Get the endpoint table. More... | |
virtual uint32_t | ep0_set_max_packet (uint32_t max_packet) |
Set wMaxPacketSize of endpoint 0. More... | |
virtual void | ep0_setup_read_result (uint8_t *buffer, uint32_t size) |
Read the contents of the SETUP packet. More... | |
virtual void | ep0_read (uint8_t *data, uint32_t size) |
Start receiving a packet of up to wMaxPacketSize on endpoint 0. More... | |
virtual uint32_t | ep0_read_result () |
Read the contents of a received packet. More... | |
virtual void | ep0_write (uint8_t *buffer, uint32_t size) |
Write a packet on endpoint 0. More... | |
virtual void | ep0_stall () |
Protocol stall on endpoint 0. More... | |
virtual bool | endpoint_add (usb_ep_t endpoint, uint32_t max_packet, usb_ep_type_t type) |
Configure and enable an endpoint. More... | |
virtual void | endpoint_remove (usb_ep_t endpoint) |
Disable an endpoint. More... | |
virtual void | endpoint_stall (usb_ep_t endpoint) |
Perform a functional stall on the given endpoint. More... | |
virtual void | endpoint_unstall (usb_ep_t endpoint) |
Un-stall the endpoint. More... | |
virtual bool | endpoint_read (usb_ep_t endpoint, uint8_t *data, uint32_t size) |
Start a read on the given endpoint. More... | |
virtual uint32_t | endpoint_read_result (usb_ep_t endpoint) |
Finish a read on the given endpoint. More... | |
virtual bool | endpoint_write (usb_ep_t endpoint, uint8_t *data, uint32_t size) |
Start a write on the given endpoint. More... | |
virtual void | endpoint_abort (usb_ep_t endpoint) |
Abort the current transfer if it has not yet been sent. More... | |
virtual void | process () |
Callback used for performing USB processing. More... | |
Definition at line 25 of file USBPhyHw.h.
|
virtual |
|
virtual |
|
virtual |
Check if USB power is present.
Devices which don't support checking the USB power state must always return true.
Implements USBPhy.
|
virtual |
Make the USB phy visible to the USB host.
Enable either the D+ or D- pullup so the host can detect the presence of this device.
Implements USBPhy.
|
virtual |
Detach the USB phy.
Disable the D+ and D- pullup and stop responding to USB traffic.
Implements USBPhy.
|
virtual |
Set this device to the configured state.
Enable added endpoints if they are not enabled already.
Implements USBPhy.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Wake upstream devices.
Implements USBPhy.
|
virtual |
Get the endpoint table.
This function returns a table which describes the endpoints can be used, the functionality of those endpoints and the resource cost.
Implements USBPhy.
|
virtual |
Set wMaxPacketSize of endpoint 0.
max_packet | The wMaxPacketSize value for endpoint 0 |
Implements USBPhy.
|
virtual |
Read the contents of the SETUP packet.
buffer | Buffer to fill with data |
size | Size of buffer passed in |
Implements USBPhy.
|
virtual |
Start receiving a packet of up to wMaxPacketSize on endpoint 0.
data | Buffer to fill with the data read |
size | Size of buffer |
Implements USBPhy.
|
virtual |
|
virtual |
Write a packet on endpoint 0.
buffer | Buffer fill with data to send |
size | Size of data to send |
Implements USBPhy.
|
virtual |
Protocol stall on endpoint 0.
Stall all IN and OUT packets on endpoint 0 until a setup packet is received.
Implements USBPhy.
|
virtual |
Configure and enable an endpoint.
endpoint | Endpoint to configure and enable |
max_packet | The maximum packet size that can be sent or received |
type | The type of endpoint this should be configured as - USB_EP_TYPE_BULK, USB_EP_TYPE_INT or USB_EP_TYPE_ISO |
Implements USBPhy.
|
virtual |
|
virtual |
Perform a functional stall on the given endpoint.
Set the HALT feature for this endpoint so that all further communication is aborted.
endpoint | Endpoint to stall |
Implements USBPhy.
|
virtual |
Un-stall the endpoint.
Clear the HALT feature on this endpoint so communication can resume.
endpoint | Endpoint to stall |
Implements USBPhy.
|
virtual |
Start a read on the given endpoint.
endpoint | Endpoint to start the read on |
data | Buffer to fill with data |
size | Size of the read buffer. This must be at least the max packet size for this endpoint. |
Implements USBPhy.
|
virtual |
Finish a read on the given endpoint.
endpoint | Endpoint to check |
Implements USBPhy.
|
virtual |
Start a write on the given endpoint.
endpoint | Endpoint to write to |
data | Buffer to write |
size | Size of data to write |
Implements USBPhy.
|
virtual |
Abort the current transfer if it has not yet been sent.
endpoint | Endpoint to abort the transfer on. It is implementation defined if this function has an effect on receive endpoints. |
Implements USBPhy.
|
virtual |
Callback used for performing USB processing.
USBPhy processing should be triggered by calling USBPhyEvents::start_process and done inside process. All USBPhyEvents callbacks aside from USBPhyEvents::start_process must be called in the context of process
Implements USBPhy.