Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

Revision:
190:af7ab603c9fe
Parent:
185:5ac6ab1ed875
Child:
197:594afd088f32
--- a/inc/global.h	Wed Oct 05 21:51:01 2016 +0000
+++ b/inc/global.h	Thu Oct 06 15:24:10 2016 +0000
@@ -116,7 +116,7 @@
     float float_value;
     uint32_t uint32_value;
     uint16_t uint16_value;
-    bool valid;
+    uint32_t errflag;
     bool simulated;
 };
 
@@ -184,4 +184,88 @@
 #define RELAY_STATUS_FLOW_FAILSAFE_OFF   8
 #define RELAY_STATUS_NOT_CONTROLLED      0
 
+// ---------------------------------------------------------------------------------------------------------------------
+// pinout
+
+#define XBEE_P01 VIN    // pin 01
+#define MOD_TX   PA_2   // pin 02
+#define MOD_RX   PA_3   // pin 03
+#define SPI_MISO PA_6   // pin 04
+#define XBEE_P05 NRST   // pin 05
+#define I2C_SCL  PA_8   // pin 06
+#define I2C_SDA  PC_9   // pin 07
+#define XBEE_P08 NC     // pin 08
+#define DMOD     PA_11  // pin 09
+#define XBEE_P10 GND    // pin 10
+
+#define MOD_RE   PB_1   // pin 20
+#define MOD_DE   PB_0   // pin 19
+#define SPI_SCK  PA_5   // pin 18
+#define SPI_CS   PA_4   // pin 17
+#define DOUT2    PA_1   // pin 16
+#define DOUT1    PC_1   // pin 15
+#define XBEE_P14 NC     // pin 14
+#define DINP2    PC_13  // pin 13
+#define DINP1    PA_0   // pin 12
+#define SPI_MOSI PA_7   // pin 11
+
+#define XBEE_P21 VOUT
+#define XBEE_P22 GND
+#define XBEE_P23 PA_14
+#define XBEE_P24 PA_13
+#define XBEE_P25 PB_4
+#define XBEE_P26 PB_3
+#define CON_RX   PA_10
+#define CON_TX   PA_9
+
+// ---------------------------------------------------------------------------------------------------------------------
+// globals
+
+#define CON_BAUD 115200
+#define MOD_BAUD  19200
+
+extern I2C* i2c;
+
+// -------------------------------------------------------------------------------------------------
+// typedefs
+
+typedef struct word2byte { union
+{
+    unsigned short int value;
+    struct { unsigned char byte0; unsigned char byte1; };
+};}
+    WORD2BYTE;
+
+typedef struct sint2byte { union
+{
+    signed long int value;
+    struct { unsigned short int word0; unsigned short int word1; };
+    struct { unsigned char byte0; unsigned char byte1; unsigned char byte2; unsigned char byte3; };
+};}
+    SINT2BYTE;
+
+typedef struct uint2byte { union
+{
+    unsigned long int value;
+    struct { unsigned short int word0; unsigned short int word1; };
+    struct { unsigned char byte0; unsigned char byte1; unsigned char byte2; unsigned char byte3; };
+};}
+    UINT2BYTE;
+
+typedef struct float2byte { union
+{
+    float value;
+    struct { unsigned short int word0; unsigned short int word1; };
+    struct { unsigned char byte0; unsigned char byte1; unsigned char byte2; unsigned char byte3; };
+};}
+    FLOAT2BYTE;
+
+typedef struct float2uint { union
+{
+    float value;
+    unsigned long int uint_value;
+};}
+    FLOAT2UINT;
+// -------------------------------------------------------------------------------------------------
+
 #endif