87typedef enum : uint16_t {
100typedef enum : uint8_t {
109typedef enum : uint8_t {
120typedef enum : uint8_t {
138typedef enum : uint16_t {
298 uint16_t max_packet);
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Native USB controller driver public API (device + host modes).
ra8_usb_speed_t
Selects which controller instance the call targets.
ra8_usb_pal_ep_dir_t
Endpoint direction.
@ k_ra8_usb_pal_ep_dir_out
Host -> device.
@ k_ra8_usb_pal_ep_dir_in
Device -> host.
ra8_err_t ra8_usb_pal_init(ra8_usb_speed_t speed)
Initialise the USB PAL on a specific controller speed.
ra8_err_t ra8_usb_pal_attach(bool attached)
Raise / drop the D+ pull-up to advertise the device.
ra8_usb_pal_limits_t
USB sizing constants.
@ k_ra8_usb_pal_ep_addr_mask
Strip USB-IN dir bit (bit 7) from ep_addr.
@ k_ra8_usb_pal_xfer_max
Single-shot xfer cap.
@ k_ra8_usb_pal_ep_max
Maximum endpoint number.
@ k_ra8_usb_pal_bulk_max_hs
Bulk max packet at high-speed.
@ k_ra8_usb_pal_bulk_max_fs
Bulk max packet at full-speed.
@ k_ra8_usb_pal_ep0_max_packet
EP0 max packet on FS / HS-FS.
ra8_err_t ra8_usb_pal_ep_open(uint8_t ep_addr, ra8_usb_pal_ep_dir_t dir, ra8_usb_pal_ep_type_t type, uint16_t max_packet)
Open a non-control endpoint with a given type / direction / size.
ra8_err_t ra8_usb_pal_get_state(ra8_usb_pal_state_t *out_state)
Read the current PAL state machine.
ra8_err_t ra8_usb_pal_ep_recv(uint8_t ep_addr, uint8_t *out_buf, uint16_t *inout_len)
Receive data from an OUT endpoint (host -> device).
ra8_usb_pal_ep_type_t
USB endpoint transfer type.
@ k_ra8_usb_pal_ep_type_bulk
RA8 USB pal ep type bulk.
@ k_ra8_usb_pal_ep_type_control
RA8 USB pal ep type control.
@ k_ra8_usb_pal_ep_type_intr
RA8 USB pal ep type intr.
@ k_ra8_usb_pal_ep_type_iso
RA8 USB pal ep type iso.
ra8_err_t ra8_usb_pal_set_event_handler(ra8_usb_pal_event_fn_t fn, void *ctx)
Attach a single event handler for bus / endpoint events.
ra8_usb_pal_event_t
Event mask bits passed to ra8_usb_pal_event_fn_t.
@ k_ra8_usb_pal_event_error
Controller error.
@ k_ra8_usb_pal_event_reset
Bus reset.
@ k_ra8_usb_pal_event_resume
Bus resume.
@ k_ra8_usb_pal_event_ep_out
OUT endpoint complete.
@ k_ra8_usb_pal_event_none
RA8 USB pal event none.
@ k_ra8_usb_pal_event_detach
VBUS dropped / cable out.
@ k_ra8_usb_pal_event_setup
SETUP packet on EP0.
@ k_ra8_usb_pal_event_attach
VBUS rose / cable in.
@ k_ra8_usb_pal_event_sof
Start-of-Frame.
@ k_ra8_usb_pal_event_suspend
Bus suspend (idle).
@ k_ra8_usb_pal_event_ep_in
IN endpoint complete.
ra8_err_t ra8_usb_pal_ep_send(uint8_t ep_addr, const uint8_t *data, uint16_t len)
Submit data on an IN endpoint (device -> host).
void(* ra8_usb_pal_event_fn_t)(void *ctx, ra8_usb_speed_t speed, uint16_t event_mask)
Async event callback shape.
ra8_usb_pal_state_t
USB device state per chapter 9 of USB 2.0.
@ k_ra8_usb_pal_state_default
Reset received.
@ k_ra8_usb_pal_state_attached
D+ pull-up on, no reset.
@ k_ra8_usb_pal_state_addressed
Address assigned.
@ k_ra8_usb_pal_state_suspended
Bus idle > 3 ms.
@ k_ra8_usb_pal_state_configd
SET_CONFIGURATION done.
@ k_ra8_usb_pal_state_detached
D+ pull-up off.
ra8_err_t ra8_usb_pal_deinit(void)
Tear down the USB PAL.