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

Configuration file for AD7091R device application. More...

#include <stdint.h>
#include "ad7091r8.h"
#include "no_os_pwm.h"
#include "no_os_util.h"
#include "app_config_stm32.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 CONTINUOUS_DATA_CAPTURE   0
 
#define BURST_DATA_CAPTURE   1
 
#define SPI_DMA   0
 
#define SPI_INTERRUPT   1
 
#define XSTR(s)   #s
 
#define STR(s)   XSTR(s)
 
#define DATA_CAPTURE_MODE   BURST_DATA_CAPTURE
 
#define ACTIVE_PLATFORM   STM32_PLATFORM
 
#define USE_VIRTUAL_COM_PORT
 
#define INTERFACE_MODE   SPI_DMA
 
#define ADC_INTERNAL_VREF_MV   2500
 
#define ADC_VDD_V   3.3
 
#define ADC_MIN_VREF   1.0
 
#define ACTIVE_DEVICE_NAME   "ad7091r-8"
 
#define DEVICE_NAME   "DEV_AD7091R_8"
 
#define ACTIVE_DEVICE_ID   AD7091R8
 
#define ADC_RESOLUTION   12
 
#define HW_MEZZANINE_NAME   "EVAL-AD7091R-8ARDZ"
 
#define ADC_MAX_COUNT   (uint32_t)((1 << ADC_RESOLUTION) - 1)
 
#define HW_CARRIER_NAME   TARGET_NAME
 
#define BYTES_PER_SAMPLE   sizeof(uint16_t)
 
#define IIO_UART_BAUD_RATE   (230400)
 
#define FIRMWARE_NAME   "ad7091r_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 CONV_TRIGGER_PERIOD_NSEC(x)   (((float)(1.0 / x) * 1000000) * 1000)
 
#define CONV_TRIGGER_DUTY_CYCLE_NSEC(x)   (((float)PWM_DUTY_CYCLE_PERCENT / 100) * CONV_TRIGGER_PERIOD_NSEC(x))
 

Functions

void burst_capture_callback (void *context)
 Interrupt Service Routine to monitor end of conversion event. More...
 
int init_system (void)
 Initialize the system peripherals. More...
 
int init_pwm_trigger (void)
 Initialize the PWM trigger contoller. More...
 

Variables

struct no_os_pwm_desc * pwm_desc
 
struct no_os_uart_desc * uart_iio_com_desc
 
struct no_os_uart_desc * uart_console_stdio_desc
 
struct no_os_eeprom_desc * eeprom_desc
 
struct no_os_irq_ctrl_desc * trigger_irq_desc
 
struct no_os_pwm_init_param pwm_init_params
 
struct no_os_pwm_desc * tx_trigger_desc
 
struct no_os_pwm_init_param cs_init_params
 
struct no_os_dma_init_param ad7091r_dma_init_param
 
struct no_os_gpio_init_param pwm_gpio_params
 
struct no_os_gpio_init_param cs_pwm_gpio_params
 
volatile struct iio_device_data * global_iio_dev_data
 
uint32_t global_nb_of_samples
 
volatile uint32_t * buff_start_addr
 
int32_t data_read
 

Detailed Description

Configuration file for AD7091R device application.

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

#define ACTIVE_DEVICE_ID   AD7091R8

◆ ACTIVE_DEVICE_NAME

#define ACTIVE_DEVICE_NAME   "ad7091r-8"

◆ ACTIVE_PLATFORM

#define ACTIVE_PLATFORM   STM32_PLATFORM

◆ ADC_INTERNAL_VREF_MV

#define ADC_INTERNAL_VREF_MV   2500

◆ ADC_MAX_COUNT

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

◆ ADC_MIN_VREF

#define ADC_MIN_VREF   1.0

◆ ADC_RESOLUTION

#define ADC_RESOLUTION   12

◆ ADC_VDD_V

#define ADC_VDD_V   3.3

◆ BURST_DATA_CAPTURE

#define BURST_DATA_CAPTURE   1

◆ BYTES_PER_SAMPLE

#define BYTES_PER_SAMPLE   sizeof(uint16_t)

◆ CONTINUOUS_DATA_CAPTURE

#define CONTINUOUS_DATA_CAPTURE   0

◆ CONV_TRIGGER_DUTY_CYCLE_NSEC

#define CONV_TRIGGER_DUTY_CYCLE_NSEC (   x)    (((float)PWM_DUTY_CYCLE_PERCENT / 100) * CONV_TRIGGER_PERIOD_NSEC(x))

◆ CONV_TRIGGER_PERIOD_NSEC

#define CONV_TRIGGER_PERIOD_NSEC (   x)    (((float)(1.0 / x) * 1000000) * 1000)

◆ DATA_CAPTURE_MODE

#define DATA_CAPTURE_MODE   BURST_DATA_CAPTURE

◆ DEVICE_NAME

#define DEVICE_NAME   "DEV_AD7091R_8"

◆ FIRMWARE_NAME

#define FIRMWARE_NAME   "ad7091r_iio"

◆ HW_CARRIER_NAME

#define HW_CARRIER_NAME   TARGET_NAME

◆ HW_MEZZANINE_NAME

#define HW_MEZZANINE_NAME   "EVAL-AD7091R-8ARDZ"

◆ IIO_UART_BAUD_RATE

#define IIO_UART_BAUD_RATE   (230400)

◆ INTERFACE_MODE

#define INTERFACE_MODE   SPI_DMA

◆ SPI_DMA

#define SPI_DMA   0

◆ SPI_INTERRUPT

#define SPI_INTERRUPT   1

◆ STM32_PLATFORM

#define STM32_PLATFORM   1

◆ STR

#define STR (   s)    XSTR(s)

◆ USE_VIRTUAL_COM_PORT

#define USE_VIRTUAL_COM_PORT

◆ 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

◆ burst_capture_callback()

void burst_capture_callback ( void *  context)

Interrupt Service Routine to monitor end of conversion event.

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

Interrupt Service Routine to monitor end of conversion event.

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

◆ init_pwm_trigger()

int init_pwm_trigger ( void  )

Initialize the PWM trigger contoller.

Returns
0 in case of success, negative error code otherwise

Initialize the PWM trigger contoller.

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

◆ init_system()

int 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

◆ ad7091r_dma_init_param

struct no_os_dma_init_param ad7091r_dma_init_param
extern

◆ buff_start_addr

volatile uint32_t* buff_start_addr
extern

◆ cs_init_params

struct no_os_pwm_init_param cs_init_params
extern

◆ cs_pwm_gpio_params

struct no_os_gpio_init_param cs_pwm_gpio_params
extern

◆ data_read

int32_t data_read
extern

◆ eeprom_desc

struct no_os_eeprom_desc* eeprom_desc
extern

◆ global_iio_dev_data

volatile struct iio_device_data* global_iio_dev_data
extern

◆ global_nb_of_samples

uint32_t global_nb_of_samples
extern

◆ pwm_desc

struct no_os_pwm_desc* pwm_desc
extern

◆ pwm_gpio_params

struct no_os_gpio_init_param pwm_gpio_params
extern

◆ pwm_init_params

struct no_os_pwm_init_param pwm_init_params
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_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