Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

SnConstants.h

Committer:
uci1
Date:
2013-07-30
Revision:
39:2f17131d22a5
Parent:
38:9070c17536cd
Child:
40:1324da35afd4

File content as of revision 39:2f17131d22a5:

#ifndef SN_SnConstants
#define SN_SnConstants

#include "SnBitUtils.h"
#include "SnCommConstants.h"

//
// constants
//
static const bool     kIridAfarPwrSame  = false; // true if Iridium & Afar are on the same relay, false if not
static const uint32_t kBStime           = 946684800u; // 1/1/2000 00:00:00 UTC
static const uint8_t  kNchans           = 4u;
static const uint8_t  kNsamps           = 128u;
static const uint8_t  kNfpgaDacs        = 4u;
static const uint8_t  kNplas            = 5u;//72;
static const uint16_t kNoTrigPla        = 0x0000u;
static const uint8_t  kNcomms           = 1u;
static const uint16_t kNvoltsAve        = 500u; // must be greater than ~10 (but not checked. <2 will result in divide by 0)
static const float    kAsfClkPrdUs      = 8.535; // us -- change kAdcToMBtimeCut if this is <=2us

static const uint32_t kAbsMaxTimer      = 1800u; // timers use integers counting us and can't go longer than ~ this many secs

// safety nets
static const float    kMinForcePer      = 0.05;   // seconds -- safety net for max force trigger rate
static const uint16_t kMaxThrottlePerMs = 60000;  // ms -- max time between thermal triggers
static const uint16_t kMaxBatVoltLowPwr = 25000;  // ADCs -- probably futile, but try to prevent it from being in low power mode always
static const uint32_t kMaxCommWinPeriod = 259200; // seconds -- max time between communication windows
static const uint32_t kMinCommWinDur    = 300;    // seconds -- min communication window duration -- must be >= Ncomms*listen/connect timeout
static const uint32_t kMaxWatchDogPer   = 3600;   // seconds -- max time before watchdog reset on idle
static const uint32_t kMinWatchDogPer   = 30;     // seconds -- min time before watchdog reset on idle

static const uint16_t kTotSamps         = kNchans*kNsamps;
static const uint16_t kTotDacs          = kNchans*kNfpgaDacs;

static const float    kAdcToMBtimeCut   = (kNsamps*kAsfClkPrdUs)+(kAsfClkPrdUs/2.0);

enum ESnTrgTypes {
    kThmTrg=0,
    kFrcTrg,
    kExtTrg,
    kAdcToMBflag,
    
    kNumTrgs
};
                                          // order must match ESnTrgTypes
static const uint8_t kTrgBW[kNumTrgs] = { BIT(0), BIT(1), BIT(2), BIT(7) };



#endif // SN_SnConstants