libiio
Classes | Public Member Functions | Public Attributes | Properties | List of all members
iio.Device Class Reference

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

Inheritance diagram for iio.Device:
iio._DeviceOrTrigger iio.Trigger

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...
 
def __init__ (self, ctx, _device)
 
def context (self)
 
- Public Member Functions inherited from iio._DeviceOrTrigger
def __init__ (self, _device)
 
def reg_write (self, reg, value)
 
def reg_read (self, reg)
 
def find_channel (self, name_or_id, is_output=False)
 
def set_kernel_buffers_count (self, count)
 
def sample_size (self)
 

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...
 
 ctx
 

Properties

 trigger
 
- Properties inherited from iio._DeviceOrTrigger
 id
 
 name
 
 attrs
 
 debug_attrs
 
 buffer_attrs
 
 channels
 

Detailed Description

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

Contains the representation of an IIO device.

Constructor & Destructor Documentation

§ __init__()

def iio.Device.__init__ (   self,
  ctx,
  _device 
)
Initialize a new instance of the Device class.

:param ctx: type=iio.Context
    A valid instance of the iio.Context class.
:param _device: type=_DevicePtr
    A pointer to an IIO device.

returns: type=iio.Device
    An new instance of this class

Member Function Documentation

§ context()

def iio.Device.context (   self)
Context for the device.
type: iio.Context

§ get_channel()

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.

§ get_sample_size()

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.

§ get_trigger()

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.

§ reg_read()

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.

§ reg_write()

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.

§ set_trigger()

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

§ attrs

readonly List<Attr> iio.Device.attrs

A list of all the attributes that this device has.

§ channels

readonly List<Channel> iio.Device.channels

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

§ debug_attrs

readonly List<Attr> iio.Device.debug_attrs

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

§ id

readonly string iio.Device.id

An identifier of this device.

The identifier is only valid in this IIO context

§ name

readonly string iio.Device.name

The name of this device.

Property Documentation

§ trigger

iio.Device.trigger
static
Initial value:
= property(
_get_trigger,
_set_trigger,
None,
"Contains the configured trigger for this IIO device.\n\ttype=iio.Trigger",
)

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