XOOMの動作状況を聞き処理を変えてみました。 USBケーブルを抜いた際に処理を終了するようにしました。

Dependencies:   mbed

Committer:
abe00makoto
Date:
Fri May 27 18:51:15 2011 +0000
Revision:
3:432e5675d240
Parent:
2:a05c7cbe396f
nexus one support
maybe support add XOOM ,nexus S

Who changed what in which revision?

UserRevisionLine numberNew contents of line
abe00makoto 0:9fb6c423e32c 1
abe00makoto 0:9fb6c423e32c 2 #ifndef ADK_H_INCLUDED
abe00makoto 0:9fb6c423e32c 3 #define ADK_H_INCLUDED
abe00makoto 0:9fb6c423e32c 4
abe00makoto 0:9fb6c423e32c 5 #include "mbed.h"
abe00makoto 0:9fb6c423e32c 6
abe00makoto 0:9fb6c423e32c 7
abe00makoto 0:9fb6c423e32c 8 #define ACCESSORY_STRING_MANUFACTURER 0
abe00makoto 0:9fb6c423e32c 9 #define ACCESSORY_STRING_MODEL 1
abe00makoto 0:9fb6c423e32c 10 #define ACCESSORY_STRING_DESCRIPTION 2
abe00makoto 0:9fb6c423e32c 11 #define ACCESSORY_STRING_VERSION 3
abe00makoto 0:9fb6c423e32c 12 #define ACCESSORY_STRING_URI 4
abe00makoto 0:9fb6c423e32c 13 #define ACCESSORY_STRING_SERIAL 5
abe00makoto 0:9fb6c423e32c 14
abe00makoto 0:9fb6c423e32c 15 #define ACCESSORY_GET_PROTOCOL 51
abe00makoto 0:9fb6c423e32c 16 #define ACCESSORY_SEND_STRING 52
abe00makoto 0:9fb6c423e32c 17 #define ACCESSORY_START 53
abe00makoto 0:9fb6c423e32c 18
abe00makoto 0:9fb6c423e32c 19
abe00makoto 0:9fb6c423e32c 20 //void sendString(int device, int index, const char *str);
abe00makoto 0:9fb6c423e32c 21 //int getProtocol(int device);
abe00makoto 0:9fb6c423e32c 22 bool switchDevice(int device);
abe00makoto 0:9fb6c423e32c 23
abe00makoto 0:9fb6c423e32c 24 class AdkUSB
abe00makoto 0:9fb6c423e32c 25 {
abe00makoto 0:9fb6c423e32c 26 public:
abe00makoto 0:9fb6c423e32c 27 AdkUSB(int device, int configuration, int interfaceNumber);
abe00makoto 2:a05c7cbe396f 28 void setup();
abe00makoto 2:a05c7cbe396f 29 int read(u8 *buff, int len );
abe00makoto 0:9fb6c423e32c 30 int write(u8 *buff, int len );
abe00makoto 0:9fb6c423e32c 31 void loop();
abe00makoto 3:432e5675d240 32 void loopend(){
abe00makoto 3:432e5675d240 33 _loopend=true;
abe00makoto 3:432e5675d240 34 };
abe00makoto 0:9fb6c423e32c 35
abe00makoto 2:a05c7cbe396f 36
abe00makoto 2:a05c7cbe396f 37
abe00makoto 0:9fb6c423e32c 38 private:
abe00makoto 2:a05c7cbe396f 39
abe00makoto 0:9fb6c423e32c 40 int input_ep;
abe00makoto 0:9fb6c423e32c 41 int output_ep;
abe00makoto 0:9fb6c423e32c 42 int _device;
abe00makoto 0:9fb6c423e32c 43 int _configuration;
abe00makoto 0:9fb6c423e32c 44 int _interfaceNumber;
abe00makoto 3:432e5675d240 45
abe00makoto 3:432e5675d240 46 bool _loopend;
abe00makoto 0:9fb6c423e32c 47
abe00makoto 0:9fb6c423e32c 48
abe00makoto 0:9fb6c423e32c 49 };
abe00makoto 0:9fb6c423e32c 50
abe00makoto 0:9fb6c423e32c 51
abe00makoto 0:9fb6c423e32c 52
abe00makoto 0:9fb6c423e32c 53 #endif