semin ahn / Mbed OS zeta_stm_kinetic

Dependencies:   BufferedSerial

Revision:
3:a4677501ae87
Parent:
2:0de4854743f7
--- a/configurations/pinConfig.h	Thu Jun 10 01:23:00 2021 +0000
+++ b/configurations/pinConfig.h	Tue Nov 30 08:13:05 2021 +0000
@@ -1,58 +1,103 @@
- #ifndef PINCONFIG_H_
+#ifndef PINCONFIG_H_
 #define PINCONFIG_H_
 #include "mbed.h"
 #include "mbed_config.h"
 
-#define PIN_NC  PF_0
 /* PORTA -------------------------------------------------------------------- */
-#define SPI1_SCK      PA_5
-#define SPI1_MISO     PA_6
-#define SPI1_MOSI     PA_7
-
 
 /* PORTB -------------------------------------------------------------------- */
-#define SSR_CON1      PB_10
-#define SSR_CON2      PB_11
+#define SSR_CON_01  PB_10
+#define SSR_CON_02  PB_11
 /* PORTC -------------------------------------------------------------------- */
 
-
 /* PORTD -------------------------------------------------------------------- */
-//#define PURIFIER_BR   PD_7
-#define EMERGENCY     PD_11
-
+#define EMERGENCY_01  PD_11
 
 /* PORTE -------------------------------------------------------------------- */
 #define BT_RX         PE_0
 #define BT_TX         PE_1
 #define IMU_SCK       PE_2
-#define SONAR_TRIG0   PE_3
+#define TRIG          PE_3
 #define IMU_MISO      PE_5
 #define IMU_MOSI      PE_6
-
+#define BUMPER_04     PE_9
+#define EMERGENCY_02  PE_10
+#define BUMPER_03     PE_11
+#define EMERGENCY_03  PE_12
+#define BUMPER_02     PE_13
+#define EMERGENCY_04  PE_14
+#define BUMPER_01     PE_15
 /* PORTF -------------------------------------------------------------------- */
-//#define PURIFIER_PWM  PF_7
-#define RELAY_CTRL1   PF_12
-#define RELAY_CTRL2   PF_13
-#define RELAY_CTRL3   PF_14
-#define RELAY_CTRL4   PF_15
+#define RELAY_CTRL1  PF_12
+#define RELAY_CTRL2  PF_13
+#define RELAY_CTRL3  PF_14
+#define RELAY_CTRL4  PF_15
 
 /* PORTG -------------------------------------------------------------------- */
-#define IMU_INT       PG_0
-#define IMU_NCS       PG_1
-#define SONAR_ECHO0   PG_2
-#define SONAR_ECHO1   PG_3
-#define SONAR_ECHO2   PG_4
-#define SONAR_ECHO3   PG_5
-#define SONAR_ECHO4   PG_6
-#define SONAR_ECHO5   PG_7
-#define SONAR_ECHO6   PG_8
-#define SONAR_ECHO7   PG_9
-#define SONAR_ECHO8   PG_10
-#define SONAR_ECHO9   PG_11
-#define SONAR_ECHO10  PG_12
+#define IMU_INT   PG_0
+#define IMU_NCS   PG_1
+#define RS_ECH01  PG_2
+#define RS_ECH02  PG_3
+#define RS_ECH03  PG_4
+#define RS_ECH04  PG_5
+#define RS_ECH05  PG_6
+#define RS_ECH06  PG_7
+#define RS_ECH07  PG_8
+#define RU_ECH01  PG_9
+#define RU_ECH02  PG_10
+#define RU_ECH03  PG_11
+#define RU_ECH04  PG_12
+
+/* PORTH -------------------------------------------------------------------- */
+
+
+/* Definition according to the robot model */
+
+#if ((ROBOT_TYPE == MODEL_C) || (ROBOT_TYPE == MODEL_D))
+#define CHARGE_RELAYP  SSR_CON_01
+#define CHARGE_RELAYN  SSR_CON_02
+#define EMERGENCY_STOP  EMERGENCY_01
+#endif
+
+#if (ROBOT_TYPE == MODEL_D)
+#define LEVEL_SENSE     EMERGENCY_04
+#endif
 
-/* CUSTOM */
-#define CHARGE_RELAYP  SSR_CON1
-#define CHARGE_RELAYN  SSR_CON2
+#if (ROBOT_TYPE == MODEL_I)
+#undef IMU_SCK
+#undef IMU_MISO
+#undef IMU_MOSI
+#undef IMU_NCS
+#undef IMU_INT
+#undef BT_RX
+#undef BT_TX
+#undef TRIG
+#define SPI1_SCK   PA_5
+#define SPI1_MISO  PA_6
+#define SPI1_MOSI  PA_7
+#define SSR_CTRL       PB_15
+#define SCRUBBER_CTRL  PB_1
+#define IMU_SCK   SPI1_SCK
+#define IMU_MISO  SPI1_MISO
+#define IMU_MOSI  SPI1_MOSI
+#define LIDAR_DETECT_OBSTACLE  PE_6
+#define RESERVE_PIN            PE_11
+#define IMU_NCS                PE_12
+#define IMU_INT                PE_14
+#define SONAR_LEFT     PF_3
+#define BT_RX          PF_6
+#define BT_TX          PF_7
+#define SONAR_TRIG     PF_11
+#define SONAR_RIGHT    PF_15
+#define LIDAR_WARNING1     PG_9
+#define IGNORE_WARNING2    PG_10
+#define LIDAR_DUSTSENSING  PG_11
+#define LIDAR_WARNING2     PG_12
+#define EMERGENCY_STOP     PG_13
+#define IGNORE_WARNING1    PG_15
 
-#endif /* PINCONFIG_H_ */
+
+
+#endif
+
+#endif /* PINCONFIG_H_ */
\ No newline at end of file