precision-converters-firmware
Functions
pl_gui_iio_wrapper.c File Reference

Pocket lab GUI IIO wrapper interfaces. More...

#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "pl_gui_iio_wrapper.h"
#include "no_os_error.h"
Include dependency graph for pl_gui_iio_wrapper.c:

Functions

int32_t pl_gui_save_dev_param_desc (struct iio_init_param *param)
 Save the iio init params descriptor for future use. More...
 
int32_t pl_gui_get_dev_names (char *dev_names)
 Get IIO device names. More...
 
int32_t pl_gui_get_chn_names (char *chn_names, uint32_t *nb_of_chn, uint32_t dev_indx)
 Get IIO channels names. More...
 
int32_t pl_gui_get_chn_unit (char *chn_unit, uint32_t chn_indx, uint32_t dev_indx)
 Get IIO channels unit type (in string format) More...
 
int32_t pl_gui_get_global_attr_names (char *attr_names, uint32_t dev_indx)
 Get IIO global attributes names. More...
 
int32_t pl_gui_get_chn_attr_names (char *attr_names, uint32_t chn_indx, uint32_t dev_indx)
 Get IIO channel attributes names. More...
 
int32_t pl_gui_get_global_attr_avail_options (const char *attr_name, char *attr_val, uint32_t dev_indx)
 Get global available attributes options. More...
 
int32_t pl_gui_get_chn_attr_avail_options (const char *attr_name, char *attr_val, uint32_t chn_indx, uint32_t dev_indx)
 Get channel available attributes options. More...
 
int32_t pl_gui_read_global_attr (const char *attr_name, char *attr_val, uint32_t dev_indx)
 Read global attr value. More...
 
int32_t pl_gui_read_chn_attr (char *attr_name, char *attr_val, uint32_t chn_indx, uint32_t dev_indx)
 Read channel attr value. More...
 
int32_t pl_gui_write_global_attr (const char *attr_name, char *attr_val, uint32_t dev_indx)
 Write global attr value. More...
 
int32_t pl_gui_write_chn_attr (const char *attr_name, char *attr_val, uint32_t chn_indx, uint32_t dev_indx)
 Write channel attr value. More...
 
int32_t pl_gui_read_reg (uint32_t addr, uint32_t *data, uint32_t dev_indx)
 Read register value. More...
 
int32_t pl_gui_write_reg (uint32_t addr, uint32_t data, uint32_t dev_indx)
 Write register value. More...
 
int32_t pl_gui_get_dmm_reading (char *val, uint32_t chn_indx, uint32_t dev_indx)
 Get DMM reading. More...
 
int32_t pl_gui_read_chn_info (struct scan_type *chn_info, uint32_t chn_indx, uint32_t dev_indx)
 Read channel scan info. More...
 

Detailed Description

Pocket lab GUI IIO wrapper interfaces.

Copyright (c) 2023 Analog Devices, Inc.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Function Documentation

◆ pl_gui_get_chn_attr_avail_options()

int32_t pl_gui_get_chn_attr_avail_options ( const char *  attr_name,
char *  attr_val,
uint32_t  chn_indx,
uint32_t  dev_indx 
)

Get channel available attributes options.

Parameters
attr_name[in]- Attribute name
attr_val[in,out]- Attribute values/options
chn_indx[in]- Current channel index
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_get_chn_attr_names()

int32_t pl_gui_get_chn_attr_names ( char *  attr_names,
uint32_t  chn_indx,
uint32_t  dev_indx 
)

Get IIO channel attributes names.

Parameters
attr_names[in,out]- Attribute names
chn_indx[in]- Current channel index
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_get_chn_names()

int32_t pl_gui_get_chn_names ( char *  chn_names,
uint32_t *  nb_of_chn,
uint32_t  dev_indx 
)

Get IIO channels names.

Parameters
chn_names[in,out]- Channel names string
nb_of_chn[in,out]- Channels count
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_get_chn_unit()

int32_t pl_gui_get_chn_unit ( char *  chn_unit,
uint32_t  chn_indx,
uint32_t  dev_indx 
)

Get IIO channels unit type (in string format)

Parameters
chn_unit[in,out]- Channel unit string
chn_indx[in]- Current channel index
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_get_dev_names()

int32_t pl_gui_get_dev_names ( char *  dev_names)

Get IIO device names.

Parameters
dev_names[in,out]- Device names string
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ pl_gui_get_dmm_reading()

int32_t pl_gui_get_dmm_reading ( char *  val,
uint32_t  chn_indx,
uint32_t  dev_indx 
)

Get DMM reading.

Parameters
val[in,out]- DMM reading
chn_indx[in]- Current channel index
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_get_global_attr_avail_options()

int32_t pl_gui_get_global_attr_avail_options ( const char *  attr_name,
char *  attr_val,
uint32_t  dev_indx 
)

Get global available attributes options.

Parameters
attr_name[in]- Attribute name
attr_val[in,out]- Attribute values/options
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_get_global_attr_names()

int32_t pl_gui_get_global_attr_names ( char *  attr_names,
uint32_t  dev_indx 
)

Get IIO global attributes names.

Parameters
attr_names[in,out]- Attribute names string
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_read_chn_attr()

int32_t pl_gui_read_chn_attr ( char *  attr_name,
char *  attr_val,
uint32_t  chn_indx,
uint32_t  dev_indx 
)

Read channel attr value.

Parameters
attr_name[in]- Attribute name
attr_val[in,out]- Attribute value
chn_indx[in]- Current channel index
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_read_chn_info()

int32_t pl_gui_read_chn_info ( struct scan_type *  chn_info,
uint32_t  chn_indx,
uint32_t  dev_indx 
)

Read channel scan info.

Parameters
chn_info[in,out]- Channel scan info
chn_indx[in]- Current channel index
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_read_global_attr()

int32_t pl_gui_read_global_attr ( const char *  attr_name,
char *  attr_val,
uint32_t  dev_indx 
)

Read global attr value.

Parameters
attr_name[in]- Attribute name
attr_val[in,out]- Attribute value
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_read_reg()

int32_t pl_gui_read_reg ( uint32_t  addr,
uint32_t *  data,
uint32_t  dev_indx 
)

Read register value.

Parameters
addr[in]- Register address
data[in,out]- Register value
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_save_dev_param_desc()

int32_t pl_gui_save_dev_param_desc ( struct iio_init_param *  param)

Save the iio init params descriptor for future use.

Parameters
param[in]- IIO init parameters structure pointer
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_write_chn_attr()

int32_t pl_gui_write_chn_attr ( const char *  attr_name,
char *  attr_val,
uint32_t  chn_indx,
uint32_t  dev_indx 
)

Write channel attr value.

Parameters
attr_name[in]- Attribute name
attr_val[in]- Attribute value
chn_indx[in]- Current channel index
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_write_global_attr()

int32_t pl_gui_write_global_attr ( const char *  attr_name,
char *  attr_val,
uint32_t  dev_indx 
)

Write global attr value.

Parameters
attr_names[in]- Attribute name
attr_val[in]- Attribute value
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_write_reg()

int32_t pl_gui_write_reg ( uint32_t  addr,
uint32_t  data,
uint32_t  dev_indx 
)

Write register value.

Parameters
addr[in]- Register address
data[in]- Register value
dev_indx[in]- Current device index
Returns
0 in case of success, negative error code otherwise