daad
Dependencies: mbed TrapezoidControl QEI
Input/Switch/Switch.h@1:b1219d8ca117, 2018-09-10 (annotated)
- Committer:
- 7ka884
- Date:
- Mon Sep 10 01:39:15 2018 +0000
- Revision:
- 1:b1219d8ca117
- Parent:
- 0:669ef71cba68
- Child:
- 16:3f2c2d89372b
A
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
t_yamamoto | 0:669ef71cba68 | 1 | #ifndef SWITCH_H_ |
t_yamamoto | 0:669ef71cba68 | 2 | #define SWITCH_H_ |
t_yamamoto | 0:669ef71cba68 | 3 | |
t_yamamoto | 0:669ef71cba68 | 4 | #include "mbed.h" |
t_yamamoto | 0:669ef71cba68 | 5 | #include <stdint.h> |
t_yamamoto | 0:669ef71cba68 | 6 | |
t_yamamoto | 0:669ef71cba68 | 7 | namespace SWITCH { |
t_yamamoto | 0:669ef71cba68 | 8 | #define SW_ON 0 |
t_yamamoto | 0:669ef71cba68 | 9 | #define SW_OFF 1 |
t_yamamoto | 0:669ef71cba68 | 10 | |
7ka884 | 1:b1219d8ca117 | 11 | |
7ka884 | 1:b1219d8ca117 | 12 | #define DIP0_PIN PA_8 |
7ka884 | 1:b1219d8ca117 | 13 | #define DIP1_PIN PB_10 |
7ka884 | 1:b1219d8ca117 | 14 | #define DIP2_PIN PB_4 |
7ka884 | 1:b1219d8ca117 | 15 | #define DIP3_PIN PB_5 |
t_yamamoto | 0:669ef71cba68 | 16 | |
7ka884 | 1:b1219d8ca117 | 17 | //マルチプレクサ |
t_yamamoto | 0:669ef71cba68 | 18 | #define LS_PIN PB_6 |
t_yamamoto | 0:669ef71cba68 | 19 | #define SELECT0_PIN PC_8 |
t_yamamoto | 0:669ef71cba68 | 20 | #define SELECT1_PIN PC_9 |
t_yamamoto | 0:669ef71cba68 | 21 | #define SELECT2_PIN PB_9 |
t_yamamoto | 0:669ef71cba68 | 22 | #define SELECT3_PIN PB_8 |
t_yamamoto | 0:669ef71cba68 | 23 | |
7ka884 | 1:b1219d8ca117 | 24 | //Dipsw |
t_yamamoto | 0:669ef71cba68 | 25 | #define DIP0 dipSw[0] |
t_yamamoto | 0:669ef71cba68 | 26 | #define DIP1 dipSw[1] |
t_yamamoto | 0:669ef71cba68 | 27 | #define DIP2 dipSw[2] |
t_yamamoto | 0:669ef71cba68 | 28 | #define DIP3 dipSw[3] |
t_yamamoto | 0:669ef71cba68 | 29 | |
t_yamamoto | 0:669ef71cba68 | 30 | class DipSw { |
t_yamamoto | 0:669ef71cba68 | 31 | public: |
t_yamamoto | 0:669ef71cba68 | 32 | static void Initialize(); |
t_yamamoto | 0:669ef71cba68 | 33 | static uint8_t GetStatus(); |
t_yamamoto | 0:669ef71cba68 | 34 | }; |
t_yamamoto | 0:669ef71cba68 | 35 | |
t_yamamoto | 0:669ef71cba68 | 36 | class LimitSw { |
t_yamamoto | 0:669ef71cba68 | 37 | public: |
t_yamamoto | 0:669ef71cba68 | 38 | static void Initialize(); |
t_yamamoto | 0:669ef71cba68 | 39 | static bool IsPressed(int index); |
t_yamamoto | 0:669ef71cba68 | 40 | }; |
t_yamamoto | 0:669ef71cba68 | 41 | |
t_yamamoto | 0:669ef71cba68 | 42 | typedef union { |
t_yamamoto | 0:669ef71cba68 | 43 | struct { |
t_yamamoto | 0:669ef71cba68 | 44 | int s0 : 1; |
t_yamamoto | 0:669ef71cba68 | 45 | int s1 : 1; |
t_yamamoto | 0:669ef71cba68 | 46 | int s2 : 1; |
t_yamamoto | 0:669ef71cba68 | 47 | int s3 : 1; |
t_yamamoto | 0:669ef71cba68 | 48 | int : 4; |
t_yamamoto | 0:669ef71cba68 | 49 | }; |
t_yamamoto | 0:669ef71cba68 | 50 | uint8_t all; |
t_yamamoto | 0:669ef71cba68 | 51 | } MP_Channel; |
t_yamamoto | 0:669ef71cba68 | 52 | } |
t_yamamoto | 0:669ef71cba68 | 53 | |
t_yamamoto | 0:669ef71cba68 | 54 | #endif |