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

Configuration file for AD777x IIO firmware application. More...

#include <stdio.h>
#include <stdint.h>
#include "no_os_uart.h"
#include "no_os_gpio.h"
#include "app_config_mbed.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 STM32_PLATFORM   1
 
#define MBED_PLATFORM   2
 
#define BURST_DATA_CAPTURE   0
 
#define CONTINUOUS_DATA_CAPTURE   1
 
#define TDM_MODE   0
 
#define SPI_MODE   1
 
#define SD_ADC   0
 
#define SAR_ADC   1
 
#define ACTIVE_PLATFORM   MBED_PLATFORM
 
#define ADC_TYPE   SD_ADC
 
#define DATA_CAPTURE_MODE   CONTINUOUS_DATA_CAPTURE
 
#define BIPOLAR
 
#define XSTR(s)   #s
 
#define STR(s)   XSTR(s)
 
#define USE_VIRTUAL_COM_PORT
 
#define DEV_AD7770
 
#define ACTIVE_DEVICE   "ad7770"
 
#define DEVICE_NAME   "DEV_AD7770"
 
#define HW_MEZZANINE_NAME   "EVAL-AD7770ARDZ"
 
#define INTERFACE_MODE   SPI_MODE
 
#define BYTES_PER_SAMPLE   sizeof(uint32_t)
 
#define uart_extra_init_params   mbed_uart_extra_init_params
 
#define vcom_extra_init_params   mbed_vcom_extra_init_params
 
#define spi_extra_init_params   mbed_spi_extra_init_params
 
#define i2c_extra_init_params   mbed_i2c_extra_init_params
 
#define gpio_reset_extra_init_params   mbed_gpio_reset_extra_init_params
 
#define gpio_mode0_extra_init_params   mbed_gpio_mode0_extra_init_params
 
#define gpio_mode1_extra_init_params   mbed_gpio_mode1_extra_init_params
 
#define gpio_mode2_extra_init_params   mbed_gpio_mode2_extra_init_params
 
#define gpio_mode3_extra_init_params   mbed_gpio_mode3_extra_init_params
 
#define gpio_dclk0_extra_init_params   mbed_gpio_dclk0_extra_init_params
 
#define gpio_dclk1_extra_init_params   mbed_gpio_dclk1_extra_init_params
 
#define gpio_dclk2_extra_init_params   mbed_gpio_dclk2_extra_init_params
 
#define gpio_sync_in_extra_init_params   mbed_gpio_sync_in_extra_init_params
 
#define gpio_convst_sar_extra_init_params   mbed_gpio_convst_sar_extra_init_params
 
#define gpio_drdy_extra_init_params   mbed_gpio_drdy_extra_init_params
 
#define gpio_error_extra_init_params   mbed_gpio_error_extra_init_params
 
#define trigger_gpio_irq_extra_params   mbed_trigger_gpio_irq_init_params
 
#define pwm_extra_init_params   mbed_pwm_init_params
 
#define spi_platform_ops   mbed_spi_ops
 
#define i2c_ops   mbed_i2c_ops
 
#define gpio_platform_ops   mbed_gpio_ops
 
#define trigger_gpio_irq_ops   mbed_gpio_irq_ops
 
#define uart_ops   mbed_uart_ops
 
#define vcom_ops   mbed_virtual_com_ops
 
#define pwm_ops   mbed_pwm_ops
 
#define trigger_gpio_handle   0
 
#define HW_CARRIER_NAME   TARGET_NAME
 
#define CONSOLE_STDIO_PORT_AVAILABLE
 
#define FIRMWARE_NAME   "ad777x_iio"
 
#define PLATFORM_NAME   HW_CARRIER_NAME
 
#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 AD777x_NUM_CHANNELS   8
 
#define ADC_RESOLUTION   24
 
#define ADC_MAX_COUNT_UNIPOLAR   (uint32_t)((1 << ADC_RESOLUTION) - 1)
 
#define ADC_MAX_COUNT_BIPOLAR   (uint32_t)(1 << (ADC_RESOLUTION-1))
 
#define AD777X_EXT_MCLK_FREQ   500000
 
#define AD777x_MCLK_FREQ   8192000
 
#define AD777x_MCLK_PERIOD   (((float)(1.0 / AD777x_MCLK_FREQ) * 1000000) * 1000)
 

Functions

int32_t init_system (void)
 Initialize the system peripherals. More...
 
void data_capture_callback (void *ctx)
 Interrupt Service Routine to monitor data ready event. More...
 

Variables

struct no_os_uart_desc * uart_iio_com_desc
 
struct no_os_uart_desc * uart_console_stdio_desc
 
struct no_os_gpio_desc * gpio_drdy_desc
 
struct no_os_gpio_desc * gpio_error_desc
 
struct no_os_irq_ctrl_desc * trigger_irq_desc
 
struct no_os_tdm_desc * ad777x_tdm_desc
 
struct no_os_eeprom_desc * eeprom_desc
 

Detailed Description

Configuration file for AD777x IIO firmware application.

Copyright (c) 2022-2024 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

◆ ACTIVE_DEVICE

#define ACTIVE_DEVICE   "ad7770"

◆ ACTIVE_PLATFORM

#define ACTIVE_PLATFORM   MBED_PLATFORM

◆ AD777X_EXT_MCLK_FREQ

#define AD777X_EXT_MCLK_FREQ   500000

◆ AD777x_MCLK_FREQ

#define AD777x_MCLK_FREQ   8192000

◆ AD777x_MCLK_PERIOD

#define AD777x_MCLK_PERIOD   (((float)(1.0 / AD777x_MCLK_FREQ) * 1000000) * 1000)

◆ AD777x_NUM_CHANNELS

#define AD777x_NUM_CHANNELS   8

◆ 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

◆ ADC_TYPE

#define ADC_TYPE   SD_ADC

◆ BIPOLAR

#define BIPOLAR

◆ BURST_DATA_CAPTURE

#define BURST_DATA_CAPTURE   0

◆ BYTES_PER_SAMPLE

#define BYTES_PER_SAMPLE   sizeof(uint32_t)

◆ CONSOLE_STDIO_PORT_AVAILABLE

#define CONSOLE_STDIO_PORT_AVAILABLE

◆ CONTINUOUS_DATA_CAPTURE

#define CONTINUOUS_DATA_CAPTURE   1

◆ DATA_CAPTURE_MODE

#define DATA_CAPTURE_MODE   CONTINUOUS_DATA_CAPTURE

◆ DEV_AD7770

#define DEV_AD7770

◆ DEVICE_NAME

#define DEVICE_NAME   "DEV_AD7770"

◆ FIRMWARE_NAME

#define FIRMWARE_NAME   "ad777x_iio"

◆ gpio_convst_sar_extra_init_params

#define gpio_convst_sar_extra_init_params   mbed_gpio_convst_sar_extra_init_params

◆ gpio_dclk0_extra_init_params

#define gpio_dclk0_extra_init_params   mbed_gpio_dclk0_extra_init_params

◆ gpio_dclk1_extra_init_params

#define gpio_dclk1_extra_init_params   mbed_gpio_dclk1_extra_init_params

◆ gpio_dclk2_extra_init_params

#define gpio_dclk2_extra_init_params   mbed_gpio_dclk2_extra_init_params

◆ gpio_drdy_extra_init_params

#define gpio_drdy_extra_init_params   mbed_gpio_drdy_extra_init_params

◆ gpio_error_extra_init_params

#define gpio_error_extra_init_params   mbed_gpio_error_extra_init_params

◆ gpio_mode0_extra_init_params

#define gpio_mode0_extra_init_params   mbed_gpio_mode0_extra_init_params

◆ gpio_mode1_extra_init_params

#define gpio_mode1_extra_init_params   mbed_gpio_mode1_extra_init_params

◆ gpio_mode2_extra_init_params

#define gpio_mode2_extra_init_params   mbed_gpio_mode2_extra_init_params

◆ gpio_mode3_extra_init_params

#define gpio_mode3_extra_init_params   mbed_gpio_mode3_extra_init_params

◆ gpio_platform_ops

#define gpio_platform_ops   mbed_gpio_ops

◆ gpio_reset_extra_init_params

#define gpio_reset_extra_init_params   mbed_gpio_reset_extra_init_params

◆ gpio_sync_in_extra_init_params

#define gpio_sync_in_extra_init_params   mbed_gpio_sync_in_extra_init_params

◆ HW_CARRIER_NAME

#define HW_CARRIER_NAME   TARGET_NAME

◆ HW_MEZZANINE_NAME

#define HW_MEZZANINE_NAME   "EVAL-AD7770ARDZ"

◆ i2c_extra_init_params

#define i2c_extra_init_params   mbed_i2c_extra_init_params

◆ i2c_ops

#define i2c_ops   mbed_i2c_ops

◆ IIO_UART_BAUD_RATE

#define IIO_UART_BAUD_RATE   230400

◆ INTERFACE_MODE

#define INTERFACE_MODE   SPI_MODE

◆ MBED_PLATFORM

#define MBED_PLATFORM   2

◆ PLATFORM_NAME

#define PLATFORM_NAME   HW_CARRIER_NAME

◆ pwm_extra_init_params

#define pwm_extra_init_params   mbed_pwm_init_params

◆ pwm_ops

#define pwm_ops   mbed_pwm_ops

◆ SAR_ADC

#define SAR_ADC   1

◆ SD_ADC

#define SD_ADC   0

◆ spi_extra_init_params

#define spi_extra_init_params   mbed_spi_extra_init_params

◆ SPI_MODE

#define SPI_MODE   1

◆ spi_platform_ops

#define spi_platform_ops   mbed_spi_ops

◆ STM32_PLATFORM

#define STM32_PLATFORM   1

◆ STR

#define STR (   s)    XSTR(s)

◆ TDM_MODE

#define TDM_MODE   0

◆ trigger_gpio_handle

#define trigger_gpio_handle   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

◆ uart_extra_init_params

#define uart_extra_init_params   mbed_uart_extra_init_params

◆ uart_ops

#define uart_ops   mbed_uart_ops

◆ USE_VIRTUAL_COM_PORT

#define USE_VIRTUAL_COM_PORT

◆ vcom_extra_init_params

#define vcom_extra_init_params   mbed_vcom_extra_init_params

◆ vcom_ops

#define vcom_ops   mbed_virtual_com_ops

◆ 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

◆ data_capture_callback()

void data_capture_callback ( void *  ctx)

Interrupt Service Routine to monitor data ready event.

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

Interrupt Service Routine to monitor data ready event.

Parameters
ctx[in]- Callback context (unused)
Returns
none
Note
Callback registered for the the RDY interrupt to indicate end of conversion in case of burst data capturing.

Interrupt Service Routine to monitor data ready event.

Parameters
ctx[in]- Callback context (unused)
Returns
none
Note
Callback registered for the the DRDY interrupt to indicate end of conversion in case of burst data capturing with SPI operation.

◆ 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

Variable Documentation

◆ ad777x_tdm_desc

struct no_os_tdm_desc* ad777x_tdm_desc
extern

◆ eeprom_desc

struct no_os_eeprom_desc* eeprom_desc
extern

◆ gpio_drdy_desc

struct no_os_gpio_desc* gpio_drdy_desc
extern

◆ gpio_error_desc

struct no_os_gpio_desc* gpio_error_desc
extern

◆ trigger_irq_desc

struct no_os_irq_ctrl_desc* trigger_irq_desc
extern

◆ uart_console_stdio_desc

struct no_os_uart_desc* uart_console_stdio_desc
extern

◆ uart_iio_com_desc

struct no_os_uart_desc* uart_iio_com_desc
extern