I added the Isochronous to USBHost library. The Isochronous code based on the following. http://developer.mbed.org/users/va009039/code/USBHostC270_example/
Dependencies: FATFileSystem mbed-rtos
Fork of USBHost_AddIso by
Revision 33:bf48dc2a4240, committed 2016-04-18
- Comitter:
- dkato
- Date:
- Mon Apr 18 10:01:46 2016 +0000
- Parent:
- 32:6824d71b37c1
- Commit message:
- Supports IAR.
Changed in this revision
diff -r 6824d71b37c1 -r bf48dc2a4240 FATFileSystem.lib --- a/FATFileSystem.lib Fri Oct 16 11:13:01 2015 +0000 +++ b/FATFileSystem.lib Mon Apr 18 10:01:46 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/FATFileSystem/#b3b3370574cf +http://mbed.org/users/mbed_official/code/FATFileSystem/#094f84646b9f
diff -r 6824d71b37c1 -r bf48dc2a4240 USBHost/USBEndpoint.cpp --- a/USBHost/USBEndpoint.cpp Fri Oct 16 11:13:01 2015 +0000 +++ b/USBHost/USBEndpoint.cpp Mon Apr 18 10:01:46 2016 +0000 @@ -140,7 +140,7 @@ //Now add this free TD at this end of the queue state = USB_TYPE_PROCESSING; - td_current->nextTD = td_next; + td_current->nextTD = (hcTd*)td_next; hced->tailTD = td_next; } @@ -158,5 +158,5 @@ void USBEndpoint::queueEndpoint(USBEndpoint * ed) { nextEp = ed; - hced->nextED = (ed == NULL) ? 0 : ed->getHCED(); + hced->nextED = (ed == NULL) ? 0 : (hcEd*)(ed->getHCED()); }
diff -r 6824d71b37c1 -r bf48dc2a4240 USBHost/USBHost.cpp --- a/USBHost/USBHost.cpp Fri Oct 16 11:13:01 2015 +0000 +++ b/USBHost/USBHost.cpp Mon Apr 18 10:01:46 2016 +0000 @@ -307,7 +307,7 @@ do { volatile HCTD* td = (volatile HCTD*)addr; addr = (uint32_t)td->nextTD; //Dequeue from physical list - td->nextTD = tdList; //Enqueue into reversed list + td->nextTD = (hcTd*)tdList; //Enqueue into reversed list tdList = td; } while(addr);
diff -r 6824d71b37c1 -r bf48dc2a4240 USBHost/USBHostTypes.h --- a/USBHost/USBHostTypes.h Fri Oct 16 11:13:01 2015 +0000 +++ b/USBHost/USBHostTypes.h Mon Apr 18 10:01:46 2016 +0000 @@ -136,10 +136,10 @@ #define CONFIGURATION_DESCRIPTOR_LENGTH 0x09 // ------------ HostController Transfer Descriptor ------------ -typedef struct HCTD { +typedef struct hcTd { __IO uint32_t control; // Transfer descriptor control __IO uint8_t * currBufPtr; // Physical address of current buffer pointer - __IO HCTD * nextTD; // Physical pointer to next Transfer Descriptor + __IO hcTd * nextTD; // Physical pointer to next Transfer Descriptor __IO uint8_t * bufEnd; // Physical address of end of buffer void * ep; // ep address where a td is linked in uint32_t dummy[3]; // padding
diff -r 6824d71b37c1 -r bf48dc2a4240 USBHostMSD/USBHostMSD.cpp --- a/USBHostMSD/USBHostMSD.cpp Fri Oct 16 11:13:01 2015 +0000 +++ b/USBHostMSD/USBHostMSD.cpp Mon Apr 18 10:01:46 2016 +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();
diff -r 6824d71b37c1 -r bf48dc2a4240 USBHostMSD/USBHostMSD.h --- a/USBHostMSD/USBHostMSD.h Fri Oct 16 11:13:01 2015 +0000 +++ b/USBHostMSD/USBHostMSD.h Mon Apr 18 10:01:46 2016 +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;
diff -r 6824d71b37c1 -r bf48dc2a4240 USBisochronous/USBIsochronous.h --- a/USBisochronous/USBIsochronous.h Fri Oct 16 11:13:01 2015 +0000 +++ b/USBisochronous/USBIsochronous.h Mon Apr 18 10:01:46 2016 +0000 @@ -1,8 +1,13 @@ // USBIsochronous.h #pragma once #if !defined (__CC_ARM) && (!defined (_POSIX_C_SOURCE) || (_POSIX_C_SOURCE < 200112L)) +#if defined(__ICCARM__) +#include <iar_dlmalloc.h> +#define memalign __iar_dlmemalign +#else #include <malloc.h> #endif +#endif class IsochronousEp; struct HCITD { // HostController Isochronous Transfer Descriptor
diff -r 6824d71b37c1 -r bf48dc2a4240 mbed-rtos.lib --- a/mbed-rtos.lib Fri Oct 16 11:13:01 2015 +0000 +++ b/mbed-rtos.lib Mon Apr 18 10:01:46 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#9d001ed5feec +http://mbed.org/users/mbed_official/code/mbed-rtos/#bdd541595fc5