USBHost library. NOTE: This library is only officially supported on the LPC1768 platform. For more information, please see the handbook page.

Dependencies:   FATFileSystem mbed-rtos

Dependents:   BTstack WallbotWii SD to Flash Data Transfer USBHost-MSD_HelloWorld ... more

Legacy Warning

This is an mbed 2 library. To learn more about mbed OS 5, visit the docs.

Pull requests against this repository are no longer supported. Please raise against mbed OS 5 as documented above.

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Fri Dec 11 16:16:06 2015 +0000
Parent:
32:140defdf151c
Child:
34:028508fd50fa
Commit message:
Synchronized with git revision bee1c953f03a0e4f6a4c397e97409076516614a4

Full URL: https://github.com/mbedmicro/mbed/commit/bee1c953f03a0e4f6a4c397e97409076516614a4/

FATFileSystem -Fixed API integer widths

Changed in this revision

USBHostMSD/USBHostMSD.cpp Show annotated file Show diff for this revision Revisions of this file
USBHostMSD/USBHostMSD.h Show annotated file Show diff for this revision Revisions of this file
--- a/USBHostMSD/USBHostMSD.cpp	Fri Oct 16 07:46:31 2015 +0100
+++ b/USBHostMSD/USBHostMSD.cpp	Fri Dec 11 16:16:06 2015 +0000
@@ -323,14 +323,14 @@
     return readCapacity();
 }
 
-int USBHostMSD::disk_write(const uint8_t* buffer, uint64_t block_number, uint8_t count) {
+int USBHostMSD::disk_write(const uint8_t* buffer, uint32_t block_number, uint32_t count) {
     USB_DBG("FILESYSTEM: write block: %lld, count: %d", block_number, count);
     if (!disk_init) {
         disk_initialize();
     }
     if (!disk_init)
         return -1;
-    for (uint64_t b = block_number; b < block_number + count; b++) {
+    for (uint32_t b = block_number; b < block_number + count; b++) {
         if (dataTransfer((uint8_t*)buffer, b, 1, HOST_TO_DEVICE))
             return -1;
         buffer += 512;
@@ -338,14 +338,14 @@
     return 0;
 }
 
-int USBHostMSD::disk_read(uint8_t* buffer, uint64_t block_number, uint8_t count) {
+int USBHostMSD::disk_read(uint8_t* buffer, uint32_t block_number, uint32_t count) {
     USB_DBG("FILESYSTEM: read block: %lld, count: %d", block_number, count);
     if (!disk_init) {
         disk_initialize();
     }
     if (!disk_init)
         return -1;
-    for (uint64_t b = block_number; b < block_number + count; b++) {
+    for (uint32_t b = block_number; b < block_number + count; b++) {
         if (dataTransfer((uint8_t*)buffer, b, 1, DEVICE_TO_HOST))
             return -1;
         buffer += 512;
@@ -353,7 +353,7 @@
     return 0;
 }
 
-uint64_t USBHostMSD::disk_sectors() {
+uint32_t USBHostMSD::disk_sectors() {
     USB_DBG("FILESYSTEM: sectors");
     if (!disk_init) {
         disk_initialize();
--- a/USBHostMSD/USBHostMSD.h	Fri Oct 16 07:46:31 2015 +0100
+++ b/USBHostMSD/USBHostMSD.h	Fri Dec 11 16:16:06 2015 +0000
@@ -59,10 +59,10 @@
     // From FATFileSystem
     virtual int disk_initialize();
     virtual int disk_status() {return 0;};
-    virtual int disk_read(uint8_t* buffer, uint64_t sector, uint8_t count);
-    virtual int disk_write(const uint8_t* buffer, uint64_t sector, uint8_t count);
+    virtual int disk_read(uint8_t* buffer, uint32_t sector, uint32_t count);
+    virtual int disk_write(const uint8_t* buffer, uint32_t sector, uint32_t count);
     virtual int disk_sync() {return 0;};
-    virtual uint64_t disk_sectors();
+    virtual uint32_t disk_sectors();
 
 private:
     USBHost * host;
@@ -104,7 +104,7 @@
     int getMaxLun();
 
     int blockSize;
-    uint64_t blockCount;
+    uint32_t blockCount;
 
     int msd_intf;
     bool msd_device_found;