大季 矢花 / Mbed 2 deprecated MB2019_main_11_19_1735

Dependencies:   mbed

Committer:
M_souta
Date:
Fri Oct 18 22:33:25 2019 +0000
Revision:
29:44d5454ce8fa
Parent:
22:7d93f79a3686
tt

Who changed what in which revision?

UserRevisionLine numberNew 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 {
M_souta 29:44d5454ce8fa 8
t_yamamoto 0:669ef71cba68 9 #define SW_ON 0
t_yamamoto 0:669ef71cba68 10 #define SW_OFF 1
t_yamamoto 0:669ef71cba68 11
kishibekairohan 16:3f2c2d89372b 12 //DipSwitch
kishibekairohan 16:3f2c2d89372b 13 #define DIP0_PIN PA_4
kishibekairohan 16:3f2c2d89372b 14 #define DIP1_PIN PA_6
kishibekairohan 16:3f2c2d89372b 15 #define DIP2_PIN PA_7
kishibekairohan 16:3f2c2d89372b 16 #define DIP3_PIN PC_7
M_souta 29:44d5454ce8fa 17
M_souta 29:44d5454ce8fa 18 #define DIP0 dipSw[0]
M_souta 29:44d5454ce8fa 19 #define DIP1 dipSw[1]
M_souta 29:44d5454ce8fa 20 #define DIP2 dipSw[2]
M_souta 29:44d5454ce8fa 21 #define DIP3 dipSw[3]
M_souta 29:44d5454ce8fa 22
M_souta 29:44d5454ce8fa 23 /*
kishibekairohan 16:3f2c2d89372b 24 //Multiplexer
kishibekairohan 16:3f2c2d89372b 25 #define LS_PIN PD_2
kishibekairohan 16:3f2c2d89372b 26 #define SELECT0_PIN PC_12
kishibekairohan 16:3f2c2d89372b 27 #define SELECT1_PIN PA_15
kishibekairohan 16:3f2c2d89372b 28 #define SELECT2_PIN PC_13
kishibekairohan 16:3f2c2d89372b 29 #define SELECT3_PIN PB_7
M_souta 29:44d5454ce8fa 30 */
kishibekairohan 16:3f2c2d89372b 31
kishibekairohan 16:3f2c2d89372b 32
M_souta 29:44d5454ce8fa 33 //DigitalInput
M_souta 29:44d5454ce8fa 34 #define INPUT0_PIN PB_9 // INPUT18
M_souta 29:44d5454ce8fa 35 #define INPUT1_PIN PC_9 // INPUT0
M_souta 29:44d5454ce8fa 36 #define INPUT2_PIN PC_6 // INPUT2
M_souta 29:44d5454ce8fa 37 #define INPUT3_PIN PA_12 // INPUT4
M_souta 29:44d5454ce8fa 38 #define INPUT4_PIN PB_12 // INPUT6
M_souta 29:44d5454ce8fa 39 #define INPUT5_PIN PB_1 // INPUT8
M_souta 29:44d5454ce8fa 40 #define INPUT6_PIN PB_14 // INPUT10
M_souta 29:44d5454ce8fa 41 #define INPUT7_PIN PC_4 // INPUT12
M_souta 29:44d5454ce8fa 42 #define INPUT8_PIN PB_4 // INPUT14
M_souta 29:44d5454ce8fa 43 #define INPUT9_PIN PA_8 // INPUT16
M_souta 29:44d5454ce8fa 44 #define INPUT10_PIN PB_6 // INPUT19
M_souta 29:44d5454ce8fa 45 #define INPUT11_PIN PB_8 // INPUT1
M_souta 29:44d5454ce8fa 46 #define INPUT12_PIN PC_8 // INPIT3
M_souta 29:44d5454ce8fa 47 #define INPUT13_PIN PC_5 // INPUT5
M_souta 29:44d5454ce8fa 48 #define INPUT14_PIN PA_11 // INPUT7
M_souta 29:44d5454ce8fa 49 #define INPUT15_PIN PB_2 // INPUT9
M_souta 29:44d5454ce8fa 50 #define INPUT16_PIN PB_15 // INPUT11
M_souta 29:44d5454ce8fa 51 #define INPUT17_PIN PB_13 // INPUT13
M_souta 29:44d5454ce8fa 52 #define INPUT18_PIN PB_5 // INPUT15
M_souta 29:44d5454ce8fa 53 #define INPUT19_PIN PB_10 // INPUT17
M_souta 22:7d93f79a3686 54
M_souta 29:44d5454ce8fa 55 #define INPUT_NUM 20
M_souta 29:44d5454ce8fa 56
t_yamamoto 0:669ef71cba68 57 class DipSw {
t_yamamoto 0:669ef71cba68 58 public:
t_yamamoto 0:669ef71cba68 59 static void Initialize();
t_yamamoto 0:669ef71cba68 60 static uint8_t GetStatus();
t_yamamoto 0:669ef71cba68 61 };
t_yamamoto 0:669ef71cba68 62
t_yamamoto 0:669ef71cba68 63 class LimitSw {
t_yamamoto 0:669ef71cba68 64 public:
t_yamamoto 0:669ef71cba68 65 static void Initialize();
t_yamamoto 0:669ef71cba68 66 static bool IsPressed(int index);
t_yamamoto 0:669ef71cba68 67 };
t_yamamoto 0:669ef71cba68 68
t_yamamoto 0:669ef71cba68 69 typedef union {
t_yamamoto 0:669ef71cba68 70 struct {
t_yamamoto 0:669ef71cba68 71 int s0 : 1;
t_yamamoto 0:669ef71cba68 72 int s1 : 1;
t_yamamoto 0:669ef71cba68 73 int s2 : 1;
t_yamamoto 0:669ef71cba68 74 int s3 : 1;
t_yamamoto 0:669ef71cba68 75 int : 4;
t_yamamoto 0:669ef71cba68 76 };
t_yamamoto 0:669ef71cba68 77 uint8_t all;
t_yamamoto 0:669ef71cba68 78 } MP_Channel;
t_yamamoto 0:669ef71cba68 79 }
t_yamamoto 0:669ef71cba68 80
t_yamamoto 0:669ef71cba68 81 #endif