#include <usb-device.h>
Public Member Functions | |
Device () noexcept | |
Device (const Device &)=delete | |
Device (Device &&)=delete | |
virtual | ~Device () noexcept override |
return_t | abort_transfer (endpoint_t ep_addr) noexcept |
Abort current USB Endpoint transfer. | |
return_t | configure_address (device_address_t dev_addr) noexcept |
Set USB Device Address. | |
return_t | configure_endpoint (endpoint_t ep_addr, Endpoint_type ep_type, packet_size_t ep_max_packet_size) noexcept |
Configure USB Endpoint. | |
return_t | connect (void) noexcept |
Connect USB Device. | |
return_t | disconnect (void) noexcept |
Disconnect USB Device. | |
const device::Capabilities & | get_capabilities (void) noexcept |
Get driver capabilities. | |
frame_number_t | get_frame_number (void) noexcept |
Get current USB Frame Number. | |
device::Status & | get_status (void) noexcept |
Get current USB Device Status. | |
std::size_t | get_transfer_count (endpoint_t ep_addr) noexcept |
Get result of USB Endpoint transfer. | |
const Version & | get_version (void) noexcept |
Get driver version. | |
Device & | operator= (const Device &)=delete |
Device & | operator= (Device &&)=delete |
return_t | power (Power state) noexcept |
Power up/down device. | |
return_t | read_setup_packet (uint8_t *buf) noexcept |
Read setup packet received over Control Endpoint. | |
void | register_device_callback (device::signal_device_event_t cb_func, const void *cb_object=nullptr) noexcept |
Register device event callback. | |
void | register_endpoint_callback (device::signal_endpoint_event_t cb_func, const void *cb_object=nullptr) noexcept |
void | signal_device_event (event_t event) noexcept |
Signal device events. | |
void | signal_endpoint_event (endpoint_t ep_addr, event_t event) noexcept |
Signal USB Endpoint Event. | |
return_t | stall_endpoint (endpoint_t ep_addr, bool stall) noexcept |
Set/Clear Stall for USB Endpoint. | |
return_t | transfer (endpoint_t ep_addr, uint8_t *data, std::size_t num) noexcept |
Read data from or Write data to USB Endpoint. | |
return_t | unconfigure_endpoint (endpoint_t ep_addr) noexcept |
Unconfigure USB Endpoint. | |
return_t | wakeup_remote (void) noexcept |
Trigger USB Remote Wakeup. | |
Protected Member Functions | |
virtual return_t | do_abort_transfer (endpoint_t ep_addr) noexcept=0 |
virtual return_t | do_configure_address (device_address_t dev_addr) noexcept=0 |
virtual return_t | do_configure_endpoint (endpoint_t ep_addr, Endpoint_type ep_type, packet_size_t ep_max_packet_size) noexcept=0 |
virtual return_t | do_connect (void) noexcept=0 |
virtual return_t | do_disconnect (void) noexcept=0 |
virtual const device::Capabilities & | do_get_capabilities (void) noexcept=0 |
virtual frame_number_t | do_get_frame_number (void) noexcept=0 |
virtual device::Status & | do_get_status (void) noexcept=0 |
virtual std::size_t | do_get_transfer_count (endpoint_t ep_addr) noexcept=0 |
virtual const Version & | do_get_version (void) noexcept=0 |
virtual return_t | do_power (Power state) noexcept=0 |
virtual return_t | do_read_setup_packet (uint8_t *buf) noexcept=0 |
virtual return_t | do_stall_endpoint (endpoint_t ep_addr, bool stall) noexcept=0 |
virtual return_t | do_transfer (endpoint_t ep_addr, uint8_t *data, std::size_t num) noexcept=0 |
virtual return_t | do_unconfigure_endpoint (endpoint_t ep_addr) noexcept=0 |
virtual return_t | do_wakeup_remote (void) noexcept=0 |
Protected Attributes | |
device::Status | status_ |
Private Attributes | |
device::signal_device_event_t | cb_device_func_ |
Pointer to static function that implements the device callback. | |
const void * | cb_device_object_ |
Pointer to object instance associated with the device callback. | |
device::signal_endpoint_event_t | cb_endpoint_func_ |
Pointer to static function that implements the endpoint callback. | |
const void * | cb_endpoint_object_ |
Pointer to object instance associated with the endpoint callback. | |
Definition at line 201 of file usb-device.h.
|
noexcept |
Definition at line 39 of file usb-device.cpp.
|
delete |
|
delete |
|
overridevirtualnoexcept |
Definition at line 50 of file usb-device.cpp.
|
inlinenoexcept |
Abort current USB Endpoint transfer.
[in] | ep_addr | Endpoint Address
|
Definition at line 553 of file usb-device.h.
|
inlinenoexcept |
Set USB Device Address.
[in] | dev_addr | Device Address |
Definition at line 516 of file usb-device.h.
|
inlinenoexcept |
Configure USB Endpoint.
[in] | ep_addr | Endpoint Address
|
[in] | ep_type | Endpoint Type (ARM_USB_ENDPOINT_xxx) |
[in] | ep_max_packet_size | Endpoint Maximum Packet Size |
Definition at line 528 of file usb-device.h.
|
inlinenoexcept |
|
inlinenoexcept |
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexceptinherited |
Implemented in os::driver::usart_wrapper, os::driver::usbd_wrapper, and os::driver::usbh_wrapper.
Implemented in os::driver::usart_wrapper, os::driver::usbd_wrapper, and os::driver::usbh_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
protectedpure virtualnoexcept |
Implemented in os::driver::usbd_wrapper.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Get result of USB Endpoint transfer.
[in] | ep_addr | Endpoint Address
|
Definition at line 547 of file usb-device.h.
|
inlinenoexceptinherited |
|
noexcept |
Read setup packet received over Control Endpoint.
[out] | buf | Pointer to buffer for setup packet |
Definition at line 74 of file usb-device.cpp.
|
noexcept |
Register device event callback.
[in] | cb_func | Pointer to function. |
[in] | cb_object | Pointer to object passed to the function. |
Definition at line 56 of file usb-device.cpp.
|
noexcept |
Definition at line 64 of file usb-device.cpp.
|
noexcept |
Signal device events.
[in] | event | Event. |
Definition at line 94 of file usb-device.cpp.
|
noexcept |
Signal USB Endpoint Event.
[in] | ep_addr | Endpoint Address
|
[in] | event | Event. |
Definition at line 104 of file usb-device.cpp.
|
inlinenoexcept |
Set/Clear Stall for USB Endpoint.
[in] | ep_addr | Endpoint Address
|
[in] | stall | Operation
|
Definition at line 541 of file usb-device.h.
|
noexcept |
Read data from or Write data to USB Endpoint.
[in] | ep_addr | Endpoint Address
|
[out] | data | Pointer to buffer for data to read or with data to write |
[in] | num | Number of data bytes to transfer |
Definition at line 81 of file usb-device.cpp.
|
inlinenoexcept |
Unconfigure USB Endpoint.
[in] | ep_addr | Endpoint Address
|
Definition at line 535 of file usb-device.h.
|
inlinenoexcept |
|
private |
Pointer to static function that implements the device callback.
Definition at line 438 of file usb-device.h.
|
private |
Pointer to object instance associated with the device callback.
Definition at line 441 of file usb-device.h.
|
private |
Pointer to static function that implements the endpoint callback.
Definition at line 444 of file usb-device.h.
|
private |
Pointer to object instance associated with the endpoint callback.
Definition at line 447 of file usb-device.h.
|
protected |
Definition at line 451 of file usb-device.h.