Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Committer:
uci1
Date:
Wed Jun 05 17:29:31 2019 +0000
Revision:
125:ce4045184366
Added SnRateListner proto-class, publishing this version of the code in order to enable exporting of most recent features.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
uci1 125:ce4045184366 1 //Class created by J. C. Hanson
uci1 125:ce4045184366 2 //3 June 2019
uci1 125:ce4045184366 3 //Purpose: to obtain rate information directly from FPGA
uci1 125:ce4045184366 4
uci1 125:ce4045184366 5 #ifndef SN_SnRateListener
uci1 125:ce4045184366 6 #define SN_SnRateListener
uci1 125:ce4045184366 7
uci1 125:ce4045184366 8 #include "mbed.h"
uci1 125:ce4045184366 9 #include "SnConstants.h"
uci1 125:ce4045184366 10
uci1 125:ce4045184366 11 class SnRateListener
uci1 125:ce4045184366 12 {
uci1 125:ce4045184366 13 public:
uci1 125:ce4045184366 14 SnRateListener() :
uci1 125:ce4045184366 15 rateMSBs(0),
uci1 125:ce4045184366 16 rateLSBs(0),
uci1 125:ce4045184366 17 lastAcknowledge(false),
uci1 125:ce4045184366 18 MMFC_address(0x47 << 1)
uci1 125:ce4045184366 19 {};
uci1 125:ce4045184366 20 float getRate(); //Single channel rate (4-in. OR), units: MHz
uci1 125:ce4045184366 21 ~SnRateListener(){};
uci1 125:ce4045184366 22 protected:
uci1 125:ce4045184366 23 uint8_t rateMSBs;
uci1 125:ce4045184366 24 uint8_t rateLSBs;
uci1 125:ce4045184366 25 bool lastAcknowledge; //True means successfully reading from MMFC.
uci1 125:ce4045184366 26 void setMSBs(uint8_t);
uci1 125:ce4045184366 27 void setLSBs(uint8_t);
uci1 125:ce4045184366 28 void setLastAck(bool);
uci1 125:ce4045184366 29 bool getLastAck();
uci1 125:ce4045184366 30 uint8_t getMMFCAddress();
uci1 125:ce4045184366 31 private:
uci1 125:ce4045184366 32 //i2c address are left-shifted by 1 bit in mbed os 2.
uci1 125:ce4045184366 33 uint8_t MMFC_address;
uci1 125:ce4045184366 34 };
uci1 125:ce4045184366 35
uci1 125:ce4045184366 36 #endif