Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of F401RE-USBHost by
Diff: USBHost/USBHALHost_KL46Z.h
- Revision:
- 18:61554f238584
- Parent:
- 16:981c3104f6c0
--- a/USBHost/USBHALHost_KL46Z.h Mon Jun 23 20:48:53 2014 +0900 +++ b/USBHost/USBHALHost_KL46Z.h Tue Jul 01 18:33:31 2014 +0900 @@ -1,17 +1,8 @@ -// Simple USBHost for FRDM-KL46Z #pragma once #include "mbed.h" #include "USBHostTypes.h" #include "USBEndpoint.h" -struct SETUP_PACKET { - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; -}; - #define GET_CONFIGURATION 8 // TOK_PID[5:2] @@ -50,16 +41,19 @@ USBHALHost(); void init(); virtual bool addDevice(USBDeviceConnected* parent, int port, bool lowSpeed) = 0; + int token_setup(USBEndpoint* ep, SETUP_PACKET* setup, uint16_t wLength = 0); + int multi_token_in(USBEndpoint* ep, uint8_t* data = NULL, size_t total = 0, bool block = true); + int multi_token_out(USBEndpoint* ep, const uint8_t* data = NULL, size_t total = 0); + void multi_token_inNB(USBEndpoint* ep, uint8_t* data, int size); + USB_TYPE multi_token_inNB_result(USBEndpoint* ep); + void setToggle(USBEndpoint* ep, uint8_t toggle); + int token_iso_in(USBEndpoint* ep, uint8_t* data, int size); + +private: void setAddr(int addr, bool lowSpeed = false); void setEndpoint(); void token_transfer_init(); - int token_setup(USBEndpoint* ep, SETUP_PACKET* setup, uint16_t wLength = 0); - int multi_token_in(USBEndpoint* ep, uint8_t* data = NULL, size_t total = 0, bool block = true); - int multi_token_out(USBEndpoint* ep, const uint8_t* data = NULL, size_t total = 0, bool block = true); - int token_iso_in(USBEndpoint* ep, uint8_t* data, int size); void token_ready(); - -private: int token_in(USBEndpoint* ep, uint8_t* data = NULL, int size = 0, int retryLimit = 10); int token_out(USBEndpoint* ep, const uint8_t* data = NULL, int size = 0, int retryLimit = 10); static void _usbisr(void);