Treehouse Mbed Team / Mbed 2 deprecated 1U5_proto_X

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers boards.h Source File

boards.h

00001 //-------------------------------------------------------------------------------
00002 // 
00003 //  Treehouse Designs Inc.
00004 //  Colorado Springs, Colorado
00005 // 
00006 //  Copyright (c) 2016 by Treehouse Designs Inc. 
00007 //  Copyright (c) 2018 by Agility Power Systems Inc. 
00008 // 
00009 //  This code is the property of Treehouse Designs, Inc. (Treehouse) and
00010 //  Agility Power Systems Inc. (Agility) and may not be redistributed
00011 //  in any form without prior written permission from 
00012 //  both copyright holders, Treehouse and Agility.
00013 //
00014 //  The above copyright notice and this permission notice shall be included in
00015 //  all copies or substantial portions of the Software.
00016 // 
00017 //   
00018 //-------------------------------------------------------------------------------
00019 // 
00020 //  REVISION HISTORY:
00021 //  
00022 //   $Author: $
00023 //   $Rev: $
00024 //   $Date: $
00025 //   $URL: $
00026 // 
00027 //-------------------------------------------------------------------------------
00028 
00029 #ifndef BOARDS_H
00030 #define BOARDS_H
00031 
00032 #include "adc_defs.h"
00033 
00034 #define VOLTAGE_TOLERANCE 0.1
00035 const unsigned int V48_HI = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_48_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0+VOLTAGE_TOLERANCE);
00036 const unsigned int V48_LO = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_48_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0-VOLTAGE_TOLERANCE);
00037 const unsigned int V24_HI = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_24_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0+VOLTAGE_TOLERANCE);
00038 const unsigned int V24_LO = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_24_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0-VOLTAGE_TOLERANCE);
00039 const unsigned int V12_HI = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_12_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0+VOLTAGE_TOLERANCE);
00040 const unsigned int V12_LO = (unsigned int)ADC_SCALE_FACTOR*(VOLTAGE_12_ACTUAL_VALUE/VOLTAGE_TARG_VALUE)*(1.0-VOLTAGE_TOLERANCE);
00041 
00042 void initBoards(struct adcValues);
00043 
00044 extern bool buck;
00045 
00046 extern unsigned int boardEnableBits;
00047 extern unsigned int boardsActive;
00048 
00049 extern unsigned int en_out_code;
00050 extern unsigned int wr_out_code;
00051 
00052 //extern unsigned int bCodeArray[][];
00053 extern unsigned int bCodeRow[];
00054 
00055 void setBoardControls(unsigned int);
00056 unsigned int setBoardEnables(unsigned int);
00057 unsigned int setBoardWeights(unsigned int);
00058 
00059 int checkRange(int, int, int);
00060 
00061 void toggleLatchSignal(void);
00062 
00063 void startConverter(unsigned int);
00064 void stopConverter(void);
00065 
00066 struct statusValues checkLevels(struct adcValues);
00067 void updateControls(unsigned short);
00068 void XupdateControls(unsigned short);
00069 
00070 #endif