precision-converters-firmware
|
: Implementation of the menu functions which handles the functionality of AD717x and AD411x family of devices. More...
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <ctype.h>
#include "app_config.h"
#include "ad717x.h"
#include "mbed_platform_support.h"
#include "no_os_spi.h"
#include "mbed_spi.h"
#include "ad717x_console_app.h"
#include "ad717x_menu_defines.h"
#include "ad717x_support.h"
#include <ad411x_regs.h>
Macros | |
#define | SHOW_ALL_CHANNELS false |
#define | SHOW_ENABLED_CHANNELS true |
#define | DISPLAY_DATA_TABULAR 0 |
#define | DISPLAY_DATA_STREAM 1 |
#define | OPEN_WIRE_DETECT_THRESHOLD 100000 |
Functions | |
int32_t | ad717x_app_initialize (void) |
Initialize the AD717x device and associated low level peripherals. More... | |
void | display_main_menu_header (void) |
Display the header info for main menu. More... | |
int32_t | menu_read_id (uint32_t menu_id) |
Handle the menu to read device ID. More... | |
int32_t | menu_read_status (uint32_t menu_id) |
Handle the menu to read device status register. More... | |
int32_t | menu_continuous_conversion_tabular (uint32_t channel_id) |
Samples all enabled channels and displays in tabular form. More... | |
int32_t | menu_continuous_conversion_stream (uint32_t channel_id) |
Samples all enabled channels and displays on the console. More... | |
int32_t | menu_single_conversion (uint32_t channel_id) |
Samples all enabled channels once in Single Conversion mode. More... | |
int32_t | menu_sample_channels (uint32_t menu_id) |
Handle the menu to sample the channels. More... | |
int32_t | menu_channels_enable_disable (uint32_t action) |
int32_t | menu_chn_enable_disable_display (uint32_t menu_id) |
Display the menu to enable/disable channel selection. More... | |
int32_t | menu_analog_input_connect (uint32_t user_analog_input) |
Handle the menu to connect input to channel. More... | |
int32_t | menu_input_chn_connect_display (uint32_t menu_id) |
Display the menu selections to connect analog input pins to a channel. More... | |
int32_t | menu_filter_select (uint32_t user_input_filter_type) |
Handle the menu to select the filter type. More... | |
int32_t | menu_postfiler_enable_disable (uint32_t user_action) |
Handle the menu to enable/disable the post filter. More... | |
int32_t | menu_postfiler_select (uint32_t user_input_post_filter_type) |
Handle the menu to select the post filter. More... | |
int32_t | menu_odr_select (uint32_t user_input_odr_val) |
Handle the menu to select the ODR value. More... | |
int32_t | menu_polarity_select (uint32_t user_input_polarity) |
Handle the menu to select the polarity. More... | |
int32_t | menu_reference_source_select (uint32_t user_input_reference) |
Handle the menu to select the reference source. More... | |
int32_t | menu_ref_buffer_enable_disable (uint32_t user_action) |
Handle the menu to enable/disable the reference buffers. More... | |
int32_t | menu_input_buffer_enable_disable (uint32_t user_action) |
Handle the menu to enable/disable the input buffers. More... | |
int32_t | menu_config_and_assign_setup (uint32_t menu_id) |
Handle the menu to configure and assign the device setup. More... | |
int32_t | menu_display_setup (uint32_t menu_id) |
Handle the menu to display device setup. More... | |
int32_t | menu_read_temperature (uint32_t menu_id) |
Handle the menu to read die temperature of device. More... | |
int32_t | menu_calibrate_adc (uint32_t menu_id) |
Handle the menu to calibrate the device. More... | |
int32_t | menu_input_type_selection (uint32_t user_input_type) |
Handle the menu to select input type for open wire detection. More... | |
int32_t | menu_select_chn_pair (uint32_t user_channel_pair) |
Handle the menu to select channel pair for open wire detection. More... | |
int32_t | menu_select_input_pair (uint32_t user_analog_input) |
Handle the menu to select input pair for open wire detection. More... | |
int32_t | menu_open_wire_detection (uint32_t menu_id) |
Handle the menu to perform open wire detection. More... | |
int32_t | menu_rw_ad717x_register (uint32_t rw_id) |
int32_t | menu_read_write_device_regs (uint32_t menu_id) |
Handle the menu to read/write device registers. More... | |
: Implementation of the menu functions which handles the functionality of AD717x and AD411x family of devices.
: This file is specific to AD717x/AD411x console menu application handle. The functions defined in this file performs the action
Copyright (c) 2020-2022 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 DISPLAY_DATA_STREAM 1 |
#define DISPLAY_DATA_TABULAR 0 |
#define OPEN_WIRE_DETECT_THRESHOLD 100000 |
#define SHOW_ALL_CHANNELS false |
#define SHOW_ENABLED_CHANNELS true |
int32_t ad717x_app_initialize | ( | void | ) |
Initialize the AD717x device and associated low level peripherals.
void display_main_menu_header | ( | void | ) |
Display the header info for main menu.
int32_t menu_analog_input_connect | ( | uint32_t | user_analog_input | ) |
Handle the menu to connect input to channel.
analog | input to be connected |
int32_t menu_calibrate_adc | ( | uint32_t | menu_id | ) |
Handle the menu to calibrate the device.
menu_id- | (Optional parameter) |
int32_t menu_channels_enable_disable | ( | uint32_t | action | ) |
int32_t menu_chn_enable_disable_display | ( | uint32_t | menu_id | ) |
Display the menu to enable/disable channel selection.
menu_id- | (Optional parameter) |
int32_t menu_config_and_assign_setup | ( | uint32_t | menu_id | ) |
Handle the menu to configure and assign the device setup.
menu_id- | (Optional parameter) |
int32_t menu_continuous_conversion_stream | ( | uint32_t | channel_id | ) |
Samples all enabled channels and displays on the console.
int32_t menu_continuous_conversion_tabular | ( | uint32_t | channel_id | ) |
Samples all enabled channels and displays in tabular form.
int32_t menu_display_setup | ( | uint32_t | menu_id | ) |
Handle the menu to display device setup.
menu_id- | (Optional parameter) |
int32_t menu_filter_select | ( | uint32_t | user_input_filter_type | ) |
Handle the menu to select the filter type.
user | selected filter type |
int32_t menu_input_buffer_enable_disable | ( | uint32_t | user_action | ) |
Handle the menu to enable/disable the input buffers.
user | selected action |
int32_t menu_input_chn_connect_display | ( | uint32_t | menu_id | ) |
Display the menu selections to connect analog input pins to a channel.
menu_id- | (Optional parameter) |
int32_t menu_input_type_selection | ( | uint32_t | user_input_type | ) |
Handle the menu to select input type for open wire detection.
User | selected analog input type |
int32_t menu_odr_select | ( | uint32_t | user_input_odr_val | ) |
Handle the menu to select the ODR value.
user | selected ODR |
int32_t menu_open_wire_detection | ( | uint32_t | menu_id | ) |
Handle the menu to perform open wire detection.
menu_id- | (Optional parameter) |
int32_t menu_polarity_select | ( | uint32_t | user_input_polarity | ) |
Handle the menu to select the polarity.
user | selected polarity |
int32_t menu_postfiler_enable_disable | ( | uint32_t | user_action | ) |
Handle the menu to enable/disable the post filter.
user | selected action |
int32_t menu_postfiler_select | ( | uint32_t | user_input_post_filter_type | ) |
Handle the menu to select the post filter.
user | selected post filter type |
int32_t menu_read_id | ( | uint32_t | menu_id | ) |
Handle the menu to read device ID.
menu_id- | (Optional parameter) |
int32_t menu_read_status | ( | uint32_t | menu_id | ) |
Handle the menu to read device status register.
menu_id- | (Optional parameter) |
int32_t menu_read_temperature | ( | uint32_t | menu_id | ) |
Handle the menu to read die temperature of device.
menu_id- | (Optional parameter) |
int32_t menu_read_write_device_regs | ( | uint32_t | menu_id | ) |
Handle the menu to read/write device registers.
menu_id- | (Optional parameter) |
int32_t menu_ref_buffer_enable_disable | ( | uint32_t | user_action | ) |
Handle the menu to enable/disable the reference buffers.
user | selected action |
int32_t menu_reference_source_select | ( | uint32_t | user_input_reference | ) |
Handle the menu to select the reference source.
user | selected reference source |
int32_t menu_rw_ad717x_register | ( | uint32_t | rw_id | ) |
int32_t menu_sample_channels | ( | uint32_t | menu_id | ) |
Handle the menu to sample the channels.
menu_id- | (Optional parameter) |
int32_t menu_select_chn_pair | ( | uint32_t | user_channel_pair | ) |
Handle the menu to select channel pair for open wire detection.
User | selected channel pair |
int32_t menu_select_input_pair | ( | uint32_t | user_analog_input | ) |
Handle the menu to select input pair for open wire detection.
User | selected analog input |
int32_t menu_single_conversion | ( | uint32_t | channel_id | ) |
Samples all enabled channels once in Single Conversion mode.
This stores all channels that are enabled in a bitmask, and then runs the ADC in single conversion mode, which acquires one channel of data at a time. After capture, that channel is disabled, and single conversion run again, until no channels are enabled. The original enable state of each channel is then restored.