46typedef enum : uint8_t {
62typedef enum : uint16_t {
72typedef enum : uint8_t {
83typedef enum : uint32_t {
95typedef enum : uint8_t {
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
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_pmsc_state_data_t g_usb_pmsc_state
Singleton shadow state shared by both device-MSC TUs.
Native USB device-side MSC (Mass Storage Class) class layer.
ra8_err_t priv_handle_write10(const uint8_t *data_buf, uint32_t *out_len)
Run a SCSI WRITE(10) – the data buffer holds the host-supplied payload.
ra8_usb_pmsc_byte_shift_t
Per-byte left-shift constants for serialisation.
@ k_ra8_pmsc_shift_byte3
RA8 pmsc shift byte3.
@ k_ra8_pmsc_shift_byte1
RA8 pmsc shift byte1.
@ k_ra8_pmsc_shift_byte0
RA8 pmsc shift byte0.
@ k_ra8_pmsc_shift_byte2
RA8 pmsc shift byte2.
void priv_zero_bytes(uint8_t *dst, uint32_t len)
Zero len bytes at dst byte-by-byte.
ra8_err_t priv_handle_read10(uint8_t *data_buf, uint32_t capacity, uint32_t *out_len)
Run a SCSI READ(10).
ra8_err_t priv_handle_inquiry(uint8_t *data_buf, uint32_t capacity, uint32_t *out_len)
Build the 36-byte SCSI INQUIRY response.
ra8_usb_pmsc_cdb_opcode_offset_t
Offset of the SCSI operation code inside the cached CDB.
@ k_ra8_pmsc_cdb_off_opcode
Operation Code (CDB byte 0).
ra8_usb_pmsc_byte_mask_t
Single-byte extraction mask.
@ k_ra8_pmsc_byte_mask
RA8 pmsc byte mask.
ra8_err_t priv_handle_mode_sense(uint8_t *data_buf, uint32_t capacity, uint32_t *out_len)
Build the minimal 4-byte MODE SENSE(6) header response.
ra8_err_t priv_handle_request_sense(uint8_t *data_buf, uint32_t capacity, uint32_t *out_len)
Build the 18-byte REQUEST SENSE response.
ra8_usb_pmsc_size_t
Standard BOT wrapper sizes.
@ k_ra8_pmsc_cbw_len
CBW length (BBB sec 5.1).
@ k_ra8_pmsc_cdb_max_len
CDB ceiling.
@ k_ra8_pmsc_csw_len
CSW length (BBB sec 5.2).
ra8_err_t priv_handle_read_capacity(uint8_t *data_buf, uint32_t capacity, uint32_t *out_len)
Build the 8-byte READ_CAPACITY(10) response.
ra8_usb_pmsc_state_t
BOT state-machine phases.
@ k_ra8_pmsc_state_idle
Pre-CBW.
@ k_ra8_pmsc_state_data_tx
Push data on bulk-IN.
@ k_ra8_pmsc_state_data_rx
Pull data on bulk-OUT.
@ k_ra8_pmsc_state_cbw_rx
CBW arrived on bulk-OUT.
@ k_ra8_pmsc_state_cdb_decode
Dispatch to a SCSI handler.
@ k_ra8_pmsc_state_csw_tx
Push CSW on bulk-IN.
Singleton shadow state for the device-MSC driver.
ra8_usb_pmsc_state_t bot_state
BOT state machine phase.
bool storage_attached
True after attach_storage.
uint8_t cbw_cdb_len
Cached bCBWCBLength.
uint8_t cbw_lun
Cached bCBWLUN.
uint32_t cbw_data_length
Cached dCBWDataTransferLen.
bool initialized
True after init.
uint8_t cbw_cdb[k_ra8_pmsc_cdb_max_len]
Cached CDB.
ra8_usb_speed_t speed
Underlying controller.
ra8_usb_pmsc_storage_t storage
Storage backend snapshot.
bool cbw_dir_in
Cached bmCBWFlags direction.
uint32_t cbw_tag
Cached dCBWTag.
uint32_t last_data_len
Last data byte count.
Caller-owned storage backend bound to the device-MSC class.