Controller Class for Mbed.

Committer:
kikuchi8810
Date:
Fri Dec 17 10:01:19 2021 +0000
Revision:
0:4f5b9889cbc4
Controller Class for mbed.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kikuchi8810 0:4f5b9889cbc4 1
kikuchi8810 0:4f5b9889cbc4 2 // >>> Controllerまわりで使用>>>>>>>>>>>>>>>>>>>>>
kikuchi8810 0:4f5b9889cbc4 3 #define CON_ADACHI (0)
kikuchi8810 0:4f5b9889cbc4 4 #define CON_ELECOM (1)
kikuchi8810 0:4f5b9889cbc4 5 #define CON_DS4 (2)
kikuchi8810 0:4f5b9889cbc4 6
kikuchi8810 0:4f5b9889cbc4 7 #define CON_TYPE (CON_DS4)
kikuchi8810 0:4f5b9889cbc4 8
kikuchi8810 0:4f5b9889cbc4 9 #if CON_TYPE == CON_ADACHI
kikuchi8810 0:4f5b9889cbc4 10 #define MASK_BUTTON_UP 0x01
kikuchi8810 0:4f5b9889cbc4 11 #define MASK_BUTTON_RIGHT 0x02
kikuchi8810 0:4f5b9889cbc4 12 #define MASK_BUTTON_DOWN 0x04
kikuchi8810 0:4f5b9889cbc4 13 #define MASK_BUTTON_LEFT 0x08
kikuchi8810 0:4f5b9889cbc4 14 #define MASK_BUTTON_R1 0x10
kikuchi8810 0:4f5b9889cbc4 15 #define MASK_BUTTON_R2 0x20
kikuchi8810 0:4f5b9889cbc4 16 #define MASK_BUTTON_L1 0x40
kikuchi8810 0:4f5b9889cbc4 17 #define MASK_BUTTON_L2 0x80
kikuchi8810 0:4f5b9889cbc4 18
kikuchi8810 0:4f5b9889cbc4 19 #define BUTTON_UP 1
kikuchi8810 0:4f5b9889cbc4 20 #define BUTTON_RIGHT 2
kikuchi8810 0:4f5b9889cbc4 21 #define BUTTON_DOWN 3
kikuchi8810 0:4f5b9889cbc4 22 #define BUTTON_LEFT 4
kikuchi8810 0:4f5b9889cbc4 23 #define BUTTON_R1 5
kikuchi8810 0:4f5b9889cbc4 24 #define BUTTON_R2 6
kikuchi8810 0:4f5b9889cbc4 25 #define BUTTON_L1 7
kikuchi8810 0:4f5b9889cbc4 26 #define BUTTON_L2 8
kikuchi8810 0:4f5b9889cbc4 27
kikuchi8810 0:4f5b9889cbc4 28 #elif CON_TYPE == CON_ELECOM || CON_TYPE == CON_DS4
kikuchi8810 0:4f5b9889cbc4 29 #define MASK_BUTTON_X 0x0001
kikuchi8810 0:4f5b9889cbc4 30 #define MASK_BUTTON_Y 0x0002
kikuchi8810 0:4f5b9889cbc4 31 #define MASK_BUTTON_A 0x0004
kikuchi8810 0:4f5b9889cbc4 32 #define MASK_BUTTON_B 0x0008
kikuchi8810 0:4f5b9889cbc4 33
kikuchi8810 0:4f5b9889cbc4 34 #define MASK_BUTTON_SHIKAKU 0x0001
kikuchi8810 0:4f5b9889cbc4 35 #define MASK_BUTTON_SANKAKU 0x0002
kikuchi8810 0:4f5b9889cbc4 36 #define MASK_BUTTON_BATU 0x0004
kikuchi8810 0:4f5b9889cbc4 37 #define MASK_BUTTON_MARU 0x0008
kikuchi8810 0:4f5b9889cbc4 38
kikuchi8810 0:4f5b9889cbc4 39 #define MASK_BUTTON_L1 0x0010
kikuchi8810 0:4f5b9889cbc4 40 #define MASK_BUTTON_R1 0x0020
kikuchi8810 0:4f5b9889cbc4 41 #define MASK_BUTTON_L2 0x0040
kikuchi8810 0:4f5b9889cbc4 42 #define MASK_BUTTON_R2 0x0080
kikuchi8810 0:4f5b9889cbc4 43
kikuchi8810 0:4f5b9889cbc4 44 #define MASK_BUTTON_PS 0x0200 // PS4のときはPSボタン
kikuchi8810 0:4f5b9889cbc4 45 #define MASK_BUTTON_PAD 0x0100 // PS4のときはパッド
kikuchi8810 0:4f5b9889cbc4 46 #define MASK_BUTTON_JOY_L 0x0100
kikuchi8810 0:4f5b9889cbc4 47 #define MASK_BUTTON_JOY_R 0x0200
kikuchi8810 0:4f5b9889cbc4 48 #define MASK_BUTTON_BACK 0x0400
kikuchi8810 0:4f5b9889cbc4 49 #define MASK_BUTTON_START 0x0800
kikuchi8810 0:4f5b9889cbc4 50 #define MASK_BUTTON_SHARE 0x0400
kikuchi8810 0:4f5b9889cbc4 51 #define MASK_BUTTON_OPTION 0x0800
kikuchi8810 0:4f5b9889cbc4 52
kikuchi8810 0:4f5b9889cbc4 53 #define MASK_BUTTON_UP 0x1000
kikuchi8810 0:4f5b9889cbc4 54 #define MASK_BUTTON_RIGHT 0x2000
kikuchi8810 0:4f5b9889cbc4 55 #define MASK_BUTTON_DOWN 0x4000
kikuchi8810 0:4f5b9889cbc4 56 #define MASK_BUTTON_LEFT 0x8000
kikuchi8810 0:4f5b9889cbc4 57
kikuchi8810 0:4f5b9889cbc4 58 #define BUTTON_UP 12
kikuchi8810 0:4f5b9889cbc4 59 #define BUTTON_RIGHT 13
kikuchi8810 0:4f5b9889cbc4 60 #define BUTTON_DOWN 14
kikuchi8810 0:4f5b9889cbc4 61 #define BUTTON_LEFT 15
kikuchi8810 0:4f5b9889cbc4 62 #define BUTTON_R1 5
kikuchi8810 0:4f5b9889cbc4 63 #define BUTTON_R2 7
kikuchi8810 0:4f5b9889cbc4 64 #define BUTTON_L1 4
kikuchi8810 0:4f5b9889cbc4 65 #define BUTTON_L2 6
kikuchi8810 0:4f5b9889cbc4 66
kikuchi8810 0:4f5b9889cbc4 67 #endif
kikuchi8810 0:4f5b9889cbc4 68 // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<