Interface to access and modify registers on a CoaXPress camera.
More...
#include <CXPReg.hpp>
|
| Device (BFVOID) |
|
| ~Device (BFVOID) |
|
BFVOID | open (const BFU32 boardNumber) |
|
BFVOID | openSWConnector (const BFU32 Switch, const BFU32 Connector) |
|
BFVOID | close (BFVOID) |
|
BFBOOL | isOpen (BFVOID) const |
|
BFBOOL | isCxp (BFVOID) const |
|
BFU32 | getBoardNumber (BFVOID) const |
|
BFVOID | getBoardSWConnector (BFU32 &Switch, BFU32 &Connector) const |
|
BFU32 | readReg (const BFU32 address) const |
|
BFU32 | readReg (const BFU32 link, const BFU32 address) const |
|
BFVOID | writeReg (const BFU32 address, const BFU32 value) |
|
BFVOID | writeReg (const BFU32 link, const BFU32 address, const BFU32 value) |
|
BFSIZET | readData (const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const |
|
BFSIZET | readData (const BFU32 address, const BFU32 bytesToRead, BFU8 *const dataOut, const BFSIZET dataOutSize) const |
|
BFSIZET | readData (const BFU32 link, const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const |
|
BFSIZET | readData (const BFU32 link, const BFU32 address, const BFU32 bytesToRead, BFU8 *const dataOut, const BFSIZET dataOutSize) const |
|
BFVOID | writeData (const BFU32 address, std::vector< BFU8 > const &dataIn) |
|
BFVOID | writeData (const BFU32 address, const BFU8 *const dataIn, const BFSIZET dataInSize) |
|
BFVOID | writeData (const BFU32 link, const BFU32 address, std::vector< BFU8 > const &dataIn) |
|
BFVOID | writeData (const BFU32 link, const BFU32 address, const BFU8 *const dataIn, const BFSIZET dataInSize) |
|
Interface to access and modify registers on a CoaXPress camera.
The CXPReg::Device class provides an independent interface to CoaXPres registers, as exposed by BitFlow frame grabbers. This may be used simultaneously with the BufferAcquisition classes, or completely independently. BufferAcquisition::BufferInterface implements its own CXP register methods.
Initializes a new CXPReg::Device instance.
29 : m_pd (*
new PrivateData)
Cleanup the CXPReg::Device and its resources.
References close().
BFVOID close(BFVOID)
Definition: CXPReg.cpp:92
Close the currently open board, if any.
References isOpen().
Referenced by open(), openSWConnector(), and ~Device().
95 BiBrdClose(m_pd.hBoard);
97 m_pd.hBoard =
nullptr;
99 m_pd.boardNumber = ~
BFU32(0);
100 m_pd.boardSwitch = ~
BFU32(0);
101 m_pd.boardConnector = ~
BFU32(0);
BFBOOL isOpen(BFVOID) const
Definition: CXPReg.cpp:109
unsigned long BFU32
Definition: BFTypeNT.h:55
Return the opened board number. Returns ~BFU32(0), if the board isn't open, or wasn't opened with a board number (see getBoardSWConnector).
- Returns
- The system wide BitFlow board index with which the board was opened, if the board was opened by index. ~BFU32(0), if no board is opened, or if the board was opeend by switch and connector.
135 return m_pd.boardNumber;
Retrieve the opened board switch and connector. Retrieves ~BFU32(0), if the board isn't open, or wasn't opened with openSWConnector (see getBoardNumber).
- Parameters
-
[out] | Switch | - Output value of the switch setting used to open the board, if the board has been opened by switch and connector. |
[out] | Connector | - Output value of the connector index used to open the board, if the board has been opened by switch and connector. |
150 Switch = m_pd.boardSwitch;
151 Connector = m_pd.boardConnector;
Returns whether or not the open board is a CXP board or not. If not, than the CXP register functions will fail.
- Returns
- True if a CoaXPress board is open, false otherwise.
References isOpen().
122 return isOpen() && BFIsCXP(m_pd.hBoard);
BFBOOL isOpen(BFVOID) const
Definition: CXPReg.cpp:109
Returns if a board is open or not.
- Returns
- The open status of this CXPReg::Device.
Referenced by close(), and isCxp().
111 return !!m_pd.hBoard;
Open a board with the given index.
- Parameters
-
[in] | boardNumber | - The system wide BitFlow board index of the board to open. This includes non-CXP devices. |
- Exceptions
-
References BiTypeAny, BrdOpenOptions, BiException::check(), and close().
57 m_pd.boardNumber = boardNumber;
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define BiTypeAny
Definition: BiDef.h:33
void *** Bd
Definition: BFType.h:88
BFVOID close(BFVOID)
Definition: CXPReg.cpp:92
Open a board with the given switch setting and connector index.
- Parameters
-
[in] | Switch | - The board switch setting used to determine which physical board to open. |
[in] | Connector | - The index of the connector to be opeend. |
- Exceptions
-
BiException | thrown if a board with the Switch setting cannot be found, if located board doesn't have a connector with the specified index, or if the board cannot be opened. |
References BI_CIERROR_CIBRDOPEN, BI_CIERROR_CISYSBOARDFINDSWCONNECTOR, BrdOpenOptions, BiException::check(), and close().
75 BFRC rc = CiSysBoardFindSWConnector(CISYS_TYPE_ANY, Switch, Connector, &entry);
85 m_pd.boardSwitch = Switch;
86 m_pd.boardConnector = Connector;
BFU32 BFRC
Definition: BFType.h:92
Definition: BiError.h:373
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
void *** Bd
Definition: BFType.h:88
BFVOID close(BFVOID)
Definition: CXPReg.cpp:92
Definition: BiError.h:372
BFSIZET Device::readData |
( |
const BFU32 |
address, |
|
|
const BFU32 |
bytesToRead, |
|
|
std::vector< BFU8 > & |
dataOut |
|
) |
| const |
Read the values from a sequence of CoaXPress registers, returning the length of data read.
- Parameters
-
[in] | address | - The register address on the connected CXP camera to read from. |
[in] | bytesToRead | - The number of bytes to be read. |
[out] | dataOut | - Output buffer of the data read, resized to fit the data, if necessary |
- Returns
- The number of bytes actually read.
- Exceptions
-
Referenced by readData().
226 return readData(0xFF, address, bytesToRead, dataOut);
BFSIZET readData(const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const
Definition: CXPReg.cpp:224
Read the values from a sequence of CoaXPress registers, returning the length of data read. Store as much of the output data as can be in the dataOut buffer, dropping any data that won't fit.
- Parameters
-
[in] | address | - The register address on the connected CXP camera to read from. |
[in] | bytesToRead | - The number of bytes to be read. |
[out] | dataOut | - Output buffer of the data read. Filled as much as possible, given the dataOutSize. |
[in] | dataOutSize | - Byte size of the dataOut buffer. |
- Returns
- The number of bytes actually read.
- Exceptions
-
References readData().
246 return readData(0xFF, address, bytesToRead, dataOut, dataOutSize);
BFSIZET readData(const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const
Definition: CXPReg.cpp:224
Read the values from a sequence of CoaXPress registers, returning the length of data read.
- Parameters
-
[in] | link | - The camera link to read from. |
[in] | address | - The register address on the connected CXP camera to read from. |
[in] | bytesToRead | - The number of bytes to be read. |
[out] | dataOut | - Output buffer of the data read, resized to fit the data, if necessary |
- Returns
- The number of bytes actually read.
- Exceptions
-
References readData().
265 const size_t minimumDataSize = (bytesToRead + 3) & ~3u;
266 if (dataOut.size() < minimumDataSize)
267 dataOut.resize(minimumDataSize);
269 return readData(link, address, bytesToRead, dataOut.data(), dataOut.size());
BFSIZET readData(const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const
Definition: CXPReg.cpp:224
Read the values from a sequence of CoaXPress registers, returning the length of data read. Store as much of the output data as can be in the dataOut buffer, dropping any data that won't fit.
- Parameters
-
[in] | link | - The camera link to read from. |
[in] | address | - The register address on the connected CXP camera to read from. |
[in] | bytesToRead | - The number of bytes to be read. |
[out] | dataOut | - Output buffer of the data read. Filled as much as possible, given the dataOutSize. |
[in] | dataOutSize | - Byte size of the dataOut buffer. |
- Returns
- The number of bytes actually read.
- Exceptions
-
References BFCiException::check().
291 BFCiException::check(m_pd.hBoard, BFCXPReadData(m_pd.hBoard, link, address, bytesToRead, &bytesRead, dataOut, dataOutSize) );
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFU32 Device::readReg |
( |
const BFU32 |
address | ) |
const |
Read the value of a single CoaXPress register.
- Parameters
-
[in] | address | - The register address on the connected CXP camera to read from. |
- Returns
- The value stored at the specified address.
- Exceptions
-
BFU32 readReg(const BFU32 address) const
Definition: CXPReg.cpp:163
Read the value of a single CoaXPress register.
- Parameters
-
[in] | link | - The camera link to read from. |
[in] | address | - The register address on the connected CXP camera to read from. |
- Returns
- The value stored at the specified address.
- Exceptions
-
References BFCiException::check().
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID Device::writeData |
( |
const BFU32 |
address, |
|
|
std::vector< BFU8 > const & |
dataIn |
|
) |
| |
Write data to a sequence of CoaXPress registers.
- Parameters
-
[in] | address | - The register address on the connected CXP camera to write to. |
[in] | dataIn | - The input data buffer, specifying the data to be written. |
- Exceptions
-
Referenced by writeData().
305 writeData(0xFF, address, dataIn.data(), dataIn.size());
BFVOID writeData(const BFU32 address, std::vector< BFU8 > const &dataIn)
Definition: CXPReg.cpp:303
Write data to a sequence of CoaXPress registers.
- Parameters
-
[in] | address | - The register address on the connected CXP camera to write to. |
[in] | dataIn | - The input data buffer, specifying the data to be written. |
[in] | dataInSize | - The number of bytes from dataIn that are to be written. This should be no bigger than the physical byte size of dataIn. |
- Exceptions
-
References writeData().
320 writeData(0xFF, address, dataIn, dataInSize);
BFVOID writeData(const BFU32 address, std::vector< BFU8 > const &dataIn)
Definition: CXPReg.cpp:303
BFVOID Device::writeData |
( |
const BFU32 |
link, |
|
|
const BFU32 |
address, |
|
|
std::vector< BFU8 > const & |
dataIn |
|
) |
| |
Write data to a sequence of CoaXPress registers.
- Parameters
-
[in] | link | - The camera link to write on. |
[in] | address | - The register address on the connected CXP camera to write to. |
[in] | dataIn | - The input data buffer, specifying the data to be written. |
- Exceptions
-
References writeData().
334 writeData(link, address, dataIn.data(), dataIn.size());
BFVOID writeData(const BFU32 address, std::vector< BFU8 > const &dataIn)
Definition: CXPReg.cpp:303
Write data to a sequence of CoaXPress registers.
- Parameters
-
[in] | link | - The camera link to write on. |
[in] | address | - The register address on the connected CXP camera to write to. |
[in] | dataIn | - The input data buffer, specifying the data to be written. |
[in] | dataInSize | - The number of bytes from dataIn that are to be written. This should be no bigger than the physical byte size of dataIn. |
- Exceptions
-
References BFCiException::check().
350 BFCiException::check(m_pd.hBoard, BFCXPWriteData(m_pd.hBoard, link, address, const_cast<BFU8*>(dataIn), (
BFU32)dataInSize) );
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
Write the value of a single CoaXPress register.
- Parameters
-
[in] | address | - The register address on the connected CXP camera to write to. |
[in] | value | - The value to be written. |
- Exceptions
-
BFVOID writeReg(const BFU32 address, const BFU32 value)
Definition: CXPReg.cpp:193
Write the value of a single CoaXPress register.
- Parameters
-
[in] | link | - The camera link to write on. |
[in] | address | - The register address on the connected CXP camera to write to. |
[in] | value | - The value to be written. |
- Exceptions
-
References BFCiException::check().
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
The documentation for this class was generated from the following files: