Buffer Interface
CXPReg.hpp
Go to the documentation of this file.
1 #include "BiApi.h"
2 
3 #include "BFException.hpp"
4 
5 #include <vector>
6 
24 namespace CXPReg
25 {
26  // Class to access the CXP camera register of a device on a specified BitFlow board.
27  class BFDLL Device
28  {
29  public:
30  Device (BFVOID);
31  ~Device (BFVOID);
32 
33  // Open a board with the given index.
34  BFVOID open (const BFU32 boardNumber);
35 
36  // Open a board with the given switch setting and connector index.
37  BFVOID openSWConnector (const BFU32 Switch, const BFU32 Connector);
38 
39  // Close the currently open board, if any.
40  BFVOID close (BFVOID);
41 
42  // Returns if a board is open or not.
43  BFBOOL isOpen (BFVOID) const;
44 
45  // Returns whether or not the open board is a CXP board or not. If not,
46  // than the CXP register functions will fail.
47  BFBOOL isCxp (BFVOID) const;
48 
49  // Return the opened board number. Returns ~BFU32(0), if the board isn't open, or wasn't
50  // opened with a board number (see getBoardSWConnector).
51  BFU32 getBoardNumber (BFVOID) const;
52 
53  // Retrieve the opened board switch and connector. Retrieves ~BFU32(0), if the board isn't
54  // open, or wasn't opened with openSWConnector (see getBoardNumber).
55  BFVOID getBoardSWConnector (BFU32 &Switch, BFU32 &Connector) const;
56 
57  // Read the value of the CXP register at the given address.
58  BFU32 readReg (const BFU32 address) const;
59  BFU32 readReg (const BFU32 link, const BFU32 address) const;
60 
61  // Write the value of the CXP register at the given address.
62  BFVOID writeReg (const BFU32 address, const BFU32 value);
63  BFVOID writeReg (const BFU32 link, const BFU32 address, const BFU32 value);
64 
65  // Read the values from a sequence of CoaXPress registers, returning
66  // the length of data read. Store as much of the output data as can be
67  // in the dataOut buffer, dropping any data that won't fit. In the variants
68  // using std::vector, the vector will be resized to fit at least the size
69  // of bytesToRead.
70  BFSIZET readData (const BFU32 address, const BFU32 bytesToRead, std::vector<BFU8> &dataOut) const;
71  BFSIZET readData (const BFU32 address, const BFU32 bytesToRead, BFU8 *const dataOut, const BFSIZET dataOutSize) const;
72  BFSIZET readData (const BFU32 link, const BFU32 address, const BFU32 bytesToRead, std::vector<BFU8> &dataOut) const;
73  BFSIZET readData (const BFU32 link, const BFU32 address, const BFU32 bytesToRead, BFU8 *const dataOut, const BFSIZET dataOutSize) const;
74 
75  // Write data to a sequence of CoaXPress registers.
76  BFVOID writeData (const BFU32 address, std::vector<BFU8> const& dataIn);
77  BFVOID writeData (const BFU32 address, const BFU8 *const dataIn, const BFSIZET dataInSize);
78  BFVOID writeData (const BFU32 link, const BFU32 address, std::vector<BFU8> const& dataIn);
79  BFVOID writeData (const BFU32 link, const BFU32 address, const BFU8 *const dataIn, const BFSIZET dataInSize);
80 
81  private:
82  struct PrivateData;
83  PrivateData &m_pd;
84 
85  // Device is non-copyable.
86  Device (Device const&);
87  Device& operator= (Device const&);
88  };
89 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Class library for CoaXPress camera register access.
Interface to access and modify registers on a CoaXPress camera.
Definition: CXPReg.hpp:27
size_t BFSIZET
Definition: BFTypeNT.h:93
void BFVOID
Definition: BFTypeNT.h:32
unsigned char BFU8
Definition: BFTypeNT.h:59
int BFBOOL
Definition: BFTypeNT.h:34