precision-converters-firmware
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Enumerations | Functions | Variables
ad7124_console_app.c File Reference

: Implementation for the menu functions that handle the AD7124 More...

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <ctype.h>
#include "app_config.h"
#include "no_os_error.h"
#include "no_os_gpio.h"
#include "no_os_spi.h"
#include "no_os_uart.h"
#include "ad7124.h"
#include "ad7124_regs.h"
#include "ad7124_support.h"
#include "ad7124_regs_configs.h"
#include "ad7124_console_app.h"
Include dependency graph for ad7124_console_app.c:

Classes

struct  temp_loopup
 

Macros

#define AD7124_CHANNEL_COUNT   16
 
#define SHOW_ALL_CHANNELS   false
 
#define SHOW_ENABLED_CHANNELS   true
 
#define DISPLAY_DATA_TABULAR   0
 
#define DISPLAY_DATA_STREAM   1
 
#define AD7124_MAX_SETUPS   8
 
#define AD7124_MAX_CHANNELS   16
 
#define NUM_OF_FILTERS   5
 
#define MAX_FILTER_DATA_RATE_FS   2047
 
#define MIN_FILTER_DATA_RATE   1
 
#define MAX_GAIN_BITS_VALUE   7
 
#define MIN_PROGRAMMABLE_GAIN   1
 
#define MAX_PROGRAMMABLE_GAIN   128
 
#define MAX_ANALOG_INPUTS   32
 

Enumerations

enum  Chn_EnbleDisable_action {
  CHN_DISABLE ,
  CHN_ENABLE
}
 

Functions

int32_t ad7124_app_initialize (uint8_t configID)
 Initialize the AD7124 device and the SPI port as required.
 

Variables

struct no_os_uart_desc * uart_desc
 
struct no_os_uart_init_param uart_init_params
 
struct no_os_spi_init_param ad7124_spi_init
 
struct ad7124_init_param sAd7124_init
 
console_menu ad7124_main_menu
 

Detailed Description

: Implementation for the menu functions that handle the AD7124

: 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) 2019-2022,2025 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.

Macro Definition Documentation

◆ AD7124_CHANNEL_COUNT

#define AD7124_CHANNEL_COUNT   16

◆ AD7124_MAX_CHANNELS

#define AD7124_MAX_CHANNELS   16

◆ AD7124_MAX_SETUPS

#define AD7124_MAX_SETUPS   8

◆ DISPLAY_DATA_STREAM

#define DISPLAY_DATA_STREAM   1

◆ DISPLAY_DATA_TABULAR

#define DISPLAY_DATA_TABULAR   0

◆ MAX_ANALOG_INPUTS

#define MAX_ANALOG_INPUTS   32

◆ MAX_FILTER_DATA_RATE_FS

#define MAX_FILTER_DATA_RATE_FS   2047

◆ MAX_GAIN_BITS_VALUE

#define MAX_GAIN_BITS_VALUE   7

◆ MAX_PROGRAMMABLE_GAIN

#define MAX_PROGRAMMABLE_GAIN   128

◆ MIN_FILTER_DATA_RATE

#define MIN_FILTER_DATA_RATE   1

◆ MIN_PROGRAMMABLE_GAIN

#define MIN_PROGRAMMABLE_GAIN   1

◆ NUM_OF_FILTERS

#define NUM_OF_FILTERS   5

◆ SHOW_ALL_CHANNELS

#define SHOW_ALL_CHANNELS   false

◆ SHOW_ENABLED_CHANNELS

#define SHOW_ENABLED_CHANNELS   true

Enumeration Type Documentation

◆ Chn_EnbleDisable_action

Enumerator
CHN_DISABLE 
CHN_ENABLE 

Function Documentation

◆ ad7124_app_initialize()

int32_t ad7124_app_initialize ( uint8_t  configID)

Initialize the AD7124 device and the SPI port as required.

Parameters
configID-Configuration ID
Returns
0 in case of success, negative error code otherwise

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

Here is the caller graph for this function:

Variable Documentation

◆ ad7124_main_menu

console_menu ad7124_main_menu
Initial value:
= {
.title = "AD7124 Main Menu",
.items = main_menu_items,
.itemCount = ARRAY_SIZE(main_menu_items),
.headerItem = NULL,
.footerItem = NULL,
.enableEscapeKey = false
}
console_menu_item main_menu_items[]
Definition ad5592r_console_app.c:1057
#define ARRAY_SIZE(x)
Definition adi_console_menu.h:49

◆ ad7124_spi_init

struct no_os_spi_init_param ad7124_spi_init
Initial value:
= {
.device_id = SPI_DEVICE_ID,
.max_speed_hz = MAX_SPI_CLK,
.chip_select = SPI_CSB,
.mode = NO_OS_SPI_MODE_3,
.platform_ops = &spi_ops
}
#define spi_ops
Definition app_config.h:86
#define SPI_CSB
Definition app_config_mbed.h:33
#define SPI_DEVICE_ID
Definition app_config_stm32.h:54
#define MAX_SPI_CLK
Definition app_config_mbed.h:56
#define spi_init_extra_params
Definition ltc2488_user_config.h:36

◆ sAd7124_init

struct ad7124_init_param sAd7124_init
Initial value:
= {
.spi_init = &ad7124_spi_init,
.regs = ad7124_regs,
.spi_rdy_poll_cnt = 10000,
.power_mode = AD7124_HIGH_POWER,
.active_device = ID_AD7124_4,
}
struct no_os_spi_init_param ad7124_spi_init
Definition ad7124_console_app.c:158

◆ uart_desc

struct no_os_uart_desc* uart_desc

◆ uart_init_params

struct no_os_uart_init_param uart_init_params
Initial value:
= {
.device_id = 0,
.baud_rate = 230400,
.size = NO_OS_UART_CS_8,
.parity = NO_OS_UART_PAR_NO,
.stop = NO_OS_UART_STOP_1_BIT,
.irq_id = UART_IRQ_ID,
.asynchronous_rx = false,
.platform_ops = &uart_ops,
}
#define uart_extra_init_params
Definition app_config.h:78
#define uart_ops
Definition app_config.h:87
#define UART_IRQ_ID
Definition app_config_stm32.h:43