1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #pragma once 8 9 #include <stdint.h> 10 #include "esp_err.h" 11 #include "msc_common.h" 12 13 #ifdef __cplusplus 14 extern "C" 15 { 16 #endif 17 18 typedef struct { 19 uint8_t key; 20 uint8_t code; 21 uint8_t code_q; 22 } scsi_sense_data_t; 23 24 esp_err_t scsi_cmd_read10(msc_device_t *device, 25 uint8_t *data, 26 uint32_t sector_address, 27 uint32_t num_sectors, 28 uint32_t sector_size); 29 30 esp_err_t scsi_cmd_write10(msc_device_t *device, 31 const uint8_t *data, 32 uint32_t sector_address, 33 uint32_t num_sectors, 34 uint32_t sector_size); 35 36 esp_err_t scsi_cmd_read_capacity(msc_device_t *device, 37 uint32_t *block_size, 38 uint32_t *block_count); 39 40 esp_err_t scsi_cmd_sense(msc_device_t *device, scsi_sense_data_t *sense); 41 42 esp_err_t scsi_cmd_unit_ready(msc_device_t *device); 43 44 esp_err_t scsi_cmd_inquiry(msc_device_t *device); 45 46 esp_err_t scsi_cmd_prevent_removal(msc_device_t *device, bool prevent); 47 48 esp_err_t scsi_cmd_mode_sense(msc_device_t *device); 49 50 esp_err_t msc_mass_reset(msc_device_t *device); 51 52 esp_err_t msc_get_max_lun(msc_device_t *device, uint8_t *lun); 53 54 #ifdef __cplusplus 55 } 56 #endif 57