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 typedef unsigned char u8;
techand 0:7b556109fd46 3 typedef unsigned short u16;
techand 0:7b556109fd46 4 typedef unsigned long u32;
techand 0:7b556109fd46 5
techand 0:7b556109fd46 6 void DelayMS(int ms);
techand 0:7b556109fd46 7
techand 0:7b556109fd46 8 void printfBytes(const char* label,const u8* data, int len);
techand 0:7b556109fd46 9 void printHex(const u8* d, int len);
techand 0:7b556109fd46 10
techand 0:7b556109fd46 11 #ifndef min
techand 0:7b556109fd46 12 #define min(_a,_b) ((_a) < (_b) ? (_a) : (_b))
techand 0:7b556109fd46 13 #endif
techand 0:7b556109fd46 14
techand 0:7b556109fd46 15 inline int LE16(const u8* d)
techand 0:7b556109fd46 16 {
techand 0:7b556109fd46 17 return d[0] | (d[1] << 8);
techand 0:7b556109fd46 18 }
techand 0:7b556109fd46 19
techand 0:7b556109fd46 20 inline u32 BE32(const u8* d)
techand 0:7b556109fd46 21 {
techand 0:7b556109fd46 22 return (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
techand 0:7b556109fd46 23 }
techand 0:7b556109fd46 24
techand 0:7b556109fd46 25 inline void BE32(u32 n, u8* d)
techand 0:7b556109fd46 26 {
techand 0:7b556109fd46 27 d[0] = (u8)(n >> 24);
techand 0:7b556109fd46 28 d[1] = (u8)(n >> 16);
techand 0:7b556109fd46 29 d[2] = (u8)(n >> 8);
techand 0:7b556109fd46 30 d[3] = (u8)n;
techand 0:7b556109fd46 31 }
techand 0:7b556109fd46 32
techand 0:7b556109fd46 33 inline void BE16(u32 n, u8* d)
techand 0:7b556109fd46 34 {
techand 0:7b556109fd46 35 d[0] = (u8)(n >> 8);
techand 0:7b556109fd46 36 d[1] = (u8)n;
techand 0:7b556109fd46 37 }