三浦 颯太
/
MB2019_main_ver3
test
Switch/Switch.h@30:8f092276b2ba, 2019-10-22 (annotated)
- Committer:
- M_souta
- Date:
- Tue Oct 22 02:03:26 2019 +0000
- Revision:
- 30:8f092276b2ba
iii
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
M_souta | 30:8f092276b2ba | 1 | #ifndef SWITCH_H_ |
M_souta | 30:8f092276b2ba | 2 | #define SWITCH_H_ |
M_souta | 30:8f092276b2ba | 3 | |
M_souta | 30:8f092276b2ba | 4 | #include "mbed.h" |
M_souta | 30:8f092276b2ba | 5 | #include <stdint.h> |
M_souta | 30:8f092276b2ba | 6 | |
M_souta | 30:8f092276b2ba | 7 | namespace SWITCH { |
M_souta | 30:8f092276b2ba | 8 | |
M_souta | 30:8f092276b2ba | 9 | #define SW_ON 0 |
M_souta | 30:8f092276b2ba | 10 | #define SW_OFF 1 |
M_souta | 30:8f092276b2ba | 11 | |
M_souta | 30:8f092276b2ba | 12 | //DipSwitch |
M_souta | 30:8f092276b2ba | 13 | #define DIP0_PIN PA_4 |
M_souta | 30:8f092276b2ba | 14 | #define DIP1_PIN PA_6 |
M_souta | 30:8f092276b2ba | 15 | #define DIP2_PIN PA_7 |
M_souta | 30:8f092276b2ba | 16 | #define DIP3_PIN PC_7 |
M_souta | 30:8f092276b2ba | 17 | |
M_souta | 30:8f092276b2ba | 18 | #define DIP0 dipSw[0] |
M_souta | 30:8f092276b2ba | 19 | #define DIP1 dipSw[1] |
M_souta | 30:8f092276b2ba | 20 | #define DIP2 dipSw[2] |
M_souta | 30:8f092276b2ba | 21 | #define DIP3 dipSw[3] |
M_souta | 30:8f092276b2ba | 22 | |
M_souta | 30:8f092276b2ba | 23 | //DigitalInput |
M_souta | 30:8f092276b2ba | 24 | #define INPUT0_PIN PB_9 // INPUT18 |
M_souta | 30:8f092276b2ba | 25 | #define INPUT1_PIN PC_9 // INPUT0 |
M_souta | 30:8f092276b2ba | 26 | #define INPUT2_PIN PC_6 // INPUT2 |
M_souta | 30:8f092276b2ba | 27 | #define INPUT3_PIN PA_12 // INPUT4 |
M_souta | 30:8f092276b2ba | 28 | #define INPUT4_PIN PB_12 // INPUT6 |
M_souta | 30:8f092276b2ba | 29 | #define INPUT5_PIN PB_1 // INPUT8 |
M_souta | 30:8f092276b2ba | 30 | #define INPUT6_PIN PB_14 // INPUT10 |
M_souta | 30:8f092276b2ba | 31 | #define INPUT7_PIN PC_4 // INPUT12 |
M_souta | 30:8f092276b2ba | 32 | #define INPUT8_PIN PB_4 // INPUT14 |
M_souta | 30:8f092276b2ba | 33 | #define INPUT9_PIN PA_8 // INPUT16 |
M_souta | 30:8f092276b2ba | 34 | #define INPUT10_PIN PB_6 // INPUT19 |
M_souta | 30:8f092276b2ba | 35 | #define INPUT11_PIN PB_8 // INPUT1 |
M_souta | 30:8f092276b2ba | 36 | #define INPUT12_PIN PC_8 // INPIT3 |
M_souta | 30:8f092276b2ba | 37 | #define INPUT13_PIN PC_5 // INPUT5 |
M_souta | 30:8f092276b2ba | 38 | #define INPUT14_PIN PA_11 // INPUT7 |
M_souta | 30:8f092276b2ba | 39 | #define INPUT15_PIN PB_2 // INPUT9 |
M_souta | 30:8f092276b2ba | 40 | #define INPUT16_PIN PB_15 // INPUT11 |
M_souta | 30:8f092276b2ba | 41 | #define INPUT17_PIN PB_13 // INPUT13 |
M_souta | 30:8f092276b2ba | 42 | #define INPUT18_PIN PB_5 // INPUT15 |
M_souta | 30:8f092276b2ba | 43 | #define INPUT19_PIN PB_10 // INPUT17 |
M_souta | 30:8f092276b2ba | 44 | |
M_souta | 30:8f092276b2ba | 45 | #define INPUT_NUM 20 |
M_souta | 30:8f092276b2ba | 46 | |
M_souta | 30:8f092276b2ba | 47 | class DipSw { |
M_souta | 30:8f092276b2ba | 48 | public: |
M_souta | 30:8f092276b2ba | 49 | static void Initialize(); |
M_souta | 30:8f092276b2ba | 50 | static uint8_t GetStatus(); |
M_souta | 30:8f092276b2ba | 51 | }; |
M_souta | 30:8f092276b2ba | 52 | |
M_souta | 30:8f092276b2ba | 53 | class LimitSw { |
M_souta | 30:8f092276b2ba | 54 | public: |
M_souta | 30:8f092276b2ba | 55 | static void Initialize(); |
M_souta | 30:8f092276b2ba | 56 | static bool IsPressed(uint8_t index); |
M_souta | 30:8f092276b2ba | 57 | }; |
M_souta | 30:8f092276b2ba | 58 | } |
M_souta | 30:8f092276b2ba | 59 | |
M_souta | 30:8f092276b2ba | 60 | #endif |