A program for listening to rates via i2c
Embed:
(wiki syntax)
Show/hide line numbers
SN_SnRateListener.h
00001 //Class created by J. C. Hanson 00002 //3 June 2019 00003 //Purpose: to obtain rate information directly from FPGA 00004 00005 #ifndef SN_SnRateListener 00006 #define SN_SnRateListener 00007 00008 #include "mbed.h" 00009 #include "SnConstants.h" 00010 00011 class SnRateListener 00012 { 00013 public: 00014 SnRateListener() : 00015 rateMSBs(0), 00016 rateLSBs(0), 00017 lastAcknowledge(false), 00018 MMFC_address(0x47 << 1) 00019 {}; 00020 float getRate(); //Single channel rate (4-in. OR), units: MHz 00021 ~SnRateListener(){}; 00022 protected: 00023 uint8_t rateMSBs; 00024 uint8_t rateLSBs; 00025 bool lastAcknowledge; //True means successfully reading from MMFC. 00026 void setMSBs(uint8_t); 00027 void setLSBs(uint8_t); 00028 void setLastAck(bool); 00029 bool getLastAck(); 00030 uint8_t getMMFCAddress(); 00031 private: 00032 //i2c address are left-shifted by 1 bit in mbed os 2. 00033 uint8_t MMFC_address; 00034 }; 00035 00036 #endif 00037
Generated on Mon Nov 7 2022 06:28:23 by
1.7.2