libiio
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
iio.Block Class Reference
Inheritance diagram for iio.Block:
Inheritance graph
[legend]
Collaboration diagram for iio.Block:
Collaboration graph
[legend]

Public Member Functions

 Block (IOBuffer buf, uint size)
 
int enqueue (uint bytes_used=0, bool cyclic=false)
 
int dequeue (bool nonblock=false)
 
void fill (byte[] array)
 Copy the given array of samples inside the iio.IOBuffer object. More...
 
void read (byte[] array)
 Extract the samples from the iio.IOBuffer object. More...
 
IntPtr first (Channel ch)
 Gets a pointer to the first sample from the current buffer for a specific channel. More...
 
def __init__ (self, buffer, size, _block=None)
 
def __del__ (self)
 
def __len__ (self)
 
def enqueue (self, size=None, cyclic=False)
 
def dequeue (self, nonblock=False)
 
def read (self)
 
def write (self, array)
 
def buffer (self)
 
- Public Member Functions inherited from iio._IIO_Object
def __init__ (self, hdl, parent)
 
def __eq__ (self, other)
 
- Public Member Functions inherited from iio.IIOObject
void Dispose ()
 Releases all resource used by the iio.IIOObject object. More...
 

Public Attributes

readonly uint size
 
readonly IOBuffer buf
 
 enqueued
 

Protected Member Functions

override void Destroy ()
 
- Protected Member Functions inherited from iio.IIOObject
 IIOObject (IntPtr hdl)
 

Detailed Description

Represents a contiguous block of samples.

Constructor & Destructor Documentation

◆ __init__()

def iio.Block.__init__ (   self,
  buffer,
  size,
  _block = None 
)
Initialize a new instance of the Block class.

:param buffer: type=iio.Buffer
    The iio.Buffer object that represents the hardware buffer where
    the samples will be enqueued to or dequeued from
:param size: type=int
    The size of the block, in bytes

◆ __del__()

def iio.Block.__del__ (   self)
Destroy this block.

Member Function Documentation

◆ __len__()

def iio.Block.__len__ (   self)
Size of this buffer, in bytes.

◆ buffer()

def iio.Block.buffer (   self)
Buffer corresponding to this block object.
type: iio.Buffer

◆ fill()

void iio.Block.fill ( byte []  array)
inline

Copy the given array of samples inside the iio.IOBuffer object.

Parameters
arrayA byte array containing the samples that should be written.

The number of samples written will not exceed the size of the buffer.

◆ first()

IntPtr iio.Block.first ( Channel  ch)
inline

Gets a pointer to the first sample from the current buffer for a specific channel.

Parameters
chThe channel for which to find the first sample.

◆ read() [1/2]

void iio.Block.read ( byte []  array)
inline

Extract the samples from the iio.IOBuffer object.

Parameters
arrayA byte array containing the extracted samples.

◆ read() [2/2]

def iio.Block.read (   self)
Retrieve the samples contained inside the Block object.

returns: type=bytearray
    An array containing the samples

◆ write()

def iio.Block.write (   self,
  array 
)
Copy the given array of samples inside the Block object.

:param array: type=bytearray
The array containing the samples to copy

returns: type=int
    The number of bytes written into the buffer

The documentation for this class was generated from the following files: