51#include "ux_device_class_cdc_acm.h"
52#include "ux_device_stack.h"
77typedef enum : uint32_t {
174typedef enum : uint32_t {
405typedef enum : uint8_t {
432 if (_ux_system_slave != UX_NULL) {
433 _ux_system_slave->ux_system_slave_device.ux_slave_device_state =
434 (
unsigned long)UX_DEVICE_CONFIGURED;
480 return _ux_device_stack_initialize((UCHAR*)UX_NULL,
504 UX_SLAVE_CLASS_CDC_ACM_PARAMETER cdc_params = {
507 .ux_slave_class_cdc_acm_parameter_change = UX_NULL,
511 return _ux_device_stack_class_register((UCHAR*)(uintptr_t)
"ux_slave_class_cdc_acm",
512 _ux_device_class_cdc_acm_entry,
589 (void)first_unused_memory;
volatile uint32_t g_tz_nsc_cgc_usb_match
Success counter: advances forever once all three veneers returned OK.
static UCHAR s_ns_usb_stack[k_ns_usb_thread_stack]
Stack backing storage for s_ns_usb_thread.
tz_usb_state_t
USBX bring-up progress breadcrumbs written to g_tz_usb_state.
@ k_tz_usb_state_dcd_ready
DCD bridge installed.
@ k_tz_usb_state_attached
Device attached (D+ pull-up on).
@ k_tz_usb_state_stack_up
USBX stack initialised.
@ k_tz_usb_state_dispatched
Entered the polled-dispatch loop.
@ k_tz_usb_state_cdc_ready
CDC-ACM class registered.
static UCHAR s_ns_language_id_framework[]
static UINT ns_usbx_stack_up(void)
Bring the USBX system + device stack up on the FS framework.
static UCHAR s_ns_device_framework_fs[]
static CHAR s_ns_usb_thread_name[]
Worker thread name (writable NS data; ThreadX name_ptr is CHAR*).
static UCHAR s_ns_string_framework[]
USBX string descriptor table (vendor / product / serial).
static VOID ns_cdc_activate(VOID *cdc_instance)
CDC-ACM activate callback – capture the class + enable bulk auto-echo.
static UINT ns_cdc_class_register(void)
Register the CDC-ACM class against the device-stack configuration.
void ra8_delay_ms(uint32_t ms)
Non-Secure ra8_delay_ms – sleep ms ThreadX ticks.
volatile uint32_t g_tz_usb_configured
Advances each time the CDC-ACM activate callback fires (enumeration reached SET_CONFIGURATION – the h...
static VOID ns_cdc_deactivate(VOID *cdc_instance)
CDC-ACM deactivate callback – drop the live class pointer.
volatile uint32_t g_tz_usb_intsts_or
Bitwise OR of every INTSTS0 snapshot the worker has seen.
volatile uint32_t g_tz_usb_dispatch_count
Polled-dispatch iteration counter (USB worker liveness).
static TX_THREAD s_ns_usb_thread
ThreadX TCB for the NS USBX worker.
ns_usb_langid_t
USBX LANGID 0x0409 (English-US), little-endian byte pair.
@ k_ns_usb_langid_lo
LANGID 0x0409 low byte.
@ k_ns_usb_langid_hi
LANGID 0x0409 high byte.
uint32_t ra8_time_ms(void)
Non-Secure ra8_time_ms – monotonic millisecond clock from ThreadX.
ns_usb_cfg_t
USBX worker thread + pool tunables.
@ k_ns_usb_echo_in_pipe
CDC bulk-IN -> pipe 1 (auto-echo).
@ k_ns_usb_echo_out_pipe
CDC bulk-OUT -> pipe 2 (auto-echo).
@ k_ns_usb_pool_bytes
USBX memory pool (bytes).
@ k_ns_usb_thread_stack
Worker thread stack (bytes).
@ k_ns_usb_thread_prio
Worker priority + preempt threshold.
static VOID ns_usb_worker(ULONG arg)
NS USBX worker – bring CDC up then poll the controller forever.
static UX_SLAVE_CLASS_CDC_ACM * s_ns_cdc_acm
Active CDC-ACM class instance captured by the activate callback.
void tx_application_define(void *first_unused_memory)
ThreadX application-define callback – spawn the device + host workers.
volatile uint32_t g_tz_usb_state
USBX bring-up progress breadcrumb (localises a stall under J-Link).
static UCHAR s_ns_usbx_pool[k_ns_usb_pool_bytes]
USBX memory pool (USBX manages it as a tx_byte_pool).
Private split-seam shared between ns_usb.c and ns_usb_host.c (#96).
TX_THREAD s_ns_host_thread
ThreadX TCB for the HS host worker (defined in ns_usb_host.c).
CHAR s_ns_host_thread_name[]
HS host worker thread name (defined in ns_usb_host.c; ThreadX CHAR*).
VOID ns_host_worker(ULONG arg)
HS host worker – enumerate the looped FS device, then echo forever.
@ k_ns_host_stack_bytes
HS host worker stack (bytes).
@ k_ns_time_slice
ThreadX time-slice (ticks) per worker.
UCHAR s_ns_host_stack[k_ns_host_stack_bytes]
Stack backing storage for s_ns_host_thread (defined in ns_usb_host.c).
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Native USB controller driver public API (device + host modes).
uint16_t ra8_usb_intsts0_snapshot(ra8_usb_speed_t speed)
Read INTSTS0 without acking any bits.
void ra8_usb_dispatch(ra8_usb_speed_t speed)
Snapshot INTSTS0 and fire the installed event handler.
ra8_err_t ra8_usb_device_attach(ra8_usb_speed_t speed, bool attached)
Raise / drop the D+ pull-up to advertise the device to the host.
@ k_ra8_usb_speed_fs
Full-Speed controller (USBFS @ 0x40250000).
unsigned int UINT
ThreadX-compatible unsigned int (host stub).
char CHAR
ThreadX-compatible CHAR (host stub).
unsigned long ULONG
ThreadX-compatible unsigned long (host stub).
Opaque thread stand-in for the host build.
USBX device-controller-driver (DCD) bridge to ra8_usb.
void ux_dcd_ra8_usb_auto_echo_enable(uint8_t out_pipe, uint8_t in_pipe)
Enable ISR-side auto-echo from a bulk OUT pipe to a bulk IN pipe.
ra8_err_t ux_dcd_ra8_usb_initialize(ra8_usb_speed_t speed)
Register the ra8_usb bridge as the active USBX DCD.