#include "MassStorageHost.h"
#include "fsusb_cfg.h"
#include "ff.h"
Go to the source code of this file.
|
| static void | die (FRESULT rc) |
| |
| static void | SetupHardware (void) |
| |
| static void | USB_ReadWriteFile (void) |
| |
| int | main (void) |
| | Main program body.
|
| |
| void | EVENT_USB_Host_DeviceAttached (const uint8_t corenum) |
| |
| void | EVENT_USB_Host_DeviceUnattached (const uint8_t corenum) |
| |
| void | EVENT_USB_Host_DeviceEnumerationComplete (const uint8_t corenum) |
| |
| void | EVENT_USB_Host_HostError (const uint8_t corenum, const uint8_t ErrorCode) |
| |
| void | EVENT_USB_Host_DeviceEnumerationFailed (const uint8_t corenum, const uint8_t ErrorCode, const uint8_t SubErrorCode) |
| |
| DISK_HANDLE_T * | FSUSB_DiskInit (void) |
| | Initialize the disk data structure.
|
| |
| int | FSUSB_DiskInsertWait (DISK_HANDLE_T *hDisk) |
| | Wait for the USB device to be inserted and ready.
|
| |
| int | FSUSB_DiskAcquire (DISK_HANDLE_T *hDisk) |
| | Enumerate and get the disk connected.
|
| |
| uint32_t | FSUSB_DiskGetSectorCnt (DISK_HANDLE_T *hDisk) |
| | Get the number of sectors in the disk.
|
| |
| uint32_t | FSUSB_DiskGetSectorSz (DISK_HANDLE_T *hDisk) |
| | Get number of bytes in a sector of the disk.
|
| |
| int | FSUSB_DiskReadSectors (DISK_HANDLE_T *hDisk, void *buff, uint32_t secStart, uint32_t numSec) |
| | Reads sectors from USB mass storage disk.
|
| |
| int | FSUSB_DiskWriteSectors (DISK_HANDLE_T *hDisk, void *buff, uint32_t secStart, uint32_t numSec) |
| | Write data to USB device sectors.
|
| |
| int | FSUSB_DiskReadyWait (DISK_HANDLE_T *hDisk, int tout) |
| | Wait for the USB Disk to be ready.
|
| |
Enumerate and get the disk connected.
- Parameters
-
| hDisk | : Handle to the USB Disk data structure |
- Returns
- 1 on success, 0 on failure
Definition at line 331 of file MassStorageHost.c.
Get the number of sectors in the disk.
- Parameters
-
| hDisk | : Handle to USB disk |
- Returns
- Number of sectors in the USB disk
Definition at line 361 of file MassStorageHost.c.
Get number of bytes in a sector of the disk.
- Parameters
-
| hDisk | : Handle to the USB Disk |
- Returns
- Number of bytes in a single sector of the disk
Definition at line 367 of file MassStorageHost.c.
Initialize the disk data structure.
- Returns
- Pointer to the disk data strucuture
Definition at line 315 of file MassStorageHost.c.
Wait for the USB device to be inserted and ready.
- Parameters
-
| hDisk | : Handle to USB Disk |
- Returns
- 1 on success and 0 on failure
Definition at line 321 of file MassStorageHost.c.
Reads sectors from USB mass storage disk.
- Parameters
-
| hDisk | : Handle to the USB disk |
| buff | : Pointer to memory where the data read will be stored |
| secStart | : Starting sector from which data be read |
| numSec | : Number of sectors to be read |
- Returns
- 1 on success and 0 on failure
Definition at line 373 of file MassStorageHost.c.
Wait for the USB Disk to be ready.
- Parameters
-
| hDisk | : Pointer to Disk Handle |
| tout | : Time to wait, in milliseconds |
- Returns
- 0 when operation failed 1 when successfully completed
Definition at line 394 of file MassStorageHost.c.
Write data to USB device sectors.
- Parameters
-
| hDisk | : Handle to the USB disk |
| buff | : Pointer to memory where the data to be written, be stored |
| secStart | : Starting sector from which data be written |
| numSec | : Number of sectors to write |
- Returns
- 1 on success and 0 on failure
Definition at line 384 of file MassStorageHost.c.
| static void SetupHardware |
( |
void |
| ) |
|
|
static |
Configures the board hardware and chip peripherals for the demo's functionality.
Definition at line 80 of file MassStorageHost.c.
| static void USB_ReadWriteFile |
( |
void |
| ) |
|
|
static |
Initial value:= {
.Config = {
.DataINPipeNumber = 1,
.DataINPipeDoubleBank = false,
.DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false,
.PortNumber = 0,
},
}
LPCUSBlib Mass Storage Class driver interface configuration and state information. This structure is passed to all Mass Storage Class driver functions, so that multiple instances of the same class within a device can be differentiated from one another.
Definition at line 45 of file MassStorageHost.c.