19#ifndef CMSIS_PLUS_DRIVER_USB_HOST_H_
20#define CMSIS_PLUS_DRIVER_USB_HOST_H_
36#pragma GCC diagnostic push
38#pragma clang diagnostic ignored "-Wc++98-compat"
53#pragma GCC diagnostic push
55#pragma clang diagnostic ignored "-Wpadded"
56#elif defined(__GNUC__)
57#pragma GCC diagnostic ignored "-Wpadded"
86#pragma GCC diagnostic pop
91#pragma GCC diagnostic push
93#pragma clang diagnostic ignored "-Wpadded"
94#elif defined(__GNUC__)
95#pragma GCC diagnostic ignored "-Wpadded"
131#pragma GCC diagnostic pop
213#pragma GCC diagnostic push
214#if defined(__clang__)
215#pragma clang diagnostic ignored "-Wpadded"
216#elif defined(__GNUC__)
217#pragma GCC diagnostic ignored "-Wpadded"
240 ~Host () noexcept override;
251 const
void* cb_object =
nullptr) noexcept;
255 const
void* cb_object =
nullptr) noexcept;
259 const host::Capabilities&
316 virtual const host::Capabilities&
331 virtual host::Status&
355 std::
size_t num) noexcept = 0;
385#pragma GCC diagnostic pop
395 Status::is_connected (
void)
const noexcept
401 Status::is_overcurrent (
void)
const noexcept
407 Status::get_speed (
void)
const noexcept
459 return do_create_pipe (dev_addr, dev_speed, hub_addr, hub_port, ep_addr,
460 ep_type, ep_max_packet_size, ep_interval);
468 return do_modify_pipe (pipe, dev_addr, dev_speed, hub_addr, hub_port,
506#pragma GCC diagnostic pop
Host(const Host &)=delete
virtual return_t do_power_port_vbus(port_t port, bool vbus) noexcept=0
host::signal_port_event_t cb_port_func_
Pointer to static function that implements the port callback.
virtual return_t do_suspend_port(port_t port) noexcept=0
return_t reset_port(port_t port) noexcept
return_t delete_pipe(pipe_t pipe) noexcept
Host & operator=(const Host &)=delete
const host::Capabilities & get_capabilities(void) noexcept
virtual host::Status & do_get_port_status(port_t port) noexcept=0
virtual return_t do_reset_pipe(pipe_t pipe) noexcept=0
virtual return_t do_delete_pipe(pipe_t pipe) noexcept=0
host::Status & get_port_status(port_t port) noexcept
pipe_t create_pipe(device_address_t dev_addr, speed_t dev_speed, hub_addr_t hub_addr, hub_port_t hub_port, endpoint_t ep_addr, endpoint_type_t ep_type, packet_size_t ep_max_packet_size, polling_interval_t ep_interval) noexcept
void register_port_callback(host::signal_port_event_t cb_func, const void *cb_object=nullptr) noexcept
Register port event callback.
virtual return_t do_resume_port(port_t port) noexcept=0
void signal_pipe_event(pipe_t pipe, event_t event) noexcept
virtual uint16_t do_get_frame_number(void) noexcept=0
virtual return_t do_modify_pipe(pipe_t pipe, device_address_t dev_addr, speed_t dev_speed, hub_addr_t hub_addr, hub_port_t hub_port, packet_size_t ep_max_packet_size) noexcept=0
host::signal_pipe_event_t cb_pipe_func_
Pointer to static function that implements the pipe callback.
return_t transfer(pipe_t pipe, uint32_t packet, uint8_t *data, std::size_t num) noexcept
return_t power_port_vbus(port_t port, bool vbus) noexcept
return_t resume_port(port_t port) noexcept
virtual return_t do_abort_transfer(pipe_t pipe) noexcept=0
return_t modify_pipe(pipe_t pipe, device_address_t dev_addr, speed_t dev_speed, hub_addr_t hub_addr, hub_port_t hub_port, packet_size_t ep_max_packet_size) noexcept
virtual pipe_t do_create_pipe(device_address_t dev_addr, speed_t dev_speed, hub_addr_t hub_addr, hub_port_t hub_port, endpoint_t ep_addr, endpoint_type_t ep_type, packet_size_t ep_max_packet_size, polling_interval_t ep_interval) noexcept=0
const void * cb_pipe_object_
Pointer to object instance associated with the pipe callback.
virtual const host::Capabilities & do_get_capabilities(void) noexcept=0
virtual std::size_t do_get_transfer_count(pipe_t pipe) noexcept=0
return_t suspend_port(port_t port) noexcept
const void * cb_port_object_
Pointer to object instance associated with the port callback.
return_t reset_pipe(pipe_t pipe) noexcept
std::size_t get_transfer_count(pipe_t pipe) noexcept
uint16_t get_frame_number(void) noexcept
virtual return_t do_reset_port(port_t port) noexcept=0
virtual ~Host() noexcept override
void register_pipe_callback(host::signal_pipe_event_t cb_func, const void *cb_object=nullptr) noexcept
void signal_port_event(port_t port, event_t event) noexcept
return_t abort_transfer(pipe_t pipe) noexcept
virtual return_t do_transfer(pipe_t pipe, uint32_t packet, uint8_t *data, std::size_t num) noexcept=0
USB host driver capabilities.
bool event_connect
Signal Disconnect event.
uint32_t port_mask
< Root HUB available Ports Mask
bool auto_split
Signal Connect event.
bool event_disconnect
Signal Overcurrent event.
speed_t get_speed(void) const noexcept
bool is_connected(void) const noexcept
bool is_overcurrent(void) const noexcept
bool overcurrent
USB Host Port speed setting (ARM_USB_SPEED_xxx)
bool connected
< USB Host Port connected flag
Port_event
USB Host Port Events.
@ resume
USB Device activated Remote Wakeup.
@ disconnect
USB Device caused Overcurrent.
@ suspend
USB Resume occurred.
@ overcurrent
USB Reset completed.
@ connect
USB Device Connected to Port.
@ reset
USB Suspend occurred.
void(* signal_pipe_event_t)(const void *object, pipe_t pipe, event_t event)
Pipe_event
USB Host Pipe Event.
@ handshake_nak
NYET Handshake received.
@ transfer_complete
Transfer completed.
@ handshake_stall
ERR Handshake received.
@ handshake_err
Bus Error detected.
@ handshake_mdata
STALL Handshake received.
@ handshake_nyet
MDATA Handshake received.
void(* signal_port_event_t)(const void *object, port_t port, event_t event)
uint8_t polling_interval_t