USB APIs
Note
USB is not available within M4 programs.
USB device
-
namespace
coralmicro
-
class
UsbDeviceTask
¶ - #include <usb_device_task.h>
Operates the Dev Board Micro as a USB device.
Public Functions
-
UsbDeviceTask
()¶
-
UsbDeviceTask
(const UsbDeviceTask&) = delete¶
-
UsbDeviceTask &
operator=
(const UsbDeviceTask&) = delete¶
-
void
AddDevice
(const usb_device_class_config_struct_t &config, UsbSetHandleCallback sh_cb, UsbHandleEventCallback he_cb, const void *descriptor_data, size_t descriptor_data_size)¶
-
void
UsbDeviceTaskFn
()¶
-
inline uint8_t
next_descriptor_value
()¶
-
inline uint8_t
next_interface_value
()¶
-
inline usb_device_handle
device_handle
() const¶
Public Static Functions
-
static inline UsbDeviceTask *
GetSingleton
()¶
-
-
class
USB host
-
namespace
coralmicro
-
class
UsbHostTask
¶ - #include <usb_host_task.h>
Operates the Dev Board Micro as a USB host.
Public Functions
-
UsbHostTask
()¶
-
UsbHostTask
(const UsbHostTask&) = delete¶
-
UsbHostTask &
operator=
(const UsbHostTask&) = delete¶
-
void
RegisterUsbHostEventCallback
(uint32_t vid, uint32_t pid, UsbHostEventCallback fn)¶
-
usb_status_t
HostEvent
(usb_device_handle device_handle, usb_host_configuration_handle config_handle, uint32_t event_code)¶
-
inline usb_host_handle
host_handle
() const¶
Public Static Functions
-
static inline UsbHostTask *
GetSingleton
()¶
Public Types
-
using
UsbHostEventCallback
= std::function<usb_status_t(usb_host_handle, usb_device_handle, usb_host_configuration_handle, uint32_t)>¶
-
-
class
USB host communication (CDC-ACM)
-
namespace
coralmicro
-
class
CdcAcm
¶ - #include <cdc_acm.h>
Public Functions
-
CdcAcm
() = default¶
-
void
Init
(uint8_t interrupt_in_ep, uint8_t bulk_in_ep, uint8_t bulk_out_ep, uint8_t comm_iface, uint8_t data_iface, RxHandler rx_handler)¶
-
inline const usb_device_class_config_struct_t &
config_data
() const¶
-
inline const void *
descriptor_data
() const¶
-
inline size_t
descriptor_data_size
() const¶
-
inline void
SetClassHandle
(class_handle_t class_handle)¶ TODO(atv): Make me private.
-
bool
HandleEvent
(uint32_t event, void *param)¶
-
bool
Transmit
(const uint8_t *buffer, const size_t length)¶
Public Types
-
using
RxHandler
= std::function<void(const uint8_t*, const uint32_t)>¶
-
-
class
-
struct
_usb_host_cdc_line_coding_struct
¶ - #include <cdc_acm.h>
Functions
-
struct _usb_host_cdc_line_coding_struct __attribute__ ((packed)) usb_host_cdc_line_coding_struct_t
USB Ethernet emulation (CDC-EEM)
-
namespace
coralmicro
-
class
CdcEem
¶ - #include <cdc_eem.h>
Public Functions
-
CdcEem
() = default¶
-
void
Init
(uint8_t bulk_in_ep, uint8_t bulk_out_ep, uint8_t data_iface)¶
-
inline const usb_device_class_config_struct_t &
config_data
() const¶
-
inline const void *
descriptor_data
() const¶
-
inline size_t
descriptor_data_size
() const¶
-
inline void
SetClassHandle
(class_handle_t class_handle)¶
-
bool
HandleEvent
(uint32_t event, void *param)¶
-
-
class
Is this content helpful?