precision-converters-firmware
Macros | Functions | Variables
app_config.h File Reference

Configuration file for AD4170 device application. More...

#include <stdint.h>
#include "ad4170.h"
#include "app_config_mbed.h"
#include "ad4170_user_config.h"
Include dependency graph for app_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define XSTR(s)   #s
 
#define STR(s)   XSTR(s)
 
#define MBED_PLATFORM   1
 
#define STM32_PLATFORM   2
 
#define USER_DEFAULT_CONFIG   0
 
#define RTD_2WIRE_CONFIG   1
 
#define RTD_3WIRE_CONFIG   2
 
#define RTD_4WIRE_CONFIG   3
 
#define THERMISTOR_CONFIG   4
 
#define THERMOCOUPLE_CONFIG   5
 
#define ACCELEROMETER_CONFIG   6
 
#define LOADCELL_CONFIG   7
 
#define CONTINUOUS_DATA_CAPTURE   0
 
#define BURST_DATA_CAPTURE   1
 
#define TDM_MODE   0
 
#define SPI_INTERRUPT_MODE   1
 
#define SPI_DMA_MODE   2
 
#define IIO_CLIENT_REMOTE   0
 
#define IIO_CLIENT_LOCAL   1
 
#define DEV_AD4170
 
#define ACTIVE_DEVICE_NAME   "ad4170"
 
#define DEVICE_NAME   "DEV_AD4170"
 
#define ACTIVE_DEVICE_ID   ID_AD4170
 
#define HW_MEZZANINE_NAME   "EVAL-AD4170-4ARDZ"
 
#define ACTIVE_PLATFORM   MBED_PLATFORM
 
#define ACTIVE_IIO_CLIENT   IIO_CLIENT_REMOTE
 
#define INTERFACE_MODE   SPI_INTERRUPT_MODE
 
#define ACTIVE_DEMO_MODE_CONFIG   USER_DEFAULT_CONFIG
 
#define DATA_CAPTURE_MODE   CONTINUOUS_DATA_CAPTURE
 
#define USE_VIRTUAL_COM_PORT
 
#define HW_CARRIER_NAME   TARGET_NAME
 
#define ticker_int_extra_init_params   mbed_ticker_int_extra_init_params
 
#define uart_extra_init_params   mbed_vcom_extra_init_params
 
#define uart_ops   mbed_virtual_com_ops
 
#define spi_extra_init_params   mbed_spi_extra_init_params
 
#define i2c_extra_init_params   mbed_i2c_extra_init_params
 
#define trigger_gpio_irq_extra_params   mbed_trigger_gpio_irq_init_params
 
#define gpio_dig_aux1_extra_init_params   mbed_dig_aux1_gpio_extra_init_params
 
#define gpio_dig_aux2_extra_init_params   mbed_dig_aux2_gpio_extra_init_params
 
#define gpio_sync_inb_extra_init_params   mbed_sync_inb_gpio_extra_init_params
 
#define trigger_gpio_extra_init_params   mbed_trigger_gpio_extra_init_params
 
#define trigger_gpio_ops   mbed_gpio_ops
 
#define irq_ops   mbed_gpio_irq_ops
 
#define ticker_irq_ops   mbed_irq_ops
 
#define gpio_ops   mbed_gpio_ops
 
#define spi_ops   mbed_spi_ops
 
#define i2c_ops   mbed_i2c_ops
 
#define trigger_gpio_irq_ops   mbed_gpio_irq_ops
 
#define trigger_gpio_handle   0
 
#define TRIGGER_GPIO_PORT   0
 
#define TRIGGER_GPIO_PIN   DIG_AUX_1
 
#define TRIGGER_INT_ID   GPIO_IRQ_ID1
 
#define TICKER_ID   TICKER_INT_ID
 
#define SPI_DEVICE_ID   0
 
#define I2C_DEVICE_ID   0
 
#define TRIGGER_GPIO_IRQ_CTRL_ID   0
 
#define DIFFERENTIAL_CHNS   4
 
#define SINGLE_ENDED_CHNS   8
 
#define ad4170_init_params   ad4170_user_config_params
 
#define ADC_RESOLUTION   24
 
#define BYTES_PER_SAMPLE   sizeof(uint32_t)
 
#define ADC_MAX_COUNT_UNIPOLAR   (uint32_t)((1 << ADC_RESOLUTION) - 1)
 
#define ADC_MAX_COUNT_BIPOLAR   (uint32_t)(1 << (ADC_RESOLUTION-1))
 
#define AD4170_REFIN_REFIN1_VOLTAGE   2.5
 
#define AD4170_REFIN_REFIN2_VOLTAGE   2.5
 
#define AD4170_REFIN_AVDD_VOLTAGE   5.0
 
#define AD4170_REFIN_REFOUT_VOLTAGE   2.5
 
#define FIRMWARE_NAME   "ad4170_iio"
 
#define VIRTUAL_COM_PORT_VID   0x0456
 
#define VIRTUAL_COM_PORT_PID   0xb66c
 
#define VIRTUAL_COM_SERIAL_NUM   (FIRMWARE_NAME "_" DEVICE_NAME "_" STR(PLATFORM_NAME))
 
#define IIO_UART_BAUD_RATE   (230400)
 
#define AD4170_INTERNAL_CLOCK   (16000000U)
 
#define AD4170_DEFLT_SAMPLING_FREQUENCY   (AD4170_INTERNAL_CLOCK / FS_TO_ODR_CONV_SCALER)
 

Functions

int32_t init_system (void)
 Initialize the system peripherals. More...
 
void ticker_callback (void *ctx)
 This is an ISR (Interrupt Service Routine) for Ticker object. More...
 

Variables

struct no_os_gpio_init_param gpio_init_ldac_n
 
struct no_os_gpio_init_param gpio_init_rdy
 
struct no_os_gpio_init_param gpio_init_sync_inb
 
struct no_os_gpio_desc * led_gpio_desc
 
struct no_os_uart_desc * uart_desc
 
struct no_os_gpio_desc * trigger_gpio_desc
 
struct no_os_gpio_desc * csb_gpio_desc
 
struct no_os_spi_init_param spi_init_params
 
struct no_os_irq_ctrl_desc * trigger_irq_desc
 
struct no_os_tdm_desc * ad4170_tdm_desc
 
struct no_os_eeprom_desc * eeprom_desc
 
struct no_os_pwm_desc * tx_trigger_desc
 

Detailed Description

Configuration file for AD4170 device application.

Copyright (c) 2021-24 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

◆ ACCELEROMETER_CONFIG

#define ACCELEROMETER_CONFIG   6

◆ ACTIVE_DEMO_MODE_CONFIG

#define ACTIVE_DEMO_MODE_CONFIG   USER_DEFAULT_CONFIG

◆ ACTIVE_DEVICE_ID

#define ACTIVE_DEVICE_ID   ID_AD4170

◆ ACTIVE_DEVICE_NAME

#define ACTIVE_DEVICE_NAME   "ad4170"

◆ ACTIVE_IIO_CLIENT

#define ACTIVE_IIO_CLIENT   IIO_CLIENT_REMOTE

◆ ACTIVE_PLATFORM

#define ACTIVE_PLATFORM   MBED_PLATFORM

◆ AD4170_DEFLT_SAMPLING_FREQUENCY

#define AD4170_DEFLT_SAMPLING_FREQUENCY   (AD4170_INTERNAL_CLOCK / FS_TO_ODR_CONV_SCALER)

◆ ad4170_init_params

#define ad4170_init_params   ad4170_user_config_params

◆ AD4170_INTERNAL_CLOCK

#define AD4170_INTERNAL_CLOCK   (16000000U)

◆ AD4170_REFIN_AVDD_VOLTAGE

#define AD4170_REFIN_AVDD_VOLTAGE   5.0

◆ AD4170_REFIN_REFIN1_VOLTAGE

#define AD4170_REFIN_REFIN1_VOLTAGE   2.5

◆ AD4170_REFIN_REFIN2_VOLTAGE

#define AD4170_REFIN_REFIN2_VOLTAGE   2.5

◆ AD4170_REFIN_REFOUT_VOLTAGE

#define AD4170_REFIN_REFOUT_VOLTAGE   2.5

◆ ADC_MAX_COUNT_BIPOLAR

#define ADC_MAX_COUNT_BIPOLAR   (uint32_t)(1 << (ADC_RESOLUTION-1))

◆ ADC_MAX_COUNT_UNIPOLAR

#define ADC_MAX_COUNT_UNIPOLAR   (uint32_t)((1 << ADC_RESOLUTION) - 1)

◆ ADC_RESOLUTION

#define ADC_RESOLUTION   24

◆ BURST_DATA_CAPTURE

#define BURST_DATA_CAPTURE   1

◆ BYTES_PER_SAMPLE

#define BYTES_PER_SAMPLE   sizeof(uint32_t)

◆ CONTINUOUS_DATA_CAPTURE

#define CONTINUOUS_DATA_CAPTURE   0

◆ DATA_CAPTURE_MODE

#define DATA_CAPTURE_MODE   CONTINUOUS_DATA_CAPTURE

◆ DEV_AD4170

#define DEV_AD4170

◆ DEVICE_NAME

#define DEVICE_NAME   "DEV_AD4170"

◆ DIFFERENTIAL_CHNS

#define DIFFERENTIAL_CHNS   4

◆ FIRMWARE_NAME

#define FIRMWARE_NAME   "ad4170_iio"

◆ gpio_dig_aux1_extra_init_params

#define gpio_dig_aux1_extra_init_params   mbed_dig_aux1_gpio_extra_init_params

◆ gpio_dig_aux2_extra_init_params

#define gpio_dig_aux2_extra_init_params   mbed_dig_aux2_gpio_extra_init_params

◆ gpio_ops

#define gpio_ops   mbed_gpio_ops

◆ gpio_sync_inb_extra_init_params

#define gpio_sync_inb_extra_init_params   mbed_sync_inb_gpio_extra_init_params

◆ HW_CARRIER_NAME

#define HW_CARRIER_NAME   TARGET_NAME

◆ HW_MEZZANINE_NAME

#define HW_MEZZANINE_NAME   "EVAL-AD4170-4ARDZ"

◆ I2C_DEVICE_ID

#define I2C_DEVICE_ID   0

◆ i2c_extra_init_params

#define i2c_extra_init_params   mbed_i2c_extra_init_params

◆ i2c_ops

#define i2c_ops   mbed_i2c_ops

◆ IIO_CLIENT_LOCAL

#define IIO_CLIENT_LOCAL   1

◆ IIO_CLIENT_REMOTE

#define IIO_CLIENT_REMOTE   0

◆ IIO_UART_BAUD_RATE

#define IIO_UART_BAUD_RATE   (230400)

◆ INTERFACE_MODE

#define INTERFACE_MODE   SPI_INTERRUPT_MODE

◆ irq_ops

#define irq_ops   mbed_gpio_irq_ops

◆ LOADCELL_CONFIG

#define LOADCELL_CONFIG   7

◆ MBED_PLATFORM

#define MBED_PLATFORM   1

◆ RTD_2WIRE_CONFIG

#define RTD_2WIRE_CONFIG   1

◆ RTD_3WIRE_CONFIG

#define RTD_3WIRE_CONFIG   2

◆ RTD_4WIRE_CONFIG

#define RTD_4WIRE_CONFIG   3

◆ SINGLE_ENDED_CHNS

#define SINGLE_ENDED_CHNS   8

◆ SPI_DEVICE_ID

#define SPI_DEVICE_ID   0

◆ SPI_DMA_MODE

#define SPI_DMA_MODE   2

◆ spi_extra_init_params

#define spi_extra_init_params   mbed_spi_extra_init_params

◆ SPI_INTERRUPT_MODE

#define SPI_INTERRUPT_MODE   1

◆ spi_ops

#define spi_ops   mbed_spi_ops

◆ STM32_PLATFORM

#define STM32_PLATFORM   2

◆ STR

#define STR (   s)    XSTR(s)

◆ TDM_MODE

#define TDM_MODE   0

◆ THERMISTOR_CONFIG

#define THERMISTOR_CONFIG   4

◆ THERMOCOUPLE_CONFIG

#define THERMOCOUPLE_CONFIG   5

◆ TICKER_ID

#define TICKER_ID   TICKER_INT_ID

◆ ticker_int_extra_init_params

#define ticker_int_extra_init_params   mbed_ticker_int_extra_init_params

◆ ticker_irq_ops

#define ticker_irq_ops   mbed_irq_ops

◆ trigger_gpio_extra_init_params

#define trigger_gpio_extra_init_params   mbed_trigger_gpio_extra_init_params

◆ trigger_gpio_handle

#define trigger_gpio_handle   0

◆ TRIGGER_GPIO_IRQ_CTRL_ID

#define TRIGGER_GPIO_IRQ_CTRL_ID   0

◆ trigger_gpio_irq_extra_params

#define trigger_gpio_irq_extra_params   mbed_trigger_gpio_irq_init_params

◆ trigger_gpio_irq_ops

#define trigger_gpio_irq_ops   mbed_gpio_irq_ops

◆ trigger_gpio_ops

#define trigger_gpio_ops   mbed_gpio_ops

◆ TRIGGER_GPIO_PIN

#define TRIGGER_GPIO_PIN   DIG_AUX_1

◆ TRIGGER_GPIO_PORT

#define TRIGGER_GPIO_PORT   0

◆ TRIGGER_INT_ID

#define TRIGGER_INT_ID   GPIO_IRQ_ID1

◆ uart_extra_init_params

#define uart_extra_init_params   mbed_vcom_extra_init_params

◆ uart_ops

#define uart_ops   mbed_virtual_com_ops

◆ USE_VIRTUAL_COM_PORT

#define USE_VIRTUAL_COM_PORT

◆ USER_DEFAULT_CONFIG

#define USER_DEFAULT_CONFIG   0

◆ VIRTUAL_COM_PORT_PID

#define VIRTUAL_COM_PORT_PID   0xb66c

◆ VIRTUAL_COM_PORT_VID

#define VIRTUAL_COM_PORT_VID   0x0456

◆ VIRTUAL_COM_SERIAL_NUM

#define VIRTUAL_COM_SERIAL_NUM   (FIRMWARE_NAME "_" DEVICE_NAME "_" STR(PLATFORM_NAME))

◆ XSTR

#define XSTR (   s)    #s

Function Documentation

◆ init_system()

int32_t init_system ( void  )

Initialize the system peripherals.

Returns
0 in case of success, negative error code otherwise

Initialize the system peripherals.

Returns
0 in case of success, negative error code otherwise.

This function initializes system peripherals for the application

Returns
- 0 in case of success, negative error code otherwise

◆ ticker_callback()

void ticker_callback ( void *  ctx)

This is an ISR (Interrupt Service Routine) for Ticker object.

Parameters
ctx[in]- Callback context (unused)
Returns
none

This function is periodically called based on the time period configured during Ticker instance creation/initialization.

Variable Documentation

◆ ad4170_tdm_desc

struct no_os_tdm_desc* ad4170_tdm_desc
extern

◆ csb_gpio_desc

struct no_os_gpio_desc* csb_gpio_desc
extern

◆ eeprom_desc

struct no_os_eeprom_desc* eeprom_desc
extern

◆ gpio_init_ldac_n

struct no_os_gpio_init_param gpio_init_ldac_n
extern

◆ gpio_init_rdy

struct no_os_gpio_init_param gpio_init_rdy
extern

◆ gpio_init_sync_inb

struct no_os_gpio_init_param gpio_init_sync_inb
extern

◆ led_gpio_desc

struct no_os_gpio_desc* led_gpio_desc
extern

◆ spi_init_params

struct no_os_spi_init_param spi_init_params
extern

◆ trigger_gpio_desc

struct no_os_gpio_desc* trigger_gpio_desc
extern

◆ trigger_irq_desc

struct no_os_irq_ctrl_desc* trigger_irq_desc
extern

◆ tx_trigger_desc

struct no_os_pwm_desc* tx_trigger_desc
extern

◆ uart_desc

struct no_os_uart_desc* uart_desc
extern