|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
USBX host-controller-driver (HCD) bridge to ra8_usb. More...
#include "ra8_usb.h"Go to the source code of this file.
Enumerations | |
| enum | ra8_usb_hcd_state_t : uint8_t { k_ux_hcd_ra8_usb_state_uninit = 0U , k_ux_hcd_ra8_usb_state_ready = 1U , k_ux_hcd_ra8_usb_state_active = 2U } |
| Run-state of the HCD bridge. More... | |
Functions | |
| ra8_err_t | ux_hcd_ra8_usb_initialize (ra8_usb_speed_t speed) |
| Register the ra8_usb host bridge as the active USBX HCD. | |
| ra8_err_t | ux_hcd_ra8_usb_uninitialize (void) |
| Tear down the ra8_usb HCD bridge. | |
| ra8_usb_hcd_state_t | ux_hcd_ra8_usb_state (void) |
| Read the bridge run-state. | |
| unsigned int | _ux_hcd_ra8_usb_function (struct UX_HCD_STRUCT *hcd, unsigned int function, void *parameter) |
| ux hcd ra usb function. | |
USBX host-controller-driver (HCD) bridge to ra8_usb.
Plumbs Eclipse USBX's host stack onto the project's hand-written ra8_usb_* register-level driver in host mode (libs/ra8_hal/inc/ra8_usb.h – ra8_usb_host_init / ra8_usb_host_setup_request / etc.). The shim implements the dispatch contract that USBX expects to find behind UX_HCD::ux_hcd_entry_function.
The dispatch table _ux_hcd_ra8_usb_function switches on the UX_HCD_* command codes:
Definition in file ux_hcd_ra8_usb.h.
| enum ra8_usb_hcd_state_t : uint8_t |
Run-state of the HCD bridge.
| Enumerator | |
|---|---|
| k_ux_hcd_ra8_usb_state_uninit | Bridge not yet initialized. |
| k_ux_hcd_ra8_usb_state_ready | Bridge installed; bus idle. |
| k_ux_hcd_ra8_usb_state_active | SOF generation enabled. |
Definition at line 57 of file ux_hcd_ra8_usb.h.
| unsigned int _ux_hcd_ra8_usb_function | ( | struct UX_HCD_STRUCT * | hcd, |
| unsigned int | function, | ||
| void * | parameter ) |
ux hcd ra usb function.
See implementation for details.
| [in,out] | hcd | See function signature for type and usage. |
| [in,out] | function | See function signature for type and usage. |
| [in,out] | parameter | See function signature for type and usage. |
| 0 | Success or default value. |
ux hcd ra usb function.
Stamped into UX_HCD::ux_hcd_entry_function during ux_hcd_ra8_usb_initialize. The USBX host stack calls this with a UX_HCD_* selector to request endpoint create/destroy/reset, transfer request, transfer abort, and root-hub port management (reset / enable / disable). The trampoline routes each selector to the matching internal_* helper.
| [in,out] | hcd | USBX HCD ownership block (currently unused; the bridge keeps its own static state in s_hcd). |
| [in] | function | USBX UX_HCD_* selector (e.g. UX_HCD_TRANSFER_REQUEST, UX_HCD_RESET_PORT). |
| [in,out] | parameter | Selector-dependent argument (UX_TRANSFER* / UX_ENDPOINT* / opaque). |
| UX_SUCCESS | Function handled. |
| UX_CONTROLLER_UNKNOWN | Bridge has not been initialized. |
| UX_ERROR | Selector unsupported, or helper rejected the call. |
Definition at line 427 of file ux_hcd_ra8_usb.c.
References internal_endpoint_create(), internal_port_reset(), internal_port_set_enabled(), internal_transfer_request(), k_ux_hcd_ra8_usb_state_uninit, and s_hcd.
Referenced by ux_hcd_ra8_usb_initialize().
|
nodiscard |
Register the ra8_usb host bridge as the active USBX HCD.
Wraps ra8_usb_host_init and registers a UX_HCD entry into the USBX host system table so subsequent ux_host_class_*_register calls find this bridge.
| [in] | speed | Which controller (FS or HS). |
| k_ra8_ok | HCD installed; bus idle (UACT=0). |
| k_ra8_err_invalid_arg | speed out of range. |
| k_ra8_err_hw_init_failed | ra8_usb_host_init failed. |
Register the ra8_usb host bridge as the active USBX HCD.
See implementation for details.
| [in,out] | speed | See function signature for type and usage. |
| 0 | Success or default value. |
Definition at line 501 of file ux_hcd_ra8_usb.c.
References _ux_hcd_ra8_usb_function(), k_ra8_err_invalid_arg, k_ra8_err_invalid_state, k_ra8_ok, k_ra8_usb_hcd_controller_id, k_ra8_usb_speed_hs, k_ux_hcd_ra8_usb_state_ready, ra8_log_info, RA8_RETURN_ON_ERROR, ra8_usb_host_init(), s_hcd, and s_tag.
| ra8_usb_hcd_state_t ux_hcd_ra8_usb_state | ( | void | ) |
Read the bridge run-state.
Test-only.
See implementation for details.
| 0 | Success or default value. |
Read the bridge run-state.
See implementation for details.
| 0 | Success or default value. |
Definition at line 586 of file ux_hcd_ra8_usb.c.
References s_hcd.
|
nodiscard |
Tear down the ra8_usb HCD bridge.
| k_ra8_ok | Bridge released. |
| k_ra8_err_invalid_state | Bridge was never initialized. |
Tear down the ra8_usb HCD bridge.
See implementation for details.
| 0 | Success or default value. |
Definition at line 553 of file ux_hcd_ra8_usb.c.
References k_ra8_err_invalid_state, k_ra8_ok, k_ux_hcd_ra8_usb_state_uninit, ra8_usb_host_deinit(), ra8_usb_host_set_uact(), and s_hcd.