|
precision-converters-firmware
|
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 "no_os_delay.h"#include "no_os_alloc.h"
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 | LTC2672_MIN_REF_VOLTAGE 1.225 |
| #define | LTC2672_MAX_REF_VOLTAGE 1.275 |
| #define | LTC2672_MIN_FSADJ_RESISTOR 19 |
| #define | LTC2672_MAX_FSADJ_RESISTOR 41 |
| #define | CONFIG_COMMAND(oc, pl, ts, rd) (oc << 3) | (pl << 2) | (ts << 1) | (rd << 0) |
| #define | INDEX_TO_DEV_ID(x) ((x * 2) + 1) |
Functions | |
| int32_t | ltc2672_set_toggling_rate (uint32_t *toggling_rate) |
| Set the toggling rate and get the updated value supported by MCU platform and the device. | |
| int32_t | ltc2672_iio_init () |
| Initialize the IIO interface for LTC2672 IIO device. | |
| void | ltc2672_iio_event_handler (void) |
| Run the LTC2672 IIO event handler. | |
Variables | |
| struct ltc2672_dev * | ltc2672_dev_desc |
| float | ref_voltage = DAC_VREF |
| float | resistor_fsadj = DAC_FSADJ_RESISTOR |
| uint8_t | toggle_sel_bits = 0 |
| uint8_t | fault_register = 0 |
| uint32_t | ltc2672_toggle_rate = LTC2672_MAX_TOGGLE_RATE |
Implementation of LTC2672 IIO application interfaces.
Copyright (c) 2023-25 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.
| #define BYTE_MASK (uint32_t)0xff |
| #define BYTE_SIZE (uint32_t)8 |
| #define BYTES_PER_SAMPLE sizeof(uint16_t) |
| #define CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
| #define CONFIG_COMMAND | ( | oc, | |
| pl, | |||
| ts, | |||
| rd | |||
| ) | (oc << 3) | (pl << 2) | (ts << 1) | (rd << 0) |
| #define INDEX_TO_DEV_ID | ( | x | ) | ((x * 2) + 1) |
| #define LTC2672_CH | ( | _name, | |
| _idx, | |||
| _type | |||
| ) |
| #define LTC2672_CHN_ATTR | ( | _name, | |
| _priv | |||
| ) |
| #define LTC2672_CHN_AVAIL_ATTR | ( | _name, | |
| _priv | |||
| ) |
| #define LTC2672_MAX_FSADJ_RESISTOR 41 |
| #define LTC2672_MAX_REF_VOLTAGE 1.275 |
| #define LTC2672_MIN_FSADJ_RESISTOR 19 |
| #define LTC2672_MIN_REF_VOLTAGE 1.225 |
| #define NUM_OF_IIO_DEVICES 1 |
| enum ltc2672_iio_attr_id |
| void ltc2672_iio_event_handler | ( | void | ) |
Run the LTC2672 IIO event handler.
This function monitors the new IIO client event.

| int32_t ltc2672_iio_init | ( | void | ) |
Initialize the IIO interface for LTC2672 IIO device.

| int32_t ltc2672_set_toggling_rate | ( | uint32_t * | toggling_rate | ) |
Set the toggling rate and get the updated value supported by MCU platform and the device.
| toggling_rate[in,out] | - Update rate value |
| uint8_t fault_register = 0 |
| struct ltc2672_dev* ltc2672_dev_desc |
| uint32_t ltc2672_toggle_rate = LTC2672_MAX_TOGGLE_RATE |
| float ref_voltage = DAC_VREF |
| float resistor_fsadj = DAC_FSADJ_RESISTOR |
| uint8_t toggle_sel_bits = 0 |