My Project  v0.0.16
MiniPODMasterNode.hpp
Go to the documentation of this file.
1 
8 #ifndef MP7_MINIPODMASTERNODE_HPP
9 #define MP7_MINIPODMASTERNODE_HPP
10 
11 #include "mp7/I2CMasterNode.hpp"
12 
13 // Temporary inclusion
14 #include "mp7/MiniPODNode.hpp"
15 
16 namespace mp7 {
17 
18 // Forward declarations
19 class MiniPODRxSlave;
20 class MiniPODTxSlave;
21 
25 class MiniPODMasterNode : public opencores::I2CBaseNode {
27 
28 public:
29 
30  MiniPODMasterNode(const uhal::Node& aNode);
31 
32  MiniPODMasterNode(const MiniPODMasterNode& aOther);
33 
34  virtual ~MiniPODMasterNode();
35 
36  const MiniPODRxSlave& getRxPOD(const std::string& name) const;
37  const MiniPODTxSlave& getTxPOD(const std::string& name) const;
38 
39  std::vector<std::string> getRxPODs() const;
40  std::vector<std::string> getTxPODs() const;
41 
42 protected:
43  boost::unordered_map<std::string, MiniPODRxSlave*> mRxPODs;
44  boost::unordered_map<std::string, MiniPODTxSlave*> mTxPODs;
45 private:
47  void constructor();
48 };
49 
53 class MiniPODSlave : public opencores::I2CSlave {
54 public:
55  MiniPODSlave(const opencores::I2CBaseNode* aMaster, uint8_t aSlaveAddress);
56  virtual ~MiniPODSlave();
57 
58  virtual Measurement get3v3();
59  virtual Measurement get2v5();
60  virtual Measurement getTemp();
61  virtual Measurement getOnTime();
62  virtual std::vector < Measurement > getOpticalPowers();
63 
64  virtual void setChannelPolarity(const uint32_t& aMask);
65  virtual void disableChannel(const uint32_t& aMask);
66  virtual void disableSquelch(const bool& aDisabled);
67 
68  virtual std::pair< bool, bool > getAlarmTemp();
69  virtual std::pair< bool, bool > getAlarm3v3();
70  virtual std::pair< bool, bool > getAlarm2v5();
71  virtual std::vector< bool > getAlarmLOS();
72  virtual std::vector< std::pair< bool, bool > > getAlarmOpticalPower();
73 
74  virtual MiniPODinfo getInfo();
75 
76 protected:
77  uint16_t getUint16(const uint32_t& aMSB, const uint32_t& aLSB);
78  std::vector<uint8_t> block_read(const uint32_t& aI2CbusAddress, const uint32_t aSize);
79 
80 };
81 
85 class MiniPODRxSlave : public MiniPODSlave {
86 public:
87  MiniPODRxSlave(const opencores::I2CBaseNode* aMaster, uint8_t aSlaveAddress);
88  virtual ~MiniPODRxSlave();
89 
90  void setDeemphasis ( const double& aPercentage );
91  void setOutputAmplitude ( const double& aPercentage );
92 private:
93 
94 };
95 
96 class MiniPODTxSlave : public MiniPODSlave {
97 public:
98  MiniPODTxSlave(const opencores::I2CBaseNode* aMaster, uint8_t aSlaveAddress);
99  virtual ~MiniPODTxSlave();
100 
101  virtual std::vector < Measurement > getBiasCurrents();
102 
103  virtual void setInputEqualization ( const double& aPercentage );
104 
105  virtual void marginMode ( const bool& aEnabled );
106 
107  virtual std::vector< bool > getAlarmFault();
108  virtual std::vector< std::pair< bool , bool > > getAlarmBiasCurrent();
109 private:
110 
111 };
112 
113 
114 
115 }
116 
117 #endif /* MP7_MINIPODMASTERNODE_HPP */
118 
-test-ipbusaccess
Definition: AlignmentNode.hpp:15
UHAL_DERIVEDNODE(MiniPODMasterNode)
boost::unordered_map<std::string, MiniPODTxSlave*> mTxPODs
Definition: MiniPODMasterNode.hpp:44
const MiniPODRxSlave& getRxPOD(const std::string& name) const
Definition: MiniPODMasterNode.cpp:73
MiniPODMasterNode(const uhal::Node& aNode)
Definition: MiniPODMasterNode.cpp:29
const MiniPODTxSlave& getTxPOD(const std::string& name) const
Definition: MiniPODMasterNode.cpp:84
std::vector<std::string> getTxPODs() const
Definition: MiniPODMasterNode.cpp:102
boost::unordered_map<std::string, MiniPODRxSlave*> mRxPODs
Definition: MiniPODMasterNode.hpp:43
Brief description.
virtual ~MiniPODMasterNode()
Definition: MiniPODMasterNode.cpp:37
std::vector<std::string> getRxPODs() const
Definition: MiniPODMasterNode.cpp:95
void constructor()
Construct the object from uhal::Node.
Definition: MiniPODMasterNode.cpp:51
name
Definition: setup.py:8