#include <IIODevice.H>
Maintain an IIO device. It inherits a std::vector of channels.
Definition at line 34 of file IIODevice.H.
◆ IIODevice()
| IIODevice::IIODevice |
( |
const std::string & |
devicePathIn, |
|
|
const std::string & |
chipNameIn |
|
) |
| |
|
inline |
Constructor specifying the device path and the chip name
- Parameters
-
| devicePathIn | The device's path, such as "/sys/bus/iio/devices/iio:device0" |
| chipNameIn | The device's chip, such as "AD7476A" |
Definition at line 48 of file IIODevice.H.
◆ ~IIODevice()
| virtual IIODevice::~IIODevice |
( |
| ) |
|
|
inlinevirtual |
◆ close()
| int IIODevice::close |
( |
void |
| ) |
|
|
inline |
Close the device.
- Returns
- NO_ERROR, or the arropriate error on failure.
Definition at line 163 of file IIODevice.H.
◆ enable()
| int IIODevice::enable |
( |
bool |
enable | ) |
|
|
inline |
Enable or disable the device.
- Parameters
-
| enable | True to enable, false to disable. |
- Returns
- NO_ERROR or the appropriate error on failure.
Definition at line 228 of file IIODevice.H.
◆ getBufferSize()
| int IIODevice::getBufferSize |
( |
| ) |
|
|
inline |
Find the DMA buffer size.
- Returns
- The buffer size in samples, or the appropriate error on failure.
Definition at line 240 of file IIODevice.H.
◆ getChannelBufferCnt()
| int IIODevice::getChannelBufferCnt |
( |
| ) |
|
|
inline |
Find the number of samples per channel which the buffer can hold.
- Returns
- the maximum number of samples which the buffer can hold.
Definition at line 265 of file IIODevice.H.
◆ getChCnt()
| uint IIODevice::getChCnt |
( |
void |
| ) |
|
|
inline |
Get the number of enabled channels for this device.
- Returns
- The number of enabled channels.
Definition at line 107 of file IIODevice.H.
◆ getChFrameSize()
| uint IIODevice::getChFrameSize |
( |
void |
| ) |
|
|
inline |
Find the number of bytes per channel.
- Returns
- The total number of bytes in one channel or the appropriate error on failure
Definition at line 214 of file IIODevice.H.
◆ getFD()
Get the device's file descriptor.
- Returns
- the file descriptor
Definition at line 281 of file IIODevice.H.
◆ open() [1/2]
| int IIODevice::open |
( |
void |
| ) |
|
|
inline |
Open the device.
- Returns
- NO_ERROR, or the arropriate error on failure.
Definition at line 126 of file IIODevice.H.
◆ open() [2/2]
| int IIODevice::open |
( |
int |
flags | ) |
|
|
inline |
Open the device.
- Parameters
-
| flags | The flags to open the device with. |
- Returns
- NO_ERROR, or the arropriate error on failure.
Definition at line 138 of file IIODevice.H.
◆ printInfo()
| void IIODevice::printInfo |
( |
| ) |
|
|
inline |
Print the info for each channel.
Definition at line 113 of file IIODevice.H.
◆ read()
| int IIODevice::read |
( |
uint |
frames, |
|
|
void * |
buf |
|
) |
| |
|
inline |
Read from the device.
- Parameters
-
| frames | The number of samples to read |
| buf | Pointer to the read location. |
- Returns
- NO_ERROR, or the arropriate error on failure. The buffer holds count bytes in it.
Definition at line 181 of file IIODevice.H.
◆ scanDevice()
| int IIODevice::scanDevice |
( |
void |
| ) |
|
|
inline |
Scan an IIO device for channel requirements.
- Returns
- NO_ERROR, or the arropriate error on failure.
Definition at line 63 of file IIODevice.H.
◆ setBufferSize()
| int IIODevice::setBufferSize |
( |
int |
bufferSize | ) |
|
|
inline |
Set the DMA buffer size
- Returns
- The resulting buffer size in samples for all channels, or the appropriate error on failure.
Definition at line 252 of file IIODevice.H.
◆ setChannelBufferCnt()
| int IIODevice::setChannelBufferCnt |
( |
int |
chBufferCnt | ) |
|
|
inline |
Set the number of samples per channel which the buffer can hold.
- Parameters
-
| chBufferCnt | The number of samples per channel the buffer can hold. |
- Returns
- the maximum number of samples which the buffer can hold or error.
Definition at line 273 of file IIODevice.H.
◆ chipName
| std::string IIODevice::chipName |
|
private |
◆ devicePath
| std::string IIODevice::devicePath |
|
private |
◆ fd
The file descriptor of the open device.
Definition at line 41 of file IIODevice.H.
◆ readDev
| std::string IIODevice::readDev |
|
private |
The read buffer device, e.g. "/dev/iio:device0".
Definition at line 39 of file IIODevice.H.
◆ scale
How to scale the input value to get a real world value.
Definition at line 37 of file IIODevice.H.
The documentation for this class was generated from the following file: