C# bindings for libiio: iio.Device Class Reference

C# bindings for libiio 1.0 C# bindings for libIIO

Loading...
Searching...
No Matches
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:
[legend]
Collaboration diagram for iio.Device:
[legend]

## Public Member Functions
Channel | get_channel (string name, bool output=false)
| Get the iio.Channel object of the specified name.
void | set_trigger (Trigger trig)
| Affect a trigger to this device.
Trigger | get_trigger ()
| Get the current trigger affected to this device.
uint | get_sample_size (ChannelsMask mask)
| Get the current sample size of the device.
void | reg_write (uint addr, uint value)
| Set a value to one register of this device.
uint | reg_read (uint addr)
| Read the content of a register of this device.

## Public Attributes
readonly Context | ctx
| Gets the context of the current device.
readonly string | id
| An identifier of this device.
readonly string | name
| The name of this device.
readonly List< Attr > | attrs
| A `list` of all the attributes that this device has.
readonly List< Attr > | debug_attrs
| A `list` of all the debug attributes that this device has.
readonly List< Channel > | channels
| A `list` of all the iio.Channel objects that this device possesses.
readonly List< IOBuffer > | buffers
| A `list` of all the iio.IOBuffer objects that this device possesses.

## Properties
string | label`[get]`
| The label of this device.
bool | hwmon`[get]`
| True if the device is a hardware monitoring device, False if it is a IIO device.

## Detailed Description

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

Examples
  ExampleProgram.cs.

## Member Function Documentation

## ◆ get_channel()

Channel iio.Device.get_channel | ( | string | name,
|  | bool | output = `false`
| ) |  |
| inline

Get the iio.Channel object of the specified name.

Parameters

  name | Name or ID of the channel to look for
  output | true if you are looking for an output channel, otherwise false.

Exceptions

  IioLib.IIOException | The 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 | ( | ChannelsMask | mask | ) |
| inline

Get the current sample size of the device.

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

Exceptions

  IioLib.IIOException | Internal error. Please report any bug.

Examples
  ExampleProgram.cs.

## ◆ 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

  IioLib.IIOException | The 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

  addr | The address of the register concerned.

Exceptions

  IioLib.IIOException | The 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

  addr | The address of the register concerned.
  value | The value that will be used for this register.

Exceptions

  IioLib.IIOException | The register could not be written.

## ◆ set_trigger()

void iio.Device.set_trigger | ( | Trigger | trig | ) |
| inline

Affect a trigger to this device.

Parameters

  trig | A valid instance of the iio.Trigger class.

Exceptions

  IioLib.IIOException | The trigger could not be set.

## Member Data Documentation

## ◆ id

readonly string iio.Device.id

An identifier of this device.

The identifier is only valid in this IIO context

Examples
  ExampleProgram.cs.

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

- Device.cs