Junichi Katsu
/
BLE_MPU6050_test6_challenge_sb
テスト用です。
RCBController.h@0:8468a4403fea, 2016-10-11 (annotated)
- Committer:
- jksoft
- Date:
- Tue Oct 11 11:09:42 2016 +0000
- Revision:
- 0:8468a4403fea
SB??ver;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:8468a4403fea | 1 | |
jksoft | 0:8468a4403fea | 2 | |
jksoft | 0:8468a4403fea | 3 | typedef union |
jksoft | 0:8468a4403fea | 4 | { |
jksoft | 0:8468a4403fea | 5 | |
jksoft | 0:8468a4403fea | 6 | struct { |
jksoft | 0:8468a4403fea | 7 | /* |
jksoft | 0:8468a4403fea | 8 | 1-2バイト目:ボタン |
jksoft | 0:8468a4403fea | 9 | UP: 0x0001 |
jksoft | 0:8468a4403fea | 10 | DOWN: 0x0002 |
jksoft | 0:8468a4403fea | 11 | RIGHT: 0x0004 |
jksoft | 0:8468a4403fea | 12 | LEFT: 0x0008 |
jksoft | 0:8468a4403fea | 13 | Y button: 0x0010 |
jksoft | 0:8468a4403fea | 14 | A button: 0x0020 |
jksoft | 0:8468a4403fea | 15 | B button: 0x0040 |
jksoft | 0:8468a4403fea | 16 | X button: 0x0100 |
jksoft | 0:8468a4403fea | 17 | L1: 0x0200 |
jksoft | 0:8468a4403fea | 18 | L2: 0x0400 |
jksoft | 0:8468a4403fea | 19 | R1: 0x0800 |
jksoft | 0:8468a4403fea | 20 | R2: 0x1000 |
jksoft | 0:8468a4403fea | 21 | START: 0x0003 |
jksoft | 0:8468a4403fea | 22 | SELECT: 0x000C |
jksoft | 0:8468a4403fea | 23 | */ |
jksoft | 0:8468a4403fea | 24 | unsigned X : 1; |
jksoft | 0:8468a4403fea | 25 | unsigned L1 : 1; |
jksoft | 0:8468a4403fea | 26 | unsigned L2 : 1; |
jksoft | 0:8468a4403fea | 27 | unsigned R1 : 1; |
jksoft | 0:8468a4403fea | 28 | unsigned R2 : 1; |
jksoft | 0:8468a4403fea | 29 | unsigned space1 : 3; |
jksoft | 0:8468a4403fea | 30 | unsigned UP : 1; |
jksoft | 0:8468a4403fea | 31 | unsigned DOWN : 1; |
jksoft | 0:8468a4403fea | 32 | unsigned RIGHT : 1; |
jksoft | 0:8468a4403fea | 33 | unsigned LEFT : 1; |
jksoft | 0:8468a4403fea | 34 | unsigned Y : 1; |
jksoft | 0:8468a4403fea | 35 | unsigned A : 1; |
jksoft | 0:8468a4403fea | 36 | unsigned B : 1; |
jksoft | 0:8468a4403fea | 37 | unsigned space2 : 1; |
jksoft | 0:8468a4403fea | 38 | /* |
jksoft | 0:8468a4403fea | 39 | 3-4バイト目:左アナログ |
jksoft | 0:8468a4403fea | 40 | 左右: 1-255 (Neutral=128) |
jksoft | 0:8468a4403fea | 41 | 上下: 1-255 (Neutral=128) |
jksoft | 0:8468a4403fea | 42 | */ |
jksoft | 0:8468a4403fea | 43 | unsigned LeftAnalogLR:8; |
jksoft | 0:8468a4403fea | 44 | unsigned LeftAnalogUD:8; |
jksoft | 0:8468a4403fea | 45 | /* |
jksoft | 0:8468a4403fea | 46 | 5-6バイト目:右アナログ |
jksoft | 0:8468a4403fea | 47 | 左右: 1-255 (Neutral=128) |
jksoft | 0:8468a4403fea | 48 | 上下: 1-255 (Neutral=128) |
jksoft | 0:8468a4403fea | 49 | */ |
jksoft | 0:8468a4403fea | 50 | unsigned RightAnalogLR:8; |
jksoft | 0:8468a4403fea | 51 | unsigned RightAnalogUD:8; |
jksoft | 0:8468a4403fea | 52 | /* |
jksoft | 0:8468a4403fea | 53 | 7-9バイト目:アクセラレータ |
jksoft | 0:8468a4403fea | 54 | X軸: 1-255 (Neutral=128) |
jksoft | 0:8468a4403fea | 55 | Y軸: 1-255 (Neutral=128) |
jksoft | 0:8468a4403fea | 56 | Z軸: 1-255 (Neutral=128) |
jksoft | 0:8468a4403fea | 57 | */ |
jksoft | 0:8468a4403fea | 58 | unsigned AcceleX:8; |
jksoft | 0:8468a4403fea | 59 | unsigned AcceleY:8; |
jksoft | 0:8468a4403fea | 60 | unsigned AcceleZ:8; |
jksoft | 0:8468a4403fea | 61 | /* |
jksoft | 0:8468a4403fea | 62 | 10バイト目:設定(向き、設定) |
jksoft | 0:8468a4403fea | 63 | 7-6bit目: アクセラレータ設定(0-3) |
jksoft | 0:8468a4403fea | 64 | 5bit目: 左アナログ(0-1) |
jksoft | 0:8468a4403fea | 65 | 4bit目: 右アナログ(0-1) |
jksoft | 0:8468a4403fea | 66 | 3-1bit目: iOSデバイス向き(1-4) |
jksoft | 0:8468a4403fea | 67 | */ |
jksoft | 0:8468a4403fea | 68 | unsigned DEV_DIR:4; |
jksoft | 0:8468a4403fea | 69 | unsigned RIGHT_ANALOG:1; |
jksoft | 0:8468a4403fea | 70 | unsigned LEFT_ANALOG:1; |
jksoft | 0:8468a4403fea | 71 | unsigned ACCELE_SETTING:2; |
jksoft | 0:8468a4403fea | 72 | }status; |
jksoft | 0:8468a4403fea | 73 | unsigned char data[10]; |
jksoft | 0:8468a4403fea | 74 | }RCBController; |