75typedef enum : uint8_t {
88typedef enum : uint8_t {
97typedef enum : uint16_t {
111typedef enum : uint8_t {
124typedef enum : uint8_t {
136typedef enum : uint8_t {
146typedef enum : uint8_t {
163typedef enum : uint8_t {
183typedef enum : uint16_t {
200typedef enum : uint8_t {
227 uint32_t block_count,
244 uint32_t block_count,
259 uint32_t* block_count,
260 uint32_t* block_size);
518 uint32_t data_buf_capacity,
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_class_t
Class / subclass / protocol triplet advertised in the device's interface descriptor.
@ k_ra8_pmsc_protocol_bbb
Bulk-Only Transport.
@ k_ra8_pmsc_class_msc
MSC interface class.
@ k_ra8_pmsc_subclass_scsi
Transparent SCSI subclass.
ra8_err_t ra8_usb_pmsc_close(void)
Tear down the device-MSC driver and release the controller.
ra8_usb_pmsc_inquiry_field_t
Sizes of the three INQUIRY ASCII strings the storage backend returns.
@ k_ra8_pmsc_inq_revision_len
Revision byte count.
@ k_ra8_pmsc_inq_vendor_len
Vendor ID byte count.
@ k_ra8_pmsc_inq_product_len
Product ID byte count.
ra8_err_t(* ra8_usb_pmsc_read_block_fn_t)(void *ctx, uint32_t lba, uint32_t block_count, uint8_t *buf)
Storage-backend read hook.
ra8_usb_pmsc_pipe_t
PIPE numbers used by the device-MSC driver for the local bulk endpoints.
@ k_ra8_pmsc_pipe_bulk_out
PIPE4 -> local EP bulk OUT.
@ k_ra8_pmsc_pipe_bulk_in
PIPE3 -> local EP bulk IN.
ra8_err_t ra8_usb_pmsc_dispatch_command(uint8_t *data_buf, uint32_t data_buf_capacity, uint32_t *data_len, ra8_usb_pmsc_csw_status_t *csw_status)
Run the SCSI command currently parked in the BOT state.
ra8_usb_pmsc_max_lun_t
Number of logical units the starter exposes.
@ k_ra8_pmsc_max_lun
Highest valid LUN index.
ra8_err_t(* ra8_usb_pmsc_write_block_fn_t)(void *ctx, uint32_t lba, uint32_t block_count, const uint8_t *buf)
Storage-backend write hook.
ra8_usb_pmsc_resp_size_t
Standard SCSI response payload sizes.
@ k_ra8_pmsc_read_capacity_resp_len
READ_CAPACITY(10).
@ k_ra8_pmsc_request_sense_resp_len
REQUEST SENSE response.
@ k_ra8_pmsc_inquiry_resp_len
INQUIRY response len.
@ k_ra8_pmsc_block_size_default
SCSI default block.
@ k_ra8_pmsc_mode_sense_resp_len
MODE SENSE(6) response.
ra8_err_t ra8_usb_pmsc_init(ra8_usb_speed_t speed)
Bring up the device-MSC driver on a chosen USB controller.
ra8_usb_pmsc_endpoint_t
USB endpoint numbers advertised in the configuration descriptor.
@ k_ra8_pmsc_ep_bulk_in
Bulk-IN endpoint number.
@ k_ra8_pmsc_ep_bulk_out
Bulk-OUT endpoint number.
ra8_usb_pmsc_packet_t
Packet sizing for the local bulk endpoints.
@ k_ra8_pmsc_bulk_max_packet_fs
Bulk size at full speed.
@ k_ra8_pmsc_bulk_max_packet_hs
Bulk size at high speed.
ra8_usb_pmsc_request_t
MSC class-specific request codes the host issues to the device.
@ k_ra8_pmsc_req_mass_storage_reset
0-byte payload.
@ k_ra8_pmsc_req_get_max_lun
1-byte response.
ra8_err_t ra8_usb_pmsc_build_csw(ra8_usb_pmsc_csw_status_t csw_status, uint32_t residue, uint8_t *out_csw)
Build the 13-byte CSW for the in-flight command.
ra8_err_t(* ra8_usb_pmsc_get_capacity_fn_t)(void *ctx, uint32_t *block_count, uint32_t *block_size)
Storage-backend capacity hook – answers SCSI READ CAPACITY(10).
ra8_usb_pmsc_csw_status_t
CSW status field values the device returns after a CBW.
@ k_ra8_pmsc_csw_status_passed
Command succeeded.
@ k_ra8_pmsc_csw_status_phase_error
BBB phase error – the host must run reset recovery.
@ k_ra8_pmsc_csw_status_failed
Command failed.
ra8_usb_pmsc_scsi_t
SCSI opcodes the device-MSC class answers over BBB.
@ k_ra8_pmsc_scsi_write_10
WRITE(10).
@ k_ra8_pmsc_scsi_read_capacity_10
READ CAPACITY(10).
@ k_ra8_pmsc_scsi_read_10
READ(10).
@ k_ra8_pmsc_scsi_test_unit_ready
TEST UNIT READY.
@ k_ra8_pmsc_scsi_inquiry
INQUIRY.
@ k_ra8_pmsc_scsi_request_sense
REQUEST SENSE.
@ k_ra8_pmsc_scsi_mode_sense_6
MODE SENSE(6).
ra8_err_t ra8_usb_pmsc_step(void)
Drive the BOT (Bulk-Only Transport) state machine forward by one step.
ra8_err_t(* ra8_usb_pmsc_get_inquiry_fn_t)(void *ctx, uint8_t *vendor8, uint8_t *product16, uint8_t *revision4)
Storage-backend INQUIRY hook – answers SCSI INQUIRY.
ra8_err_t ra8_usb_pmsc_feed_cbw(const uint8_t *cbw)
Inject a CBW directly into the BOT state machine.
ra8_err_t ra8_usb_pmsc_attach_storage(const ra8_usb_pmsc_storage_t *storage)
Bind a caller-owned storage backend to the device-MSC class.
Caller-owned storage backend bound to the device-MSC class.
void * ctx
Opaque context.
ra8_usb_pmsc_get_inquiry_fn_t get_inquiry
INQUIRY hook.
ra8_usb_pmsc_read_block_fn_t read_block
Block read hook.
ra8_usb_pmsc_get_capacity_fn_t get_capacity
Capacity hook.
ra8_usb_pmsc_write_block_fn_t write_block
Block write hook.