![]() |
no-OS
|
Implementation of CN0391 board support. More...
#include <stdlib.h>#include "cn0391.h"#include "no_os_thermocouple.h"#include "no_os_rtd.h"#include "no_os_alloc.h"#include "no_os_error.h"#include "no_os_print_log.h"Functions | |
| int | cn0391_init (struct cn0391_dev **dev, struct cn0391_init_param *init_param) |
| Initialize CN0391 device: set up AD7124 and configure IOUT. | |
| int | cn0391_remove (struct cn0391_dev *dev) |
| Remove CN0391 device and free resources. | |
| int | cn0391_read_temperature (struct cn0391_dev *dev, uint8_t ch_idx, double *hot_junction_temp, double *cold_junction_temp, double *thermocouple_voltage, double *rtd_resistance) |
| Perform a full temperature measurement cycle. Reads all 3 ADC channels (thermocouple, reference resistor, CJC RTD), computes cold junction temperature, cold junction compensation voltage, and hot junction temperature. | |
Implementation of CN0391 board support.
Copyright 2026(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.
| int cn0391_init | ( | struct cn0391_dev ** | dev, |
| struct cn0391_init_param * | init_param ) |
Initialize CN0391 device: set up AD7124 and configure IOUT.
| dev | - Pointer to pointer to CN0391 device descriptor. |
| init_param | - Initialization parameters. |
| int cn0391_read_temperature | ( | struct cn0391_dev * | dev, |
| uint8_t | ch_idx, | ||
| double * | hot_junction_temp, | ||
| double * | cold_junction_temp, | ||
| double * | thermocouple_voltage, | ||
| double * | rtd_resistance ) |
Perform a full temperature measurement cycle. Reads all 3 ADC channels (thermocouple, reference resistor, CJC RTD), computes cold junction temperature, cold junction compensation voltage, and hot junction temperature.
| dev | - CN0391 device descriptor. |
| ch_idx | - IIO channel index (CN0391_CH0_ID..CN0391_CH3_ID). |
| hot_junction_temp | - Pointer to store hot junction temperature (°C). |
| cold_junction_temp | - Pointer to store cold junction temperature (°C). |
| thermocouple_voltage | - Pointer to store thermocouple voltage (mV). |
| rtd_resistance | - Pointer to store measured RTD resistance (Ohms). |
| int cn0391_remove | ( | struct cn0391_dev * | dev | ) |
Remove CN0391 device and free resources.
| dev | - CN0391 device descriptor. |