Taiki Maruyama
/
MainBoard2018_Auto_Master_A_neww
aaaaaaaaa
Fork of MainBoard2018_Auto_Master_A_new by
Embed:
(wiki syntax)
Show/hide line numbers
Switch.h
00001 #ifndef SWITCH_H_ 00002 #define SWITCH_H_ 00003 00004 #include "mbed.h" 00005 #include <stdint.h> 00006 00007 namespace SWITCH { 00008 #define SW_ON 0 00009 #define SW_OFF 1 00010 00011 00012 #define DIP0_PIN PA_8 00013 #define DIP1_PIN PB_10 00014 #define DIP2_PIN PB_4 00015 #define DIP3_PIN PB_5 00016 00017 //マルチプレクサ 00018 #define LS_PIN PB_6 00019 #define SELECT0_PIN PC_8 00020 #define SELECT1_PIN PC_9 00021 #define SELECT2_PIN PB_9 00022 #define SELECT3_PIN PB_8 00023 00024 //Dipsw 00025 #define DIP0 dipSw[0] 00026 #define DIP1 dipSw[1] 00027 #define DIP2 dipSw[2] 00028 #define DIP3 dipSw[3] 00029 00030 class DipSw { 00031 public: 00032 static void Initialize(); 00033 static uint8_t GetStatus(); 00034 }; 00035 00036 class LimitSw { 00037 public: 00038 static void Initialize(); 00039 static bool IsPressed(int index); 00040 }; 00041 00042 typedef union { 00043 struct { 00044 int s0 : 1; 00045 int s1 : 1; 00046 int s2 : 1; 00047 int s3 : 1; 00048 int : 4; 00049 }; 00050 uint8_t all; 00051 } MP_Channel; 00052 } 00053 00054 #endif
Generated on Wed Jul 13 2022 01:10:06 by 1.7.2