54 #include "storage/storage_task.h"
79 static bit ms_data_direction;
82 extern U8 g_scsi_status;
83 extern U32 g_scsi_data_remaining;
84 extern bit ms_multiple_drive;
85 extern U8 g_scsi_command[16];
94 #define Usb_set_ms_data_direction_in() (ms_data_direction = 1)
95 #define Usb_set_ms_data_direction_out() (ms_data_direction = 0)
96 #define Is_usb_ms_data_direction_in() (ms_data_direction == 1)
100 PROCESS(storage_process,
"Storage process");
115 if (usb_mode == mass_storage) {
128 if (usb_mode == mass_storage) {
159 { cbw_error =
TRUE; }
161 { cbw_error =
TRUE; }
163 { cbw_error =
TRUE; }
165 { cbw_error =
TRUE; }
180 Usb_set_ms_data_direction_in();
191 Usb_set_ms_data_direction_out();
202 if (!ms_multiple_drive)
217 if (Is_usb_ms_data_direction_in())
224 if (g_scsi_data_remaining != 0)
U8 get_cur_lun()
This fonction return the current logical unit.
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
Bool scsi_decode_command(void)
SCSI decoder function.
This file is the scsi decoder.
#define Is_device_enumerated()
Returns true when device connected and correctly enumerated with an host.
#define PROCESS_BEGIN()
Define the beginning of a process.
#define Usb_read_byte()
returns FIFO byte for current endpoint
This file contains the user callback functions corresponding to the application.
This file contains the USB driver routines.
void usb_mass_storage_cbw(void)
USB Command Block Wrapper (CBW) management.
#define Usb_write_byte(byte)
writes byte in FIFO for current endpoint
void usb_process_request(void)
usb_process_request.
U8 usb_configuration_nb
Public : (U8) usb_configuration_nb Store the number of the USB configuration used by the USB device w...
#define Is_usb_endpoint_stall_requested()
tests if STALL handshake request is running
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
#define TRUE
An alias for one, used for clarity.
#define Usb_send_in()
sends IN
#define PROCESS_WAIT_EVENT_UNTIL(c)
Wait for an event to be posted to the process, with an extra condition.
This file contains the USB endpoint 0 management routines corresponding to the standard enumeration p...
#define Is_usb_receive_setup()
tests if SETUP received
#define PROCESS(name, strname)
Declare a process.
#define Is_usb_write_enabled()
tests if endpoint write allowed
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
This file contains the usb parameters that uniquely identify the application through descriptor table...
#define FALSE
An alias for zero, used for clarity.
#define Usb_select_endpoint(ep)
selects the endpoint number to interface with the CPU
#define Is_usb_receive_out()
tests if OUT received
This file contains the interface :
#define Usb_ack_receive_out()
acks reveive OUT
void usb_mass_storage_csw(void)
USB Command Status Wrapper (CSW) management.
#define Usb_enable_stall_handshake()
enables the STALL handshake for the next transaction
#define CLOCK_SECOND
A second, measured in system clock time.