![]() |
no-OS
|
Source code file for IIO POWRMS example. More...
#include "iio_powrms.h"#include <stdio.h>#include <inttypes.h>#include <stdlib.h>#include <string.h>#include "no_os_error.h"#include "no_os_alloc.h"#include "common_data.h"#include "powrms_data_processing.h"#include "powrms_utils.h"Macros | |
| #define | POWRMS_VOLTAGE_CHANNEL(_idx, _name) |
| #define | POWRMS_POWER_CHANNEL(_idx, _name) |
| #define | POWRMS_PRECISION_CHANNEL(_idx, _name) |
| #define | POWRMS_POLY_CALIB_CHANNEL(_idx, _name) |
| #define | POWRMS_POLY_CALIB_REVERSE_CHANNEL(_idx, _name) |
Functions | |
| int | powrms_eeprom_read_v_temp_comp_val (int32_t *value) |
| Read voltage temperature compensation value from EEPROM. | |
| int | powrms_eeprom_read_def_v_temp_comp_val (int32_t *value) |
| Read default voltage temperature compensation value from EEPROM. | |
| int | powrms_eeprom_write_v_temp_comp_val (int32_t value) |
| Write voltage temperature compensation value to EEPROM. | |
| int | powrms_eeprom_write_def_v_temp_comp_val (int32_t value) |
| Write default voltage temperature compensation value to EEPROM. | |
| int | powrms_set_temperature_compensation_value (float value) |
| float | powrms_get_temperature_compensation_value (void) |
| int | powrms_set_temperature_compensation_value_raw (int32_t raw_value) |
| int32_t | powrms_get_temperature_compensation_value_raw (void) |
| int | powrms_buffers_init (void) |
| void | powrms_buffers_cleanup (void) |
| int | powrms_push_vin0 (float value) |
| int | powrms_push_vin1 (float value) |
| int | powrms_push_p_fwd (float value) |
| int | powrms_push_p_rev (float value) |
| int | powrms_get_latest_vin0 (float *value) |
| int | powrms_get_latest_vin1 (float *value) |
| int | powrms_get_latest_p_fwd (float *value) |
| int | powrms_get_latest_p_rev (float *value) |
| int | powrms_set_precision_value (int index, float value) |
| float | powrms_get_precision_value (int index) |
| int | powrms_set_precision_array (const float *values, int count) |
| int | powrms_get_precision_array (float *values, int max_count) |
| int | powrms_set_precision_value_raw (int index, int32_t raw_value) |
| int32_t | powrms_get_precision_value_raw (int index) |
| int | powrms_set_precision_array_raw (const int32_t *raw_values, int count) |
| int | powrms_get_precision_array_raw (int32_t *raw_values, int max_count) |
| int | powrms_set_precision_value_reverse (int index, float value) |
| float | powrms_get_precision_value_reverse (int index) |
| int | powrms_set_precision_array_reverse (const float *values, int count) |
| int | powrms_get_precision_array_reverse (float *values, int max_count) |
| int | powrms_set_precision_value_raw_reverse (int index, int32_t raw_value) |
| int32_t | powrms_get_precision_value_raw_reverse (int index) |
| int | powrms_set_precision_array_raw_reverse (const int32_t *raw_values, int count) |
| int | powrms_get_precision_array_raw_reverse (int32_t *raw_values, int max_count) |
| int | powrms_set_frequency_range (int index, uint32_t frequency_MHz) |
| uint32_t | powrms_get_frequency_range (int index) |
| int | powrms_set_frequency_ranges (const uint32_t *frequencies, int count) |
| int | powrms_get_frequency_ranges (uint32_t *frequencies, int max_count) |
Variables | |
| struct powrms_variables | input_variables [VARIABLE_NUMBER] |
| struct iio_attribute | powrms_voltage_channel_attributes [] |
| struct iio_attribute | powrms_precision_attributes [] |
| struct iio_attribute | powrms_poly_calib_attributes [] |
| struct iio_attribute | powrms_poly_calib_reverse_attributes [] |
| struct iio_attribute | powrms_global_attributes [] |
| struct scan_type | powrms_scan_type |
| struct iio_device | powrms_iio_descriptor |
| IIO_BUFF_TYPE | iio_data_buffer_loc [MAX_SIZE_BASE_ADDR] = {0} |
| struct no_os_circular_buffer * | powrms_vin0_buffer = NULL |
| struct no_os_circular_buffer * | powrms_vin1_buffer = NULL |
| struct no_os_circular_buffer * | powrms_p_fwd_buffer = NULL |
| struct no_os_circular_buffer * | powrms_p_rev_buffer = NULL |
Source code file for IIO POWRMS example.
Copyright 2025(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define POWRMS_POLY_CALIB_CHANNEL | ( | _idx, | |
| _name ) |
| #define POWRMS_POLY_CALIB_REVERSE_CHANNEL | ( | _idx, | |
| _name ) |
| #define POWRMS_POWER_CHANNEL | ( | _idx, | |
| _name ) |
| #define POWRMS_PRECISION_CHANNEL | ( | _idx, | |
| _name ) |
| #define POWRMS_VOLTAGE_CHANNEL | ( | _idx, | |
| _name ) |
| void powrms_buffers_cleanup | ( | void | ) |
| int powrms_buffers_init | ( | void | ) |
| int powrms_eeprom_read_def_v_temp_comp_val | ( | int32_t * | value | ) |
Read default voltage temperature compensation value from EEPROM.
This function reads the default voltage temperature compensation value using single-byte reads to avoid I2C bus blocking issues that can occur with large transfers. The int32_t value is read byte by byte and reconstructed in little-endian format.
| int powrms_eeprom_read_v_temp_comp_val | ( | int32_t * | value | ) |
Read voltage temperature compensation value from EEPROM.
This function reads the voltage temperature compensation value using single-byte reads to avoid I2C bus blocking issues that can occur with large transfers. The int32_t value is read byte by byte and reconstructed in little-endian format.
| int powrms_eeprom_write_def_v_temp_comp_val | ( | int32_t | value | ) |
Write default voltage temperature compensation value to EEPROM.
This function writes the default voltage temperature compensation value using single-byte writes to avoid I2C bus blocking issues that can occur with large transfers. The int32_t value is broken down into bytes and written individually in little-endian format.
| int powrms_eeprom_write_v_temp_comp_val | ( | int32_t | value | ) |
Write voltage temperature compensation value to EEPROM.
This function writes the voltage temperature compensation value using single-byte writes to avoid I2C bus blocking issues that can occur with large transfers. The int32_t value is broken down into bytes and written individually in little-endian format.
| uint32_t powrms_get_frequency_range | ( | int | index | ) |
| int powrms_get_frequency_ranges | ( | uint32_t * | frequencies, |
| int | max_count ) |
| int powrms_get_latest_p_fwd | ( | float * | value | ) |
| int powrms_get_latest_p_rev | ( | float * | value | ) |
| int powrms_get_latest_vin0 | ( | float * | value | ) |
| int powrms_get_latest_vin1 | ( | float * | value | ) |
| int powrms_get_precision_array | ( | float * | values, |
| int | max_count ) |
| int powrms_get_precision_array_raw | ( | int32_t * | raw_values, |
| int | max_count ) |
| int powrms_get_precision_array_raw_reverse | ( | int32_t * | raw_values, |
| int | max_count ) |
| int powrms_get_precision_array_reverse | ( | float * | values, |
| int | max_count ) |
| float powrms_get_precision_value | ( | int | index | ) |
| int32_t powrms_get_precision_value_raw | ( | int | index | ) |
| int32_t powrms_get_precision_value_raw_reverse | ( | int | index | ) |
| float powrms_get_precision_value_reverse | ( | int | index | ) |
| float powrms_get_temperature_compensation_value | ( | void | ) |
| int32_t powrms_get_temperature_compensation_value_raw | ( | void | ) |
| int powrms_push_p_fwd | ( | float | value | ) |
| int powrms_push_p_rev | ( | float | value | ) |
| int powrms_push_vin0 | ( | float | value | ) |
| int powrms_push_vin1 | ( | float | value | ) |
| int powrms_set_frequency_range | ( | int | index, |
| uint32_t | frequency_MHz ) |
| int powrms_set_frequency_ranges | ( | const uint32_t * | frequencies, |
| int | count ) |
| int powrms_set_precision_array | ( | const float * | values, |
| int | count ) |
| int powrms_set_precision_array_raw | ( | const int32_t * | raw_values, |
| int | count ) |
| int powrms_set_precision_array_raw_reverse | ( | const int32_t * | raw_values, |
| int | count ) |
| int powrms_set_precision_array_reverse | ( | const float * | values, |
| int | count ) |
| int powrms_set_precision_value | ( | int | index, |
| float | value ) |
| int powrms_set_precision_value_raw | ( | int | index, |
| int32_t | raw_value ) |
| int powrms_set_precision_value_raw_reverse | ( | int | index, |
| int32_t | raw_value ) |
| int powrms_set_precision_value_reverse | ( | int | index, |
| float | value ) |
| int powrms_set_temperature_compensation_value | ( | float | value | ) |
| int powrms_set_temperature_compensation_value_raw | ( | int32_t | raw_value | ) |
| IIO_BUFF_TYPE iio_data_buffer_loc[MAX_SIZE_BASE_ADDR] = {0} |
|
extern |
| struct iio_attribute powrms_global_attributes[] |
| struct iio_device powrms_iio_descriptor |
| struct no_os_circular_buffer* powrms_p_fwd_buffer = NULL |
| struct no_os_circular_buffer* powrms_p_rev_buffer = NULL |
| struct iio_attribute powrms_poly_calib_attributes[] |
| struct iio_attribute powrms_poly_calib_reverse_attributes[] |
| struct iio_attribute powrms_precision_attributes[] |
| struct scan_type powrms_scan_type |
| struct no_os_circular_buffer* powrms_vin0_buffer = NULL |
| struct no_os_circular_buffer* powrms_vin1_buffer = NULL |
| struct iio_attribute powrms_voltage_channel_attributes[] |