irioCoreCpp Library Module
2.1.0
|
Class managing the terminals common to all other terminals that use DMAs in the RIO device. More...
#include <terminalsDMACommon.h>
Public Member Functions | |
TerminalsDMACommon (std::shared_ptr< TerminalsDMACommonImpl > impl) | |
Manages finding DMA resources common to all terminals that use them, DAQ/IMAQ. More... | |
std::uint16_t | getNCh (const std::uint32_t n) const |
Returns number of channels in specific DMA. More... | |
bool | getDMAOverflow (const std::uint16_t n) const |
Returns the FPGA DMA Overflow register of a specific DMA. More... | |
std::uint16_t | getAllDMAOverflows () const |
Returns the FPGA DMA Overflow register. More... | |
FrameType | getFrameType (const std::uint32_t n) const |
Return the type of frame used in a specific DMA. More... | |
std::vector< FrameType > | getAllFrameType () const |
Returns a vector of the frame types used by each DMA in the FPGA. More... | |
std::uint8_t | getSampleSize (const std::uint32_t n) const |
Returns the sample size of each data for a specific DMA. More... | |
std::vector< std::uint8_t > | getAllSampleSizes () const |
Returns a vector of sample sizes used by each DMA in the FPGA. More... | |
void | startDMA (const std::uint32_t n) const |
Configure a specified DMA, start it and clean its contents. More... | |
void | startAllDMAs () const |
Configures and starts all DMAs in the FPGA. More... | |
void | stopDMA (const std::uint32_t n) const |
Stops the specified DMA group. More... | |
void | stopAllDMAs () const |
Stops all DMAs in the FPGA. More... | |
void | cleanDMA (const std::uint32_t n) const |
Cleans the contents of a specified DMA group. More... | |
void | cleanAllDMAs () const |
Cleans the contents of all DMAs in the FPGA. More... | |
bool | isDMAEnable (const std::uint32_t n) const |
Returns if a DMA group is enabled or not. More... | |
void | enableDMA (const std::uint32_t n) const |
Enables a DMA group. More... | |
void | disableDMA (const std::uint32_t n) const |
Disables a DMA group. More... | |
void | enaDisDMA (const std::uint32_t n, bool enaDis) const |
Enables or disables a DMA group. More... | |
size_t | readDataNonBlocking (const std::uint32_t n, const size_t elementsToRead, std::uint64_t *data) const |
Tries to read an specified number of elements from a DMA group. More... | |
size_t | readDataBlocking (const std::uint32_t n, const size_t elementsToRead, std::uint64_t *data, const std::uint32_t timeout=0) const |
Waits to read an specified number of elements from a DMA group. More... | |
size_t | readData (const std::uint32_t n, const size_t elementsToRead, std::uint64_t *data, const bool blockRead, const std::uint32_t timeout=0) const |
Reads an specified number of elements from a DMA group. More... | |
size_t | countDMAs () const |
Returns the number of DMAs found. More... | |
Public Member Functions inherited from irio::TerminalsBase | |
TerminalsBase (std::shared_ptr< TerminalsBaseImpl > impl) | |
Base class used for terminals. More... | |
Additional Inherited Members | |
Protected Attributes inherited from irio::TerminalsBase | |
std::shared_ptr< TerminalsBaseImpl > | m_impl |
Smart pointer with the terminal implementation. | |
Class managing the terminals common to all other terminals that use DMAs in the RIO device.
Definition at line 19 of file terminalsDMACommon.h.
|
explicit |
Manages finding DMA resources common to all terminals that use them, DAQ/IMAQ.
irio::errors::NiFpgaError | Error reading resources from the FPGA |
impl | Shared pointer to the class that implements the functionality |
void irio::TerminalsDMACommon::cleanAllDMAs | ( | ) | const |
Cleans the contents of all DMAs in the FPGA.
Warning: If the DMA is running, it may lead to a situation where more data is read that is possible to clean, which may lead to a infinite loop
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
void irio::TerminalsDMACommon::cleanDMA | ( | const std::uint32_t | n | ) | const |
Cleans the contents of a specified DMA group.
Warning: If the DMA is running, it may lead to a situation where more data is read that is possible to clean, which may lead to a infinite loop
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | DMA group to clean |
size_t irio::TerminalsDMACommon::countDMAs | ( | ) | const |
Returns the number of DMAs found.
void irio::TerminalsDMACommon::disableDMA | ( | const std::uint32_t | n | ) | const |
Disables a DMA group.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
void irio::TerminalsDMACommon::enableDMA | ( | const std::uint32_t | n | ) | const |
Enables a DMA group.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
void irio::TerminalsDMACommon::enaDisDMA | ( | const std::uint32_t | n, |
bool | enaDis | ||
) | const |
Enables or disables a DMA group.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
enaDis | True to enable, false to disable |
std::uint16_t irio::TerminalsDMACommon::getAllDMAOverflows | ( | ) | const |
Returns the FPGA DMA Overflow register.
The nth bit of the register corresponds to the overflow value of the nth DMA.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
std::vector<FrameType> irio::TerminalsDMACommon::getAllFrameType | ( | ) | const |
Returns a vector of the frame types used by each DMA in the FPGA.
std::vector<std::uint8_t> irio::TerminalsDMACommon::getAllSampleSizes | ( | ) | const |
Returns a vector of sample sizes used by each DMA in the FPGA.
bool irio::TerminalsDMACommon::getDMAOverflow | ( | const std::uint16_t | n | ) | const |
Returns the FPGA DMA Overflow register of a specific DMA.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
FrameType irio::TerminalsDMACommon::getFrameType | ( | const std::uint32_t | n | ) | const |
Return the type of frame used in a specific DMA.
irio::errors::ResourceNotFoundError | Resource specified not found |
n | Number of DMA group |
std::uint16_t irio::TerminalsDMACommon::getNCh | ( | const std::uint32_t | n | ) | const |
Returns number of channels in specific DMA.
irio::errors::ResourceNotFoundError | Resource specified not found |
n | Number of DMA group |
std::uint8_t irio::TerminalsDMACommon::getSampleSize | ( | const std::uint32_t | n | ) | const |
Returns the sample size of each data for a specific DMA.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
bool irio::TerminalsDMACommon::isDMAEnable | ( | const std::uint32_t | n | ) | const |
Returns if a DMA group is enabled or not.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
size_t irio::TerminalsDMACommon::readData | ( | const std::uint32_t | n, |
const size_t | elementsToRead, | ||
std::uint64_t * | data, | ||
const bool | blockRead, | ||
const std::uint32_t | timeout = 0 |
||
) | const |
Reads an specified number of elements from a DMA group.
It can be configure to wait until there are the specified number of elements in the DMA or read nothing if there are not enough. If configured to wait, a timeout can be specified.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::DMAReadTimeout | If reading is in blocking mode, and the timeout expires waiting for enough data to be read |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
elementsToRead | Number of elements to read from the DMA |
data | Buffer to write the read data. Allocation and deallocation of data is user responsibility |
blockRead | Whether to wait until the requested number of elements (elementsToRead ) are available or not |
timeout | If blockRead is true. Max time in milliseconds to wait for the elementsToRead to be available, 0 means wait indefinitely. If blockRead is false, this parameter is ignored. |
elementsToRead
it they were. size_t irio::TerminalsDMACommon::readDataBlocking | ( | const std::uint32_t | n, |
const size_t | elementsToRead, | ||
std::uint64_t * | data, | ||
const std::uint32_t | timeout = 0 |
||
) | const |
Waits to read an specified number of elements from a DMA group.
The read operation will block until the requested number of elements are available or a timeout expires if specified.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::DMAReadTimeout | If reading is in blocking mode, and the timeout expires waiting for enough data to be read |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
elementsToRead | Number of elements to read from the DMA |
data | Buffer to write the read data. Allocation and deallocation of data is user responsibility |
timeout | Max time in milliseconds to wait for the elementsToRead to be available, 0 to wait indefinitely. |
elementsToRead
size_t irio::TerminalsDMACommon::readDataNonBlocking | ( | const std::uint32_t | n, |
const size_t | elementsToRead, | ||
std::uint64_t * | data | ||
) | const |
Tries to read an specified number of elements from a DMA group.
If there are less elements than requested nothing is read.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | Number of DMA group |
elementsToRead | Number of elements to read from the DMA |
data | Buffer to write the read data. Allocation and deallocation of data is user responsibility |
elementsToRead
it they were. void irio::TerminalsDMACommon::startAllDMAs | ( | ) | const |
Configures and starts all DMAs in the FPGA.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
void irio::TerminalsDMACommon::startDMA | ( | const std::uint32_t | n | ) | const |
Configure a specified DMA, start it and clean its contents.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | DMA group to configure and start |
void irio::TerminalsDMACommon::stopAllDMAs | ( | ) | const |
Stops all DMAs in the FPGA.
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
void irio::TerminalsDMACommon::stopDMA | ( | const std::uint32_t | n | ) | const |
Stops the specified DMA group.
irio::errors::ResourceNotFoundError | Resource specified not found |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
n | DMA to stop |