µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::driver::usbd_wrapper Class Reference

#include <usbd-wrapper.h>

+ Inheritance diagram for os::driver::usbd_wrapper:

Public Member Functions

 usbd_wrapper (ARM_DRIVER_USBD *driver, ARM_USBD_SignalDeviceEvent_t c_cb_device_func, ARM_USBD_SignalEndpointEvent_t c_cb_endpoint_func) noexcept
 
 usbd_wrapper (const usbd_wrapper &)=delete
 
 usbd_wrapper (usbd_wrapper &&)=delete
 
virtual ~usbd_wrapper () noexcept
 
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 Versionget_version (void) noexcept
 Get driver version.
 
usbd_wrapperoperator= (const usbd_wrapper &)=delete
 
usbd_wrapperoperator= (usbd_wrapper &&)=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 (usb::endpoint_t ep_addr) noexcept override
 
virtual return_t do_configure_address (usb::device_address_t dev_addr) noexcept override
 
virtual return_t do_configure_endpoint (usb::endpoint_t ep_addr, usb::Endpoint_type ep_type, usb::packet_size_t ep_max_packet_size) noexcept override
 
virtual return_t do_connect (void) noexcept override
 
virtual return_t do_disconnect (void) noexcept override
 
const usb::device::Capabilitiesdo_get_capabilities (void) noexcept override
 
virtual usb::frame_number_t do_get_frame_number (void) noexcept override
 
virtual usb::device::Statusdo_get_status (void) noexcept override
 
virtual std::size_t do_get_transfer_count (usb::endpoint_t ep_addr) noexcept override
 
virtual const Versiondo_get_version (void) noexcept override
 
virtual return_t do_power (Power state) noexcept override
 
virtual return_t do_read_setup_packet (uint8_t *buf) noexcept override
 
virtual return_t do_stall_endpoint (usb::endpoint_t ep_addr, bool stall) noexcept override
 
virtual return_t do_transfer (usb::endpoint_t ep_addr, uint8_t *data, std::size_t num) noexcept override
 
virtual return_t do_unconfigure_endpoint (usb::endpoint_t ep_addr) noexcept override
 
virtual return_t do_wakeup_remote (void) noexcept override
 

Private Attributes

ARM_USBD_SignalDeviceEvent_t c_cb_device_func_
 
ARM_USBD_SignalEndpointEvent_t c_cb_endpoint_func_
 
usb::device::Capabilities capa_
 
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.
 
ARM_DRIVER_USBDdriver_
 Pointer to CMSIS USBD Keil driver.
 
usb::device::Status status_
 
Version version_ { 0, 0 }
 

Detailed Description

Definition at line 47 of file usbd-wrapper.h.

Constructor & Destructor Documentation

◆ usbd_wrapper() [1/3]

os::driver::usbd_wrapper::usbd_wrapper ( ARM_DRIVER_USBD driver,
ARM_USBD_SignalDeviceEvent_t  c_cb_device_func,
ARM_USBD_SignalEndpointEvent_t  c_cb_endpoint_func 
)
noexcept

Definition at line 29 of file usbd-wrapper.cpp.

◆ usbd_wrapper() [2/3]

os::driver::usbd_wrapper::usbd_wrapper ( const usbd_wrapper )
delete

◆ usbd_wrapper() [3/3]

os::driver::usbd_wrapper::usbd_wrapper ( usbd_wrapper &&  )
delete

◆ ~usbd_wrapper()

os::driver::usbd_wrapper::~usbd_wrapper ( )
virtualnoexcept

Definition at line 39 of file usbd-wrapper.cpp.

Member Function Documentation

◆ abort_transfer()

return_t os::driver::usb::Device::abort_transfer ( endpoint_t  ep_addr)
inlinenoexceptinherited

Abort current USB Endpoint transfer.

Parameters
[in]ep_addrEndpoint Address
  • ep_addr.0..3: Address
  • ep_addr.7: Direction
Returns
Execution status.

Definition at line 553 of file usb-device.h.

◆ configure_address()

return_t os::driver::usb::Device::configure_address ( device_address_t  dev_addr)
inlinenoexceptinherited

Set USB Device Address.

Parameters
[in]dev_addrDevice Address
Returns
Execution status.

Definition at line 516 of file usb-device.h.

◆ configure_endpoint()

return_t os::driver::usb::Device::configure_endpoint ( endpoint_t  ep_addr,
Endpoint_type  ep_type,
packet_size_t  ep_max_packet_size 
)
inlinenoexceptinherited

Configure USB Endpoint.

Parameters
[in]ep_addrEndpoint Address
  • ep_addr.0..3: Address
  • ep_addr.7: Direction
[in]ep_typeEndpoint Type (ARM_USB_ENDPOINT_xxx)
[in]ep_max_packet_sizeEndpoint Maximum Packet Size
Returns
Execution status.

Definition at line 528 of file usb-device.h.

◆ connect()

return_t os::driver::usb::Device::connect ( void  )
inlinenoexceptinherited

Connect USB Device.

Returns
Execution status.

Definition at line 498 of file usb-device.h.

◆ disconnect()

return_t os::driver::usb::Device::disconnect ( void  )
inlinenoexceptinherited

Disconnect USB Device.

Returns
Execution status.

Definition at line 504 of file usb-device.h.

◆ do_abort_transfer()

return_t os::driver::usbd_wrapper::do_abort_transfer ( usb::endpoint_t  ep_addr)
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 183 of file usbd-wrapper.cpp.

◆ do_configure_address()

return_t os::driver::usbd_wrapper::do_configure_address ( usb::device_address_t  dev_addr)
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 129 of file usbd-wrapper.cpp.

◆ do_configure_endpoint()

return_t os::driver::usbd_wrapper::do_configure_endpoint ( usb::endpoint_t  ep_addr,
usb::Endpoint_type  ep_type,
usb::packet_size_t  ep_max_packet_size 
)
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 147 of file usbd-wrapper.cpp.

◆ do_connect()

return_t os::driver::usbd_wrapper::do_connect ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 111 of file usbd-wrapper.cpp.

◆ do_disconnect()

return_t os::driver::usbd_wrapper::do_disconnect ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 117 of file usbd-wrapper.cpp.

◆ do_get_capabilities()

const usb::device::Capabilities & os::driver::usbd_wrapper::do_get_capabilities ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 65 of file usbd-wrapper.cpp.

◆ do_get_frame_number()

usb::frame_number_t os::driver::usbd_wrapper::do_get_frame_number ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 141 of file usbd-wrapper.cpp.

◆ do_get_status()

usb::device::Status & os::driver::usbd_wrapper::do_get_status ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 74 of file usbd-wrapper.cpp.

◆ do_get_transfer_count()

std::size_t os::driver::usbd_wrapper::do_get_transfer_count ( usb::endpoint_t  ep_addr)
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 177 of file usbd-wrapper.cpp.

◆ do_get_version()

const Version & os::driver::usbd_wrapper::do_get_version ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::Base.

Definition at line 56 of file usbd-wrapper.cpp.

◆ do_power()

return_t os::driver::usbd_wrapper::do_power ( Power  state)
overrideprotectedvirtualnoexcept

Implements os::driver::Base.

Definition at line 85 of file usbd-wrapper.cpp.

◆ do_read_setup_packet()

return_t os::driver::usbd_wrapper::do_read_setup_packet ( uint8_t *  buf)
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 135 of file usbd-wrapper.cpp.

◆ do_stall_endpoint()

return_t os::driver::usbd_wrapper::do_stall_endpoint ( usb::endpoint_t  ep_addr,
bool  stall 
)
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 163 of file usbd-wrapper.cpp.

◆ do_transfer()

return_t os::driver::usbd_wrapper::do_transfer ( usb::endpoint_t  ep_addr,
uint8_t *  data,
std::size_t  num 
)
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 169 of file usbd-wrapper.cpp.

◆ do_unconfigure_endpoint()

return_t os::driver::usbd_wrapper::do_unconfigure_endpoint ( usb::endpoint_t  ep_addr)
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 157 of file usbd-wrapper.cpp.

◆ do_wakeup_remote()

return_t os::driver::usbd_wrapper::do_wakeup_remote ( void  )
overrideprotectedvirtualnoexcept

Implements os::driver::usb::Device.

Definition at line 123 of file usbd-wrapper.cpp.

◆ get_capabilities()

const device::Capabilities & os::driver::usb::Device::get_capabilities ( void  )
inlinenoexceptinherited

Get driver capabilities.

Returns
Capabilities.

Definition at line 486 of file usb-device.h.

◆ get_frame_number()

frame_number_t os::driver::usb::Device::get_frame_number ( void  )
inlinenoexceptinherited

Get current USB Frame Number.

Returns
Frame Number

Definition at line 522 of file usb-device.h.

◆ get_status()

device::Status & os::driver::usb::Device::get_status ( void  )
inlinenoexceptinherited

Get current USB Device Status.

Returns
Device State.

Definition at line 492 of file usb-device.h.

◆ get_transfer_count()

std::size_t os::driver::usb::Device::get_transfer_count ( endpoint_t  ep_addr)
inlinenoexceptinherited

Get result of USB Endpoint transfer.

Parameters
[in]ep_addrEndpoint Address
  • ep_addr.0..3: Address
  • ep_addr.7: Direction
Returns
number of successfully transferred data bytes

Definition at line 547 of file usb-device.h.

◆ get_version()

const Version & os::driver::Base::get_version ( void  )
inlinenoexceptinherited

Get driver version.

Returns
Version.

Definition at line 195 of file common.h.

◆ operator=() [1/2]

usbd_wrapper & os::driver::usbd_wrapper::operator= ( const usbd_wrapper )
delete

◆ operator=() [2/2]

usbd_wrapper & os::driver::usbd_wrapper::operator= ( usbd_wrapper &&  )
delete

◆ power()

return_t os::driver::Base::power ( Power  state)
inlinenoexceptinherited

Power up/down device.

Parameters
[in]statePower state
Returns
Execution status

Definition at line 201 of file common.h.

◆ read_setup_packet()

return_t os::driver::usb::Device::read_setup_packet ( uint8_t *  buf)
noexceptinherited

Read setup packet received over Control Endpoint.

Parameters
[out]bufPointer to buffer for setup packet
Returns
Execution status.

Definition at line 74 of file usb-device.cpp.

◆ register_device_callback()

void os::driver::usb::Device::register_device_callback ( device::signal_device_event_t  cb_func,
const void *  cb_object = nullptr 
)
noexceptinherited

Register device event callback.

Parameters
[in]cb_funcPointer to function.
[in]cb_objectPointer to object passed to the function.
Returns
Nothing.

Definition at line 56 of file usb-device.cpp.

◆ register_endpoint_callback()

void os::driver::usb::Device::register_endpoint_callback ( device::signal_endpoint_event_t  cb_func,
const void *  cb_object = nullptr 
)
noexceptinherited

Definition at line 64 of file usb-device.cpp.

◆ signal_device_event()

void os::driver::usb::Device::signal_device_event ( event_t  event)
noexceptinherited

Signal device events.

Parameters
[in]eventEvent.
Returns
Nothing.

Definition at line 94 of file usb-device.cpp.

◆ signal_endpoint_event()

void os::driver::usb::Device::signal_endpoint_event ( endpoint_t  ep_addr,
event_t  event 
)
noexceptinherited

Signal USB Endpoint Event.

Parameters
[in]ep_addrEndpoint Address
  • ep_addr.0..3: Address
  • ep_addr.7: Direction
[in]eventEvent.
Returns
Nothing.

Definition at line 104 of file usb-device.cpp.

◆ stall_endpoint()

return_t os::driver::usb::Device::stall_endpoint ( endpoint_t  ep_addr,
bool  stall 
)
inlinenoexceptinherited

Set/Clear Stall for USB Endpoint.

Parameters
[in]ep_addrEndpoint Address
  • ep_addr.0..3: Address
  • ep_addr.7: Direction
[in]stallOperation
  • false Clear
  • true Set
Returns
Execution status.

Definition at line 541 of file usb-device.h.

◆ transfer()

return_t os::driver::usb::Device::transfer ( endpoint_t  ep_addr,
uint8_t *  data,
std::size_t  num 
)
noexceptinherited

Read data from or Write data to USB Endpoint.

Parameters
[in]ep_addrEndpoint Address
  • ep_addr.0..3: Address
  • ep_addr.7: Direction
[out]dataPointer to buffer for data to read or with data to write
[in]numNumber of data bytes to transfer
Returns
Execution status.

Definition at line 81 of file usb-device.cpp.

◆ unconfigure_endpoint()

return_t os::driver::usb::Device::unconfigure_endpoint ( endpoint_t  ep_addr)
inlinenoexceptinherited

Unconfigure USB Endpoint.

Parameters
[in]ep_addrEndpoint Address
  • ep_addr.0..3: Address
  • ep_addr.7: Direction
Returns
Execution status.

Definition at line 535 of file usb-device.h.

◆ wakeup_remote()

return_t os::driver::usb::Device::wakeup_remote ( void  )
inlinenoexceptinherited

Trigger USB Remote Wakeup.

Returns
Execution status.

Definition at line 510 of file usb-device.h.

Member Data Documentation

◆ c_cb_device_func_

ARM_USBD_SignalDeviceEvent_t os::driver::usbd_wrapper::c_cb_device_func_
private

Pointer to non-reentrant callback. Must be stored because Initialize() is now delayed just before PowerControl(FULL).

Definition at line 135 of file usbd-wrapper.h.

◆ c_cb_endpoint_func_

ARM_USBD_SignalEndpointEvent_t os::driver::usbd_wrapper::c_cb_endpoint_func_
private

Definition at line 136 of file usbd-wrapper.h.

◆ capa_

usb::device::Capabilities os::driver::usbd_wrapper::capa_
private

Definition at line 147 of file usbd-wrapper.h.

◆ cb_device_func_

device::signal_device_event_t os::driver::usb::Device::cb_device_func_
privateinherited

Pointer to static function that implements the device callback.

Definition at line 438 of file usb-device.h.

◆ cb_device_object_

const void* os::driver::usb::Device::cb_device_object_
privateinherited

Pointer to object instance associated with the device callback.

Definition at line 441 of file usb-device.h.

◆ cb_endpoint_func_

device::signal_endpoint_event_t os::driver::usb::Device::cb_endpoint_func_
privateinherited

Pointer to static function that implements the endpoint callback.

Definition at line 444 of file usb-device.h.

◆ cb_endpoint_object_

const void* os::driver::usb::Device::cb_endpoint_object_
privateinherited

Pointer to object instance associated with the endpoint callback.

Definition at line 447 of file usb-device.h.

◆ driver_

ARM_DRIVER_USBD* os::driver::usbd_wrapper::driver_
private

Pointer to CMSIS USBD Keil driver.

Definition at line 131 of file usbd-wrapper.h.

◆ status_

usb::device::Status os::driver::usbd_wrapper::status_
private

Definition at line 148 of file usbd-wrapper.h.

◆ version_

Version os::driver::usbd_wrapper::version_ { 0, 0 }
private

Definition at line 145 of file usbd-wrapper.h.


The documentation for this class was generated from the following files: