Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
DualShockMod.h
00001 #ifndef DUALSHOCKMOD_H_ 00002 #define DUALSHOCKMOD_H_ 00003 00004 #include "mbed.h" 00005 00006 #define BACKLASH 28 00007 00008 extern int posX; // これをincludeしている.cs全てで共有する 00009 extern int posY; 00010 00011 00012 typedef struct st_ds { 00013 union { 00014 uint16_t ButtonData; 00015 struct { 00016 union { 00017 uint8_t ButtonLowData :8; 00018 struct { 00019 uint8_t L2 :1; 00020 uint8_t R2 :1; 00021 uint8_t L1 :1; 00022 uint8_t R1 :1; 00023 uint8_t TRIANGLE :1; 00024 uint8_t CIRCLE :1; 00025 uint8_t CROSS :1; 00026 uint8_t SQUARE :1; 00027 }; 00028 }; 00029 union { 00030 uint8_t ButtonHighData :8; 00031 struct { 00032 uint8_t SELECT :1; 00033 uint8_t L3 :1; 00034 uint8_t R3 :1; 00035 uint8_t START :1; 00036 uint8_t UP :1; 00037 uint8_t RIGHT :1; 00038 uint8_t DOWN :1; 00039 uint8_t LEFT :1; 00040 }; 00041 }; 00042 }; 00043 }BUTTON; 00044 struct { 00045 float LY; 00046 float LX; 00047 float RY; 00048 float RX; 00049 }ANALOG; 00050 } tDSParm; 00051 00052 extern tDSParm hDS; 00053 00054 00055 /** 00056 * @brief Function to initialize the encoder 00057 * @param mode see definition above 00058 */ 00059 extern uint8_t InitDS(Serial* f_serial); 00060 extern void ReStartDS(void); 00061 /** 00062 * @brief Function to initialize the encoder 00063 * @retval *pParm see definition above 00064 */ 00065 extern void getDSdata(void); 00066 #endif /* DUALSHOCK_H_ */ 00067
Generated on Wed Jul 13 2022 04:06:48 by
1.7.2