precision-converters-firmware
Macros | Enumerations | Functions | Variables
ltc2672_iio.c File Reference

Implementation of LTC2672 IIO application interfaces. More...

#include <stdio.h>
#include <string.h>
#include "app_config.h"
#include "ltc2672_iio.h"
#include "ltc2672_user_config.h"
#include "common.h"
#include "no_os_util.h"
Include dependency graph for ltc2672_iio.c:

Macros

#define LTC2672_CHN_ATTR(_name, _priv)
 
#define LTC2672_CHN_AVAIL_ATTR(_name, _priv)
 
#define LTC2672_CH(_name, _idx, _type)
 
#define NUM_OF_IIO_DEVICES   1
 
#define BYTES_PER_SAMPLE   sizeof(uint16_t)
 
#define BYTE_SIZE   (uint32_t)8
 
#define BYTE_MASK   (uint32_t)0xff
 
#define CHN_STORAGE_BITS   (BYTES_PER_SAMPLE * 8)
 
#define DATA_BUFFER_SIZE   (32768)
 

Enumerations

enum  ltc2672_iio_attr_id {
  DAC_CH_RAW ,
  DAC_CH_OFFSET ,
  DAC_CH_SCALE ,
  DAC_CH_SPAN ,
  DAC_CH_CURRENT ,
  DAC_CH_POWERDOWN ,
  DAC_RAW ,
  DAC_SPAN ,
  DAC_CURRENT ,
  DAC_POWERDOWN ,
  DAC_MUX ,
  DAC_FAULT_REGISTER
}
 

Functions

int32_t ltc2672_iio_init ()
 Initialize the IIO interface for LTC2672 IIO device. More...
 
void ltc2672_iio_event_handler (void)
 Run the LTC2672 IIO event handler. More...
 

Variables

struct ltc2672_dev * ltc2672_dev_desc
 

Detailed Description

Implementation of LTC2672 IIO application interfaces.

Copyright (c) 2023 Analog Devices, Inc. All rights reserved.

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.

Macro Definition Documentation

◆ BYTE_MASK

#define BYTE_MASK   (uint32_t)0xff

◆ BYTE_SIZE

#define BYTE_SIZE   (uint32_t)8

◆ BYTES_PER_SAMPLE

#define BYTES_PER_SAMPLE   sizeof(uint16_t)

◆ CHN_STORAGE_BITS

#define CHN_STORAGE_BITS   (BYTES_PER_SAMPLE * 8)

◆ DATA_BUFFER_SIZE

#define DATA_BUFFER_SIZE   (32768)

◆ LTC2672_CH

#define LTC2672_CH (   _name,
  _idx,
  _type 
)
Value:
{\
.name = _name, \
.ch_type = _type,\
.ch_out = true,\
.indexed = true,\
.channel = _idx,\
.scan_index = _idx,\
.scan_type = &ltc2672_iio_scan_type,\
.attributes = ltc2672_iio_ch_attributes\
}

◆ LTC2672_CHN_ATTR

#define LTC2672_CHN_ATTR (   _name,
  _priv 
)
Value:
{\
.name = _name,\
.priv = _priv,\
.show = ltc2672_iio_attr_get,\
.store = ltc2672_iio_attr_set\
}

◆ LTC2672_CHN_AVAIL_ATTR

#define LTC2672_CHN_AVAIL_ATTR (   _name,
  _priv 
)
Value:
{\
.name = _name,\
.priv = _priv,\
.show = ltc2672_iio_attr_available_get,\
.store = ltc2672_iio_attr_available_set\
}

◆ NUM_OF_IIO_DEVICES

#define NUM_OF_IIO_DEVICES   1

Enumeration Type Documentation

◆ ltc2672_iio_attr_id

Enumerator
DAC_CH_RAW 
DAC_CH_OFFSET 
DAC_CH_SCALE 
DAC_CH_SPAN 
DAC_CH_CURRENT 
DAC_CH_POWERDOWN 
DAC_RAW 
DAC_SPAN 
DAC_CURRENT 
DAC_POWERDOWN 
DAC_MUX 
DAC_FAULT_REGISTER 

Function Documentation

◆ ltc2672_iio_event_handler()

void ltc2672_iio_event_handler ( void  )

Run the LTC2672 IIO event handler.

Returns
none.

This function monitors the new IIO client event.

Here is the caller graph for this function:

◆ ltc2672_iio_init()

int32_t ltc2672_iio_init ( void  )

Initialize the IIO interface for LTC2672 IIO device.

Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

Variable Documentation

◆ ltc2672_dev_desc

struct ltc2672_dev* ltc2672_dev_desc