36#include "ux_device_stack.h"
38#include "ux_utility.h"
188typedef enum : uint32_t {
303 if ((intsts0 & event_msk) == 0U) {
345 if ((intsts0 & stuck_mask) != 0U) {
354 if (reg !=
nullptr) {
355 const uint16_t int1_mask =
358 reg->
INTSTS1 = (uint16_t)~int1_mask;
410 if ((intsts0 & event_msk) == 0U) {
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
Event Link Controller (ELC) register layout for the Renesas RA8D2.
ra8_elc_event_t
Partial list of ELC events (populate as drivers need them).
@ k_ra8_elc_event_usbfs_int
USBFS controller interrupt.
@ k_ra8_elc_event_usbhs_int_resume
USBHS combined int + resume.
NVIC + ICU IELSR allocator.
void(* ra8_isr_handler_t)(void *ctx)
Driver-supplied callback invoked on interrupt entry.
Lightweight Logging Interface for ra8-firmware.
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_usb_speed_t
Selects which controller instance the call targets.
@ k_ra8_usb_speed_hs
High-Speed controller (USBHS @ 0x40351000).
@ k_ra8_usb_speed_fs
Full-Speed controller (USBFS @ 0x40250000).
ra8_err_t ra8_usb_clear_status(ra8_usb_speed_t speed, uint16_t mask)
Clear bits in INTSTS0.
USB Full-Speed + High-Speed controller layout for the Renesas RA8D2.
@ k_ra8_int1_bit_dtch
Device detach detected.
@ k_ra8_int1_bit_attch
Device attach detected.
@ k_ra8_int1_bit_bchg
Bus change.
static volatile r_usb_regs_t * ra8_usb_hs(void)
Get pointer to the USB HS controller register block.
@ k_ra8_intsts0_mask_valid
SETUP packet detect flag.
@ k_ra8_int0_bit_bemp
Buffer-empty interrupt.
@ k_ra8_int0_bit_dvst
Device-state transition.
@ k_ra8_int0_bit_brdy
Buffer-ready interrupt.
@ k_ra8_int0_bit_ctrt
Control-transfer-stage transition.
@ k_ra8_int0_bit_sofr
Start-of-Frame.
@ k_ra8_int0_bit_vbse
VBUS change.
@ k_ra8_int0_bit_nrdy
Buffer-not-ready interrupt.
@ k_ra8_int0_bit_rsme
Resume.
USB FS / HS register window (device-mode subset).
volatile uint16_t INTSTS1
+0x042 Interrupt Status 1.
USBX device-controller-driver (DCD) bridge to ra8_usb.
void ux_dcd_ra8_usb_irq(ra8_usb_speed_t speed, uint16_t intsts0)
ISR-context bottom-half.
USBX device-controller-driver bridge to ra8_usb – per-module cross-translation-unit contract.
void priv_usbfs_irq_mask(void)
Mask the USB IRQ at the NVIC to break an interrupt storm.
volatile uint32_t g_isr_spurious_run
Consecutive event-less ISR entries since the last SysTick re-enable.
volatile uint32_t g_dcd_irq_spurious_mask_count
volatile uint32_t g_isr_sofr_count
Per-bit ISR counter for INTSTS0.SOFR (bit 13) entries.
volatile uint32_t g_isr_brdy_count
Per-bit ISR counter for INTSTS0.BRDY (bit 8) entries.
volatile uint16_t g_isr_intsts0_or
Cumulative bitwise-OR of every INTSTS0 value observed at the entry of internal_usbhs_isr.
ra8_elc_event_t priv_pick_event(ra8_usb_speed_t speed)
Pick the ELC event number for a controller.
ra8_isr_handler_t priv_pick_isr(ra8_usb_speed_t speed)
Pick the ISR trampoline for a controller.
volatile uint32_t g_isr_bemp_count
Per-bit ISR counter for INTSTS0.BEMP (bit 10) entries.
ra8_usb_storm_cfg_t
Tuning constant for the USBFS interrupt-storm guard.
@ k_ra8_usb_storm_mask_run
Consecutive event-less FS ISR entries that trip the NVIC mask.
void priv_event_cb(void *ctx, ra8_usb_speed_t speed, uint16_t status_mask)
ra8_usb_attach_handler trampoline.
volatile uint32_t g_isr_dvst_count
Per-bit ISR counter for INTSTS0.DVST (bit 12) entries.
volatile uint32_t g_isr_invocations
Counter of NVIC ISR entries through internal_usbfs_isr or internal_usbhs_isr.
volatile uint32_t g_isr_nrdy_count
Per-bit ISR counter for INTSTS0.NRDY (bit 9) entries.
static void internal_isr_bump_counts(uint16_t intsts0)
Bump the per-bit ISR counters for an INTSTS0 snapshot.
static void internal_usbfs_isr(void *ctx)
NVIC ISR entry point for the USBFS controller.
static void internal_ack_spurious(ra8_usb_speed_t speed, uint16_t intsts0)
W0C-ack RSME/SOFR on a spurious USB ISR re-entry.
volatile uint32_t g_isr_ctrt_count
Per-bit ISR counter for INTSTS0.CTRT (bit 11) entries.
volatile uint32_t g_isr_valid_count
Per-bit ISR counter for INTSTS0.VALID (bit 3) entries.
static void internal_usbhs_isr(void *ctx)
NVIC ISR entry point for the USBHS controller.