C# bindings for libiio  0.21
C# bindings for libIIO
iio.Device Class Reference

iio.Device class: Contains the representation of an IIO device. More...

Inheritance diagram for iio.Device:
Collaboration diagram for iio.Device:

Public Member Functions

Channel get_channel (string name)
 Get the iio.Channel object of the specified name. More...
 
void set_trigger (Trigger trig)
 Affect a trigger to this device. More...
 
Trigger get_trigger ()
 Get the current trigger affected to this device. More...
 
uint get_sample_size ()
 Get the current sample size of the device. More...
 
void reg_write (uint addr, uint value)
 Set a value to one register of this device. More...
 
uint reg_read (uint addr)
 Read the content of a register of this device. More...
 
int set_kernel_buffers_count (uint nb)
 Sets the number of active kernel buffers for this device. More...
 
Context get_context ()
 Gets the context of the current device. More...
 
Channel find_channel (string channel, bool output)
 Finds the channel with the given name from the current device. More...
 
Attr find_attribute (string attribute)
 Finds the attribute with the given name from the current device. More...
 
Attr find_debug_attribute (string attribute)
 Finds the debug attribute with the given name from the current device. More...
 
Attr find_buffer_attribute (string attribute)
 Finds the buffer attribute with the given name from the current device. More...
 
int identify_filename (string filename, IntPtr chn_ptr, IntPtr attr)
 Finds the channel attribute coresponding to the given filename from the current device. More...
 

Public Attributes

readonly string id
 An identifier of this device. More...
 
readonly string name
 The name of this device. More...
 
readonly List< Attrattrs
 A list of all the attributes that this device has. More...
 
readonly List< Attrdebug_attrs
 A list of all the debug attributes that this device has. More...
 
readonly List< Channelchannels
 A list of all the iio.Channel objects that this device possesses. More...
 

Properties

List< Attrbuffer_attrs [get]
 A list of all the buffer attributes that this device has. More...
 

Detailed Description

iio.Device class: Contains the representation of an IIO device.

Member Function Documentation

Attr iio.Device.find_attribute ( string  attribute)
inline

Finds the attribute with the given name from the current device.

Parameters
attributeThe name of the attribute.
Returns
An instance of the iio.Device.DeviceAttr class.
Exceptions
System.ExceptionThere is no attribute with the given name.
Attr iio.Device.find_buffer_attribute ( string  attribute)
inline

Finds the buffer attribute with the given name from the current device.

Parameters
attributeThe name of the buffer attribute.
Returns
An instance of the iio.Device.DeviceBufferAttr class.
Exceptions
System.ExceptionThere is no attribute with the given name.
Channel iio.Device.find_channel ( string  channel,
bool  output 
)
inline

Finds the channel with the given name from the current device.

Parameters
channelThe name of the channel.
outputtrue if you are looking for an output channel, otherwise false.
Returns
An instance of the iio.Channel class.
Exceptions
System.ExceptionThere is no channel with the given name.
Attr iio.Device.find_debug_attribute ( string  attribute)
inline

Finds the debug attribute with the given name from the current device.

Parameters
attributeThe name of the debug attribute.
Returns
An instance of the iio.Device.DeviceDebugAttr class.
Exceptions
System.ExceptionThere is no debug attribute with the given name.
Channel iio.Device.get_channel ( string  name)
inline

Get the iio.Channel object of the specified name.

Parameters
nameName or ID of the channel to look for
Exceptions
System.ExceptionThe IIO device with the specified name or ID could not be found in the current context.
Context iio.Device.get_context ( )
inline

Gets the context of the current device.

Returns
An instance of the iio.Context class.
uint iio.Device.get_sample_size ( )
inline

Get the current sample size of the device.

The sample size varies each time channels get enabled or disabled.

Exceptions
System.ExceptionInternal error. Please report any bug.
Trigger iio.Device.get_trigger ( )
inline

Get the current trigger affected to this device.

Returns
An instance of the iio.Trigger class.
Exceptions
System.ExceptionThe instance could not be retrieved.
int iio.Device.identify_filename ( string  filename,
IntPtr  chn_ptr,
IntPtr  attr 
)
inline

Finds the channel attribute coresponding to the given filename from the current device.

Parameters
filenameThe name of the attribute.
chn_ptrOutput variable. It will contain a pointer to the resulting iio.Channel.
attrOutput variable. It will contain a pointer to the resulting iio.ChannelAttr.
Returns
C errorcode if error encountered, otherwise 0.
uint iio.Device.reg_read ( uint  addr)
inline

Read the content of a register of this device.

Parameters
addrThe address of the register concerned.
Exceptions
System.ExceptionThe register could not be read.
void iio.Device.reg_write ( uint  addr,
uint  value 
)
inline

Set a value to one register of this device.

Parameters
addrThe address of the register concerned.
valueThe value that will be used for this register.
Exceptions
System.ExceptionThe register could not be written.
int iio.Device.set_kernel_buffers_count ( uint  nb)
inline

Sets the number of active kernel buffers for this device.

Parameters
nbThe number of kernel buffers.
void iio.Device.set_trigger ( Trigger  trig)
inline

Affect a trigger to this device.

Parameters
trigA valid instance of the iio.Trigger class.
Exceptions
System.ExceptionThe trigger could not be set.

Member Data Documentation

readonly List<Attr> iio.Device.attrs

A list of all the attributes that this device has.

readonly List<Channel> iio.Device.channels

A list of all the iio.Channel objects that this device possesses.

readonly List<Attr> iio.Device.debug_attrs

A list of all the debug attributes that this device has.

readonly string iio.Device.id

An identifier of this device.

The identifier is only valid in this IIO context

readonly string iio.Device.name

The name of this device.

Property Documentation

List<Attr> iio.Device.buffer_attrs
get

A list of all the buffer attributes that this device has.


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