0910

Dependencies:   mbed QEI2

Committer:
Hase_jun
Date:
Wed Sep 12 09:07:30 2018 +0000
Revision:
0:2a0c62e53e9c
0912

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Hase_jun 0:2a0c62e53e9c 1 #ifndef DUALSHOCKMOD_H_
Hase_jun 0:2a0c62e53e9c 2 #define DUALSHOCKMOD_H_
Hase_jun 0:2a0c62e53e9c 3
Hase_jun 0:2a0c62e53e9c 4 #include "mbed.h"
Hase_jun 0:2a0c62e53e9c 5
Hase_jun 0:2a0c62e53e9c 6 #define BACKLASH 28
Hase_jun 0:2a0c62e53e9c 7
Hase_jun 0:2a0c62e53e9c 8 extern int posX; // これをincludeしている.cs全てで共有する
Hase_jun 0:2a0c62e53e9c 9 extern int posY;
Hase_jun 0:2a0c62e53e9c 10
Hase_jun 0:2a0c62e53e9c 11
Hase_jun 0:2a0c62e53e9c 12 typedef struct st_ds {
Hase_jun 0:2a0c62e53e9c 13 union {
Hase_jun 0:2a0c62e53e9c 14 uint16_t ButtonData;
Hase_jun 0:2a0c62e53e9c 15 struct {
Hase_jun 0:2a0c62e53e9c 16 union {
Hase_jun 0:2a0c62e53e9c 17 uint8_t ButtonLowData :8;
Hase_jun 0:2a0c62e53e9c 18 struct {
Hase_jun 0:2a0c62e53e9c 19 uint8_t L2 :1;
Hase_jun 0:2a0c62e53e9c 20 uint8_t R2 :1;
Hase_jun 0:2a0c62e53e9c 21 uint8_t L1 :1;
Hase_jun 0:2a0c62e53e9c 22 uint8_t R1 :1;
Hase_jun 0:2a0c62e53e9c 23 uint8_t TRIANGLE :1;
Hase_jun 0:2a0c62e53e9c 24 uint8_t CIRCLE :1;
Hase_jun 0:2a0c62e53e9c 25 uint8_t CROSS :1;
Hase_jun 0:2a0c62e53e9c 26 uint8_t SQUARE :1;
Hase_jun 0:2a0c62e53e9c 27 };
Hase_jun 0:2a0c62e53e9c 28 };
Hase_jun 0:2a0c62e53e9c 29 union {
Hase_jun 0:2a0c62e53e9c 30 uint8_t ButtonHighData :8;
Hase_jun 0:2a0c62e53e9c 31 struct {
Hase_jun 0:2a0c62e53e9c 32 uint8_t SELECT :1;
Hase_jun 0:2a0c62e53e9c 33 uint8_t L3 :1;
Hase_jun 0:2a0c62e53e9c 34 uint8_t R3 :1;
Hase_jun 0:2a0c62e53e9c 35 uint8_t START :1;
Hase_jun 0:2a0c62e53e9c 36 uint8_t UP :1;
Hase_jun 0:2a0c62e53e9c 37 uint8_t RIGHT :1;
Hase_jun 0:2a0c62e53e9c 38 uint8_t DOWN :1;
Hase_jun 0:2a0c62e53e9c 39 uint8_t LEFT :1;
Hase_jun 0:2a0c62e53e9c 40 };
Hase_jun 0:2a0c62e53e9c 41 };
Hase_jun 0:2a0c62e53e9c 42 };
Hase_jun 0:2a0c62e53e9c 43 }BUTTON;
Hase_jun 0:2a0c62e53e9c 44 struct {
Hase_jun 0:2a0c62e53e9c 45 float LY;
Hase_jun 0:2a0c62e53e9c 46 float LX;
Hase_jun 0:2a0c62e53e9c 47 float RY;
Hase_jun 0:2a0c62e53e9c 48 float RX;
Hase_jun 0:2a0c62e53e9c 49 }ANALOG;
Hase_jun 0:2a0c62e53e9c 50 } tDSParm;
Hase_jun 0:2a0c62e53e9c 51
Hase_jun 0:2a0c62e53e9c 52 extern tDSParm hDS;
Hase_jun 0:2a0c62e53e9c 53
Hase_jun 0:2a0c62e53e9c 54
Hase_jun 0:2a0c62e53e9c 55 /**
Hase_jun 0:2a0c62e53e9c 56 * @brief Function to initialize the encoder
Hase_jun 0:2a0c62e53e9c 57 * @param mode see definition above
Hase_jun 0:2a0c62e53e9c 58 */
Hase_jun 0:2a0c62e53e9c 59 extern uint8_t InitDS(Serial* f_serial);
Hase_jun 0:2a0c62e53e9c 60 extern void ReStartDS(void);
Hase_jun 0:2a0c62e53e9c 61 /**
Hase_jun 0:2a0c62e53e9c 62 * @brief Function to initialize the encoder
Hase_jun 0:2a0c62e53e9c 63 * @retval *pParm see definition above
Hase_jun 0:2a0c62e53e9c 64 */
Hase_jun 0:2a0c62e53e9c 65 extern void getDSdata(void);
Hase_jun 0:2a0c62e53e9c 66 #endif /* DUALSHOCK_H_ */
Hase_jun 0:2a0c62e53e9c 67