Arianna autonomous DAQ firmware
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
SnConstants.h@16:744ce85aede2, 2012-09-12 (annotated)
- Committer:
- uci1
- Date:
- Wed Sep 12 04:47:22 2012 +0000
- Revision:
- 16:744ce85aede2
- Parent:
- 15:f2569d8e4176
- Child:
- 21:ce51bb0ba4a5
SBD comm seems to be working. USB comm seems to be working (at 115200 baud). AFAR comm seems to be working. This version is set for USB communication and has zero text output.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
uci1 | 1:e392595b4b76 | 1 | #ifndef SN_SnConstants |
uci1 | 1:e392595b4b76 | 2 | #define SN_SnConstants |
uci1 | 1:e392595b4b76 | 3 | |
uci1 | 1:e392595b4b76 | 4 | #include "SnBitUtils.h" |
uci1 | 1:e392595b4b76 | 5 | |
uci1 | 1:e392595b4b76 | 6 | // |
uci1 | 1:e392595b4b76 | 7 | // constants |
uci1 | 1:e392595b4b76 | 8 | // |
uci1 | 1:e392595b4b76 | 9 | static const uint32_t kBStime = 946684800u; // 1/1/2000 00:00:00 UTC |
uci1 | 16:744ce85aede2 | 10 | static const double kIridEpoch = 1173325835; // 2007-3-08 03:50:35 GMT (needs to be a double) |
uci1 | 16:744ce85aede2 | 11 | static const double kSecPerIridTick = 90e-3; // 90ms/tick |
uci1 | 1:e392595b4b76 | 12 | static const uint32_t kWDFailsafe = 1200u; |
uci1 | 1:e392595b4b76 | 13 | static const uint8_t kNchans = 4u; |
uci1 | 1:e392595b4b76 | 14 | static const uint8_t kNsamps = 128u; |
uci1 | 1:e392595b4b76 | 15 | static const uint8_t kNfpgaDacs = 4u; |
uci1 | 3:24c5f0f50bf1 | 16 | static const uint8_t kNplas = 5u;//72; |
uci1 | 1:e392595b4b76 | 17 | static const uint16_t kNoTrigPla = 0x0000u; |
uci1 | 1:e392595b4b76 | 18 | static const uint8_t kNcomms = 1u; |
uci1 | 8:95a325df1f6b | 19 | static const uint16_t kNvoltsAve = 500u; // must be greater than ~10 (but not checked. <2 will result in divide by 0) |
uci1 | 16:744ce85aede2 | 20 | static const float kAsfClkPrdUs = 8.535; // us -- change kAdcToMBtimeCut if this is <=2us |
uci1 | 16:744ce85aede2 | 21 | |
uci1 | 1:e392595b4b76 | 22 | |
uci1 | 1:e392595b4b76 | 23 | static const uint32_t kAbsMaxTimer = 1800u; // timers use integers counting us and can't go longer than ~ this many secs |
uci1 | 1:e392595b4b76 | 24 | // NOTE: these times below must be less than kAbsMaxTimer (this is not checked, however) |
uci1 | 16:744ce85aede2 | 25 | static const uint32_t kDefTimeout = 300u; // seconds |
uci1 | 1:e392595b4b76 | 26 | static const uint32_t kConnectTimeout = 30u; // seconds |
uci1 | 1:e392595b4b76 | 27 | static const uint32_t kListenTimeout = 30u; // seconds |
uci1 | 16:744ce85aede2 | 28 | static const uint32_t kConnectSBDTO = 300u; // seconds |
uci1 | 1:e392595b4b76 | 29 | static const uint32_t kCommWinLongPrdTk = 300u; // seconds |
uci1 | 16:744ce85aede2 | 30 | static const uint32_t kSecsPerDay = 3600u*24u; |
uci1 | 16:744ce85aede2 | 31 | static const uint32_t kSecsPerYear = kSecsPerDay*365u; |
uci1 | 3:24c5f0f50bf1 | 32 | |
uci1 | 1:e392595b4b76 | 33 | static const uint16_t kTotSamps = kNchans*kNsamps; |
uci1 | 1:e392595b4b76 | 34 | static const uint16_t kTotDacs = kNchans*kNfpgaDacs; |
uci1 | 1:e392595b4b76 | 35 | |
uci1 | 16:744ce85aede2 | 36 | static const float kAdcToMBtimeCut = (kNsamps*kAsfClkPrdUs)+(kAsfClkPrdUs/2.0); |
uci1 | 16:744ce85aede2 | 37 | |
uci1 | 1:e392595b4b76 | 38 | enum ESnTrgTypes { |
uci1 | 16:744ce85aede2 | 39 | kThmTrg=0, |
uci1 | 16:744ce85aede2 | 40 | kFrcTrg, |
uci1 | 16:744ce85aede2 | 41 | kExtTrg, |
uci1 | 16:744ce85aede2 | 42 | kAdcToMBflag, |
uci1 | 16:744ce85aede2 | 43 | |
uci1 | 1:e392595b4b76 | 44 | kNumTrgs |
uci1 | 1:e392595b4b76 | 45 | }; |
uci1 | 16:744ce85aede2 | 46 | // order must match ESnTrgTypes |
uci1 | 16:744ce85aede2 | 47 | static const uint8_t kTrgBW[kNumTrgs] = { BIT(0), BIT(1), BIT(2), BIT(7) }; |
uci1 | 1:e392595b4b76 | 48 | |
uci1 | 1:e392595b4b76 | 49 | |
uci1 | 1:e392595b4b76 | 50 | |
uci1 | 0:664899e0b988 | 51 | #endif // SN_SnConstants |