My Project  v0.0.16
MmcPipeInterface.hpp
Go to the documentation of this file.
1 #ifndef _mp7_MmcPipeInterface_hpp_
2 #define _mp7_MmcPipeInterface_hpp_
3 
4 // MP7 Headers
5 #include "uhal/DerivedNode.hpp"
6 #include "uhal/log/exception.hpp"
7 
8 #include "mp7/Firmware.hpp"
9 
10 #include <string>
11 
12 
13 namespace uhal
14 {
15  namespace exception
16  {
17  ExceptionClass ( TextExceedsSpaceAvailable , "Text exceeds space available for it in the MMC" );
18  ExceptionClass ( ReplyIndicatesError , "Reply value from MMC indicates an error" );
19  ExceptionClass ( GoldenImageIsInvolateError , "An attempt was made to modify the inviolate boot image" );
20  }
21 }
22 
23 namespace mp7
24 {
25 
26 
37  class MmcPipeInterface : public uhal::Node
38  {
39  UHAL_DERIVEDNODE ( MmcPipeInterface );
40  public:
41 
42  // PUBLIC METHODS
43  MmcPipeInterface ( const uhal::Node& ) ;
44  virtual ~MmcPipeInterface();
45 
46  public:
47  void SetDummySensor ( const uint8_t& aValue );
48 
49  void FileToSD ( const std::string& aFilename, Firmware& aFirmware );
50  XilinxBitStream FileFromSD ( const std::string& aFilename );
51 
52  void RebootFPGA ( const std::string& aFilename , const std::string& aPassword );
53  void BoardHardReset ( const std::string& aPassword );
54  void DeleteFromSD ( const std::string& aFilename , const std::string& aPassword );
55 
56  std::vector< std::string > ListFilesOnSD ( );
57  std::string GetTextSpace ( );
58 
59  public:
60  void UpdateCounters();
61 
62  const uint16_t& FPGAtoMMCDataAvailable();
63  const uint16_t& FPGAtoMMCSpaceAvailable();
64  const uint16_t& MMCtoFPGADataAvailable();
65  const uint16_t& MMCtoFPGASpaceAvailable();
66 
67  private:
68  void Send ( const uint32_t& aHeader );
69  void Send ( const uint32_t& aHeader , const uint32_t& aSizeInWords , const uint32_t* aPayload );
70  void Send ( const uint32_t& aHeader , const uint32_t& aSizeInBytes , const char* aPayload );
71 
72  std::vector< uint32_t > Receive ( );
73 
74  std::string ConvertString ( std::vector< uint32_t >::const_iterator aStart , const std::vector< uint32_t >::const_iterator& aEnd );
75 
76  private:
77  void SetTextSpace ( const std::string& aStr );
78  void EnterSecureMode ( const std::string& aPassword );
79 
80  private:
85  };
86 
87 }
88 
89 #endif /* _mp7_MmcPipeInterface_hpp_ */
90 
91 
-test-ipbusaccess
Definition: AlignmentNode.hpp:15
uint16_t mMMCtoFPGADataAvailable
Definition: MmcPipeInterface.hpp:83
uint16_t mFPGAtoMMCSpaceAvailable
Definition: MmcPipeInterface.hpp:82
uint16_t mMMCtoFPGASpaceAvailable
Definition: MmcPipeInterface.hpp:84
Definition: MmcPipeInterface.hpp:13
uint16_t mFPGAtoMMCDataAvailable
Definition: MmcPipeInterface.hpp:81
ExceptionClass( TextExceedsSpaceAvailable , "Text exceeds space available for it in the MMC" )