Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
119:b3d7699d0eb0
Parent:
116:8099b754fbb4
Child:
125:ce4045184366
--- a/SnConstants.h	Mon Oct 24 19:10:43 2016 +0000
+++ b/SnConstants.h	Thu Sep 21 17:53:35 2017 +0000
@@ -42,13 +42,19 @@
 static const uint8_t  kNchanDacsAtwd    = 4u;
 static const uint8_t  kNchanDacsSst     = 2u;
 static const uint8_t  kNchansFourAnt    = 4u;
+static const uint8_t  kNchansEightAnt   = 8u;
+static const uint8_t  kNchipsSst4ch     = 1u;
+static const uint8_t  kNchipsSst8ch     = 2u;
 static const uint16_t kTotSampsAtwd4ch  = kNchansFourAnt*kNsampsAtwd;
 static const uint16_t kTotDacsAtwd4ch   = kNchansFourAnt*kNchanDacsAtwd;
 static const uint16_t kTotSampsSst4ch   = kNchansFourAnt*kNsampsSst;
 static const uint16_t kTotSampsSst4ch512= kNchansFourAnt*kNsampsSst512;
+static const uint16_t kTotSampsSst8ch   = kNchansEightAnt*kNsampsSst;
 static const uint16_t kTotDacsSst4ch    = kNchansFourAnt*kNchanDacsSst;
-static const uint16_t kNstopBytesSst4ch    = kNsampsSst / BITS_IN_CHAR; // if the values change, may need to round this numebr
-static const uint16_t kNstopBytesSst4ch512 = kNsampsSst512 / BITS_IN_CHAR; // if the values change, may need to round this numebr
+static const uint16_t kTotDacsSst8ch    = kNchansEightAnt*kNchanDacsSst;
+static const uint16_t kNstopBytesSst4ch    = kNchipsSst4ch * (kNsampsSst / BITS_IN_CHAR); // if the values change, may need to round this numebr
+static const uint16_t kNstopBytesSst4ch512 = kNchipsSst4ch * (kNsampsSst512 / BITS_IN_CHAR); // if the values change, may need to round this numebr
+static const uint16_t kNstopBytesSst8ch    = kNchipsSst8ch * (kNsampsSst / BITS_IN_CHAR); // if the values change, may need to round this numebr
 
 // these are the station config sizes, and may change. they should not be used in i/o functions. i/o versions need updating as these change!
 #if CHIPBOARD==ATWD4CH
@@ -64,7 +70,9 @@
 static const uint16_t kNsamps           = kNsampsSst;
 static const uint8_t  kNchanDacs        = kNchanDacsSst;
 static const uint16_t kNstopBytes       = kNstopBytesSst4ch;
-static const uint8_t  kAllLTC2657       = 0x73u << 1; // slave address that every LTC2657 DAC chip will respond to
+static const uint8_t  kNumLTC2657s      = 1;
+static const uint8_t  kChansPerLTC2657  = 4;
+static const uint8_t  kLTC2657Adrs[]    = { 0x73u << 1 }; // slave address that every LTC2657 DAC chip will respond to
 static const uint8_t  kUpdateDacCmd     = 0x3u;       // LTC2657 DAC chip command bits that write to & update DAC value
 static const uint8_t  kMaxDacSetTries   = 3u;         // how many times to retry setting a dac in case no ACK is received from the DAC chip
 #elif (CHIPBOARD==SST4CH512) || (CHIPBOARD==SST4CH512_1GHz)
@@ -72,7 +80,19 @@
 static const uint16_t kNsamps           = kNsampsSst512;
 static const uint8_t  kNchanDacs        = kNchanDacsSst;
 static const uint16_t kNstopBytes       = kNstopBytesSst4ch512;
-static const uint8_t  kAllLTC2657       = 0x73u << 1; // slave address that every LTC2657 DAC chip will respond to
+static const uint8_t  kNumLTC2657s      = 1;
+static const uint8_t  kChansPerLTC2657  = 4;
+static const uint8_t  kLTC2657Adrs[]    = { 0x73u << 1 }; // slave address that every LTC2657 DAC chip will respond to
+static const uint8_t  kUpdateDacCmd     = 0x3u;       // LTC2657 DAC chip command bits that write to & update DAC value
+static const uint8_t  kMaxDacSetTries   = 3u;         // how many times to retry setting a dac in case no ACK is received from the DAC chip
+#elif (CHIPBOARD==SST8CH) || (CHIPBOARD==SST8CH_1GHz)
+static const uint8_t  kNchans           = kNchansEightAnt;
+static const uint16_t kNsamps           = kNsampsSst;
+static const uint8_t  kNchanDacs        = kNchanDacsSst;
+static const uint16_t kNstopBytes       = kNstopBytesSst8ch;
+static const uint8_t  kNumLTC2657s      = 2;
+static const uint8_t  kChansPerLTC2657  = 4;
+static const uint8_t  kLTC2657Adrs[]    = { 0x41u << 1, 0x32u << 1 }; // Adr[0]=1000001 (flt-flt-flt), Adr[2]=0110010 (flt-gnd-flt)
 static const uint8_t  kUpdateDacCmd     = 0x3u;       // LTC2657 DAC chip command bits that write to & update DAC value
 static const uint8_t  kMaxDacSetTries   = 3u;         // how many times to retry setting a dac in case no ACK is received from the DAC chip
 #endif