precision-converters-firmware
|
AD7124 temperature measurement firmware console interface. More...
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include "app_config.h"
#include "mbed_platform_support.h"
#include "no_os_util.h"
#include "no_os_error.h"
#include "no_os_spi.h"
#include "ad7124.h"
#include "ad7124_regs.h"
#include "ad7124_support.h"
#include "ad7124_regs_configs.h"
#include "ad7124_console_app.h"
#include "ad7124_user_config.h"
#include "ad7124_temperature_sensor.h"
Classes | |
struct | adc_calibration_configs |
Macros | |
#define | MAX_ADC_SAMPLES 100 |
#define | MAX_AVG_ADC_SAMPLES 8 |
#define | MAX_RTD_SENSORS 5 |
#define | MAX_THERMOCOUPLE_SENSORS 6 |
#define | MAX_NTC_THERMISTOR_SENSORS 8 |
#define | AD7124_MAX_INPUTS 8 |
#define | AD7124_DEFAULT_OFFSET 0x800000 |
#define | AD7124_MAX_CONFIGS_USED 3 |
#define | CONVERSION_TIMEOUT 10000 |
#define | CJC_RTD_CHN SENSOR_CHANNEL6 |
#define | CJC_THERMISTOR_CHN SENSOR_CHANNEL7 |
#define | RTD_3WIRE_REF_MEASUREMENT_CHN SENSOR_CHANNEL4 |
Functions | |
int32_t | ad7124_app_initialize (uint8_t config_id) |
Initialize the AD7124 device and user configuration. More... | |
int32_t | enable_disable_sensor (uint32_t chn_number) |
Enable the multiple sensors for measurement. More... | |
int32_t | select_cjc_sensor (uint32_t cjc_sensor) |
Select the CJC sensor for thermocouple measurement. More... | |
int32_t | perform_ntc_thermistor_measurement (uint32_t measurement_type) |
Perform the multiple NTC thermistor sensors measurement. More... | |
int32_t | perform_cjc_measurement (int32_t(*data)[MAX_ADC_SAMPLES], sensor_measurement_type measurement_type) |
Perform the cold junction compensation (CJC) measurement. More... | |
int32_t | perform_thermocouple_measurement (uint32_t measurement_type) |
Perform the multiple thermocouple sensors measurement. More... | |
int32_t | perform_adc_calibration (uint32_t calibration_type) |
Perform the AD7124 internal/system calibration. More... | |
void | rtd_2wire_menu_header (void) |
Display header information for 2-wire RTD measurement menu. More... | |
void | rtd_3wire_menu_header (void) |
Display header information for 3-wire RTD measurement menu. More... | |
void | rtd_3wire_calibration_menu_header (void) |
Display header information for 3-wire RTD calibration menu. More... | |
void | rtd_4wire_menu_header (void) |
Display header information for 4-wire RTD measurement menu. More... | |
void | ntc_thermistor_menu_header (void) |
Display header information for NTC thermistor measurement menu. More... | |
void | thermocouple_menu_header (void) |
Display header information for NTC thermistor measurement menu. More... | |
void | adc_calibration_menu_header (void) |
Display header information for ADC calibration menu. More... | |
void | main_menu_header (void) |
Display header information for main menu. More... | |
int32_t | display_2wire_rtd_menu (uint32_t menu_id) |
Display 2-wire RTD measurement main menu. More... | |
int32_t | display_3wire_rtd_menu (uint32_t menu_id) |
Display 3-wire RTD measurement main menu. More... | |
int32_t | display_3wire_rtd_calibration_menu (uint32_t menu_id) |
Display 3-wire RTD calibration main menu. More... | |
int32_t | display_4wire_rtd_menu (uint32_t menu_id) |
Display 4-wire RTD measurement main menu. More... | |
int32_t | display_thermocouple_menu (uint32_t menu_id) |
Display thermoucouple measurement main menu. More... | |
int32_t | display_ntc_thermistor_menu (uint32_t menu_id) |
Display thermistor measurement main menu. More... | |
int32_t | display_adc_calibration_menu (uint32_t menu_id) |
Display ADC calibration main menu. More... | |
int32_t | reset_device_config (uint32_t menu_id) |
Display ADC calibration main menu. More... | |
AD7124 temperature measurement firmware console interface.
This file is specific to ad7124 console menu application handle. The functions defined in this file performs the action based on user selected console menu.
Copyright (c) 2021-22 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 AD7124_DEFAULT_OFFSET 0x800000 |
#define AD7124_MAX_CONFIGS_USED 3 |
#define AD7124_MAX_INPUTS 8 |
#define CJC_RTD_CHN SENSOR_CHANNEL6 |
#define CJC_THERMISTOR_CHN SENSOR_CHANNEL7 |
#define CONVERSION_TIMEOUT 10000 |
#define MAX_ADC_SAMPLES 100 |
#define MAX_AVG_ADC_SAMPLES 8 |
#define MAX_NTC_THERMISTOR_SENSORS 8 |
#define MAX_RTD_SENSORS 5 |
#define MAX_THERMOCOUPLE_SENSORS 6 |
#define RTD_3WIRE_REF_MEASUREMENT_CHN SENSOR_CHANNEL4 |
enum adc_calibration_type |
enum sensor_channels |
int32_t ad7124_app_initialize | ( | uint8_t | config_id | ) |
Initialize the AD7124 device and user configuration.
Initialize the AD7124 device and the SPI port as required.
config_id[in]- | Register configuration to be load into device |
This resets and then writes the default register map value to the device. A call to init the SPI port is made, but may not actually do very much, depending on the platform.
void adc_calibration_menu_header | ( | void | ) |
Display header information for ADC calibration menu.
int32_t display_2wire_rtd_menu | ( | uint32_t | menu_id | ) |
Display 2-wire RTD measurement main menu.
menu_id[in]- | Optional menu ID |
int32_t display_3wire_rtd_calibration_menu | ( | uint32_t | menu_id | ) |
Display 3-wire RTD calibration main menu.
menu_id[in]- | Optional menu ID |
int32_t display_3wire_rtd_menu | ( | uint32_t | menu_id | ) |
Display 3-wire RTD measurement main menu.
menu_id[in]- | Optional menu ID |
int32_t display_4wire_rtd_menu | ( | uint32_t | menu_id | ) |
Display 4-wire RTD measurement main menu.
menu_id[in]- | Optional menu ID |
int32_t display_adc_calibration_menu | ( | uint32_t | menu_id | ) |
Display ADC calibration main menu.
menu_id[in]- | Optional menu ID |
int32_t display_ntc_thermistor_menu | ( | uint32_t | menu_id | ) |
Display thermistor measurement main menu.
menu_id[in]- | Optional menu ID |
int32_t display_thermocouple_menu | ( | uint32_t | menu_id | ) |
Display thermoucouple measurement main menu.
menu_id[in]- | Optional menu ID |
int32_t enable_disable_sensor | ( | uint32_t | chn_number | ) |
Enable the multiple sensors for measurement.
chn_number[in]- | Channel number assigned for the sensor |
void main_menu_header | ( | void | ) |
Display header information for main menu.
void ntc_thermistor_menu_header | ( | void | ) |
Display header information for NTC thermistor measurement menu.
int32_t perform_adc_calibration | ( | uint32_t | calibration_type | ) |
Perform the AD7124 internal/system calibration.
calibration_type[in]- | ADC calibration type (internal/system) |
int32_t perform_cjc_measurement | ( | int32_t(*) | data[MAX_ADC_SAMPLES], |
sensor_measurement_type | measurement_type | ||
) |
Perform the cold junction compensation (CJC) measurement.
*data[out]- | Pointer to array to read data into |
measurement_type[in]- | Temperature measurement and display type |
int32_t perform_ntc_thermistor_measurement | ( | uint32_t | measurement_type | ) |
Perform the multiple NTC thermistor sensors measurement.
measurement_type[in]- | Temperature measurement and display type |
int32_t perform_thermocouple_measurement | ( | uint32_t | measurement_type | ) |
Perform the multiple thermocouple sensors measurement.
measurement_type[in]- | Temperature measurement and display type |
int32_t reset_device_config | ( | uint32_t | menu_id | ) |
Display ADC calibration main menu.
menu_id[in]- | Optional menu ID |
void rtd_2wire_menu_header | ( | void | ) |
Display header information for 2-wire RTD measurement menu.
void rtd_3wire_calibration_menu_header | ( | void | ) |
Display header information for 3-wire RTD calibration menu.
void rtd_3wire_menu_header | ( | void | ) |
Display header information for 3-wire RTD measurement menu.
void rtd_4wire_menu_header | ( | void | ) |
Display header information for 4-wire RTD measurement menu.
int32_t select_cjc_sensor | ( | uint32_t | cjc_sensor | ) |
Select the CJC sensor for thermocouple measurement.
cjc_sensor[in]- | CJC sensor to be selected |
void thermocouple_menu_header | ( | void | ) |
Display header information for NTC thermistor measurement menu.
console_menu ad7124_main_menu |
console_menu adc_calibration_menu |
console_menu ntc_thermistor_menu |
console_menu rtd_2wire_menu |
console_menu rtd_3wire_calibration_menu |
console_menu rtd_3wire_menu |
console_menu rtd_4wire_menu |
console_menu thermocouple_menu |