#include <mios32.h>
#include <msd.h>
#include <string.h>
#include <usbapi.h>
#include "msc_bot.h"
#include "msc_scsi.h"
#include "blockdev.h"
| |
#define | MAX_PACKET_SIZE 64 |
#define | LE_WORD(x) ((x)&0xFF),((x)>>8) |
#define | BUFFER_SIZE 75 |
s32 | MSD_Init (u32 mode) |
s32 | MSD_Periodic_mS (void) |
s32 | MSD_CheckAvailable (void) |
s32 | MSD_LUN_AvailableSet (u8 lun, u8 available) |
s32 | MSD_LUN_AvailableGet (u8 lun) |
s32 | MSD_RdLEDGet (u16 lag_ms) |
s32 | MSD_WrLEDGet (u16 lag_ms) |
#define BUFFER_SIZE 75 |
#define MAX_PACKET_SIZE 64 |
MSD Driver for MIOS32 running on a LPC17xx derivative Based on Code from Bertrik Sikken (bertrik@sikken.nl)
s32 MSD_CheckAvailable | ( | void | ) |
This function returns the connection status of the USB MIDI interface
Initializes the USB Device Driver for a Mass Storage Device
Should be called during runtime once a SD Card has been connected.
It is possible to switch back to the original device driver provided by MIOS32 (e.g. MIOS32_USB_MIDI) by calling MIOS32_USB_Init(1)
[in] | mode | currently only mode 0 supported |
The logical unit is available whenever MSD_Init() is called, or the USB cable has been reconnected.
It will be disabled when the host unmounts the file system (like if the SD Card would be removed.
When this happens, the application can either call MIOS32_USB_Init(1) again, e.g. to switch to USB MIDI, or it can make the LUN available again by calling MSD_LUN_AvailableSet(0, 1)
[in] | lun | Logical Unit number (0) |
[in] | available | 0 or 1 |
s32 MSD_Periodic_mS | ( | void | ) |
Should be called periodically each millisecond so long this driver is active (and only then!) to handle USBtransfers.
Take care that no other task accesses SD Card while this function is processed!
Ensure that this function isn't called when a MIOS32 USB driver like MIOS32_USB_MIDI is running!
Returns status of "Read LED"
[in] | lag_ms | The "lag" of the LED (e.g. 250 for 250 mS) |