Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
4:a91682e19d6b
Parent:
3:24c5f0f50bf1
Child:
5:9cea89700c66
--- a/SnConfigFrame.h	Tue Jul 31 04:59:16 2012 +0000
+++ b/SnConfigFrame.h	Thu Aug 02 05:42:47 2012 +0000
@@ -37,6 +37,17 @@
         kUseBits  = -BIT(10) // useful to initialize fCommSendData as a bit word
     };
     
+    enum EPowerModeBit {
+        kAmpsDatTak = BIT(0),
+        kCardDatTak = BIT(1),
+        kIridDatTak = BIT(2),
+        kAfarDatTak = BIT(3),
+        kAmpsComWin = BIT(4),
+        kCardComWin = BIT(5),
+        kIridComWin = BIT(6),
+        kAfarComWin = BIT(7)
+    };
+    
     enum ERunMode {
         kInfSeqs   = 0,
         kSingleSeq = 1
@@ -76,7 +87,7 @@
     uint8_t     fAmpsOn;                   // which amps are on (bit word. uint8_t => 8 amps max)
     uint16_t    fEvtThrtlPeriodMs;         // throttle period to write events (ms)
     // power
-    uint8_t     fPowerMode;                // power mode bit word
+    uint8_t     fPowerMode;                // power mode bit word: see EPowerModeBit
     int16_t     fBatVoltLowPwr;            // battery level at which to switch to low power (not used?)
     // communication
     uint32_t    fCommWinPeriod;            // seconds between communication window startup (0=always on)
@@ -147,6 +158,8 @@
     bool     IsDeletingFiles() const
         { return (fCommSendData<0) && ((fCommSendData & kDelete)!=0); }
     
+    uint8_t GetPowerMode() const { return fPowerMode; }
+    int     IsPoweredFor(const EPowerModeBit p) { return ((fPowerMode & p)!=0) ? 1 : 0; }
     
     const char* GetOutFileName(const char* dir) const;