Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL

Dependencies:   mbed

Committer:
mfwic
Date:
Sun Mar 10 18:03:46 2019 +0000
Revision:
46:0de65f1bd714
Parent:
44:741ee27c8a34
Child:
48:8e9de9ff1f22
Added slave address statements to globals.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mfwic 42:3ae73b61f657 1 //-------------------------------------------------------------------------------
mfwic 42:3ae73b61f657 2 //
mfwic 42:3ae73b61f657 3 // Treehouse Designs Inc.
mfwic 42:3ae73b61f657 4 // Colorado Springs, Colorado
mfwic 42:3ae73b61f657 5 //
mfwic 42:3ae73b61f657 6 // Copyright (c) 2016 by Treehouse Designs Inc.
mfwic 42:3ae73b61f657 7 // Copyright (c) 2018 by Agility Power Systems Inc.
mfwic 42:3ae73b61f657 8 //
mfwic 42:3ae73b61f657 9 // This code is the property of Treehouse Designs, Inc. (Treehouse) and
mfwic 42:3ae73b61f657 10 // Agility Power Systems Inc. (Agility) and may not be redistributed
mfwic 42:3ae73b61f657 11 // in any form without prior written permission from
mfwic 42:3ae73b61f657 12 // both copyright holders, Treehouse and Agility.
mfwic 42:3ae73b61f657 13 //
mfwic 42:3ae73b61f657 14 // The above copyright notice and this permission notice shall be included in
mfwic 42:3ae73b61f657 15 // all copies or substantial portions of the Software.
mfwic 42:3ae73b61f657 16 //
mfwic 42:3ae73b61f657 17 //
mfwic 42:3ae73b61f657 18 //-------------------------------------------------------------------------------
mfwic 42:3ae73b61f657 19 //
mfwic 42:3ae73b61f657 20 // REVISION HISTORY:
mfwic 42:3ae73b61f657 21 //
mfwic 42:3ae73b61f657 22 // $Author: $
mfwic 42:3ae73b61f657 23 // $Rev: $
mfwic 42:3ae73b61f657 24 // $Date: $
mfwic 42:3ae73b61f657 25 // $URL: $
mfwic 42:3ae73b61f657 26 //
mfwic 42:3ae73b61f657 27 //-------------------------------------------------------------------------------
mfwic 42:3ae73b61f657 28
mfwic 42:3ae73b61f657 29 #ifndef GLOBALS_H
mfwic 42:3ae73b61f657 30 #define GLOBALS_H
mfwic 42:3ae73b61f657 31
mfwic 42:3ae73b61f657 32
mfwic 42:3ae73b61f657 33 #ifdef DEBUG_TEST
mfwic 42:3ae73b61f657 34 #define DEBUG 1
mfwic 42:3ae73b61f657 35 #else
mfwic 42:3ae73b61f657 36 #define DEBUG 0
mfwic 42:3ae73b61f657 37 #endif
mfwic 42:3ae73b61f657 38
mfwic 42:3ae73b61f657 39 #define TRUE 1
mfwic 42:3ae73b61f657 40 #define FALSE 0
mfwic 42:3ae73b61f657 41
mfwic 42:3ae73b61f657 42 #define GET FALSE
mfwic 42:3ae73b61f657 43 #define SET TRUE
mfwic 42:3ae73b61f657 44
mfwic 42:3ae73b61f657 45 #define NO_PROMPT FALSE
mfwic 42:3ae73b61f657 46 #define WITH_PROMPT TRUE
mfwic 42:3ae73b61f657 47
mfwic 42:3ae73b61f657 48 #define ON 1
mfwic 42:3ae73b61f657 49 #define OFF 0
mfwic 42:3ae73b61f657 50
mfwic 42:3ae73b61f657 51 #define UPDATE_REFRESH_DELAY_US 500000.0
mfwic 42:3ae73b61f657 52 const unsigned int LOOP_COUNTER = 500000.0/500;
mfwic 42:3ae73b61f657 53
mfwic 42:3ae73b61f657 54 #define BOARD_ENABLE_DELAY_MS 50
mfwic 42:3ae73b61f657 55
mfwic 42:3ae73b61f657 56 #define ALLON 0x3FFF
mfwic 42:3ae73b61f657 57 const int allon[] = {1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1};
mfwic 42:3ae73b61f657 58 #define ALLOFF 0x0000
mfwic 42:3ae73b61f657 59 const int alloff[] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
mfwic 42:3ae73b61f657 60
mfwic 42:3ae73b61f657 61 #define MAX_BOARDS 12
mfwic 42:3ae73b61f657 62 #define MAX_REGISTERS 1
mfwic 42:3ae73b61f657 63
mfwic 42:3ae73b61f657 64 #define WEIGHT_BIN_WIDTH 5
mfwic 42:3ae73b61f657 65 #define BOARDS_THERMCODE_WIDTH 12
mfwic 42:3ae73b61f657 66
mfwic 42:3ae73b61f657 67 #define CURRENT_CONTROL_OFFSET 0.0
mfwic 42:3ae73b61f657 68
mfwic 42:3ae73b61f657 69 extern int menuLevel;
mfwic 42:3ae73b61f657 70
mfwic 42:3ae73b61f657 71 #define LEVEL_MAIN 0
mfwic 42:3ae73b61f657 72
mfwic 42:3ae73b61f657 73 struct adcValues{
mfwic 42:3ae73b61f657 74 unsigned short v48;
mfwic 42:3ae73b61f657 75 unsigned short v12;
mfwic 42:3ae73b61f657 76 unsigned short i12;
mfwic 42:3ae73b61f657 77 };
mfwic 42:3ae73b61f657 78
mfwic 42:3ae73b61f657 79 struct statusValues{
mfwic 42:3ae73b61f657 80 bool V48_IS_HI;
mfwic 42:3ae73b61f657 81 bool V48_IS_LO;
mfwic 42:3ae73b61f657 82 bool V12_IS_HI;
mfwic 42:3ae73b61f657 83 bool V12_IS_LO;
mfwic 42:3ae73b61f657 84 };
mfwic 42:3ae73b61f657 85
mfwic 42:3ae73b61f657 86 struct displayValues{
mfwic 42:3ae73b61f657 87 double v48f;
mfwic 42:3ae73b61f657 88 double v12f;
mfwic 42:3ae73b61f657 89 double i12f;
mfwic 42:3ae73b61f657 90 };
mfwic 42:3ae73b61f657 91
mfwic 42:3ae73b61f657 92 extern void processCommand(void);
mfwic 42:3ae73b61f657 93
mfwic 44:741ee27c8a34 94 #define I2C_MASTER 0x70
mfwic 44:741ee27c8a34 95 #define I2C_SLAVE1 0x71
mfwic 44:741ee27c8a34 96 #define I2C_SLAVE2 0x72
mfwic 44:741ee27c8a34 97 #define myI2Caddress I2C_MASTER
mfwic 46:0de65f1bd714 98 //#define myI2Caddress I2C_SLAVE1
mfwic 46:0de65f1bd714 99 //#define myI2Caddress I2C_SLAVE2
mfwic 44:741ee27c8a34 100
mfwic 44:741ee27c8a34 101 const unsigned short i2c_addr_slave1 = I2C_SLAVE1 << 1;
mfwic 44:741ee27c8a34 102 const unsigned short i2c_addr_slave2 = I2C_SLAVE2 << 1;
mfwic 44:741ee27c8a34 103
mfwic 42:3ae73b61f657 104 #endif