BlackOneとAndroidの連携デモプログラム AndroidAccessoryを改造してBlackOneとAndroidが連携できるようにしました。 サポートしているのは、デモアプリの ”Buttons” B1-SW1, B2-SW2, B3-SW3 ”LED2” RGB-LED のみです。 LCDに表示するイメージをマイクロSDカードに入れてLCDのソケットに挿入しておく必要があります。 イメージは、320X240ドットで”\Image”という名前のフォルダの直下に”10.jpg”という名前で入れてください。

Dependencies:   TextLCD mbed

Committer:
techand
Date:
Fri Dec 23 04:33:33 2011 +0000
Revision:
0:7b556109fd46

        

Who changed what in which revision?

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