21#include "no_os_gpio.h"
22#include "no_os_uart.h"
31#define MBED_PLATFORM 1
32#define STM32_PLATFORM 2
35#define CONTINUOUS_DATA_CAPTURE 0
36#define WINDOWED_DATA_CAPTURE 1
39#define STRAIGHT_BINARY 0
40#define TWOS_COMPLEMENT 1
49#if !defined(ACTIVE_PLATFORM)
50#define ACTIVE_PLATFORM STM32_PLATFORM
56#if !defined(USE_PHY_COM_PORT)
57#define USE_VIRTUAL_COM_PORT
61#if !defined(APP_CAPTURE_MODE)
62#define APP_CAPTURE_MODE WINDOWED_DATA_CAPTURE
66#if !defined(ADC_DATA_FORMAT)
67#define ADC_DATA_FORMAT TWOS_COMPLEMENT
70#define ACTIVE_DEVICE_NAME "ad405x"
71#define DEVICE_NAME "DEV_AD405x"
73#if (ACTIVE_PLATFORM == MBED_PLATFORM)
75#define HW_CARRIER_NAME TARGET_NAME
76#define CONSOLE_STDIO_PORT_AVAILABLE
77#elif (ACTIVE_PLATFORM == STM32_PLATFORM)
78#include "app_config_stm32.h"
79#define HW_CARRIER_NAME TARGET_NAME
80#define IIO_TRIGGER_HANDLE_SPI 0
81#define TRIGGER_INT_ID_SPI_INTR GP1_PIN_NUM
82#define IIO_TRIGGER_HANDLE_I3C CNV_TIMER_HANDLE
83#define TRIGGER_INT_ID_I3C_INTR CNV_PWM_TIMER_IRQ_ID
85#error "No/Invalid active platform selected"
88#define DEFAULT_BURST_SAMPLE_RATE 2000000
91#define ADC_REF_VOLTAGE 2.5
95#define MIN_DATA_CAPTURE_TIME_NS 8000
99#if (APP_CAPTURE_MODE == CONTINUOUS_DATA_CAPTURE)
100#define MIN_INTERRUPT_OVER_HEAD 4500
102#define MIN_INTERRUPT_OVER_HEAD 3000
106#define IIO_UART_BAUD_RATE (230400)
110#define FIRMWARE_NAME "ad405x_iio"
112#if !defined(PLATFORM_NAME)
113#define PLATFORM_NAME HW_CARRIER_NAME
119#define VIRTUAL_COM_PORT_VID 0x0456
120#define VIRTUAL_COM_PORT_PID 0xb66c
122#define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" DEVICE_NAME "_" STR(PLATFORM_NAME))
130#ifdef USE_PHY_COM_PORT
131#ifdef CONSOLE_STDIO_PORT_AVAILABLE
132#undef CONSOLE_STDIO_PORT_AVAILABLE
137#if defined(SDRAM_SUPPORT_AVAILABLE)
138#define DATA_BUFFER_SIZE SDRAM_SIZE_BYTES
140#ifdef SPI_SUPPORT_AVAILABLE
141#define DATA_BUFFER_SIZE (131072)
142#define DUMMY_DATA_COUNT 0
144#define DATA_BUFFER_SIZE (524288)
145#define DUMMY_DATA_COUNT 1
148#define DATA_BUFFER_SIZE_CONT 64000
152#define STORAGE_BITS_SAMPLE 16
153#define AD4050_SAMPLE_RES 12
154#define AD4052_SAMPLE_RES 16
155#define AD4060_SAMPLE_RES 12
156#define AD4062_SAMPLE_RES 16
158#define STORAGE_BITS_AVG 32
159#define AD4050_AVG_RES 14
160#define AD4052_AVG_RES 20
161#define AD4060_AVG_RES 14
162#define AD4062_AVG_RES 20
165#define BYTES_PER_SAMPLE(x) (x/8)
168#define PWM_PERIOD_TO_FREQUENCY(x) (1000000000.0 / x)
170#define PWM_FREQUENCY_TO_PERIOD(x) PWM_PERIOD_TO_FREQUENCY(x)
180extern struct no_os_pwm_desc *
pwm_desc;
struct no_os_irq_ctrl_desc * trigger_irq_desc
Definition app_config.c:103
int32_t init_system(void)
Initialize the system peripherals.
Definition app_config.c:185
struct no_os_pwm_desc * tx_trigger_desc
Definition app_config.c:149
struct no_os_pwm_desc * pwm_desc
Definition app_config.c:106
struct no_os_gpio_desc * trigger_gpio_desc
Definition app_config.c:170
struct no_os_uart_desc * uart_iio_com_desc
Definition app_config.c:164
struct no_os_gpio_init_param pwm_gpio_params
Definition app_config.c:87
int32_t init_pwm(void)
Initialize the PWM interface.
Definition app_config.c:267
struct no_os_dma_ch dma_chan
volatile struct iio_device_data * iio_dev_data_g
Definition ad405x_iio.c:281
struct no_os_pwm_init_param spi_dma_pwm_init_params
Definition app_config.c:96
struct no_os_pwm_init_param spi_intr_pwm_init_params
Definition app_config.c:109
uint8_t bytes_per_sample
Definition ad405x_iio.c:290
struct no_os_pwm_init_param i3c_intr_pwm_init_params
Definition app_config.c:133
struct no_os_dma_xfer_desc dma_tx_desc
uint32_t data_read
Definition app_support.c:49
int32_t ad405x_gpio_reset(void)
volatile uint8_t ad405x_i3c_dyn_addr
volatile uint8_t * buff_start_addr
Definition ad405x_iio.c:140
struct no_os_pwm_init_param i3c_dma_pwm_init_params
Definition app_config.c:122
int32_t init_system_post_verification(void)
Initializing system peripherals.
Definition app_config.c:575
struct no_os_dma_xfer_desc i3c_cr_dma_xfer
Definition app_config.c:183
struct no_os_gpio_init_param cs_pwm_gpio_params
Definition app_config.c:196
struct no_os_pwm_init_param cs_init_params
Definition app_config.c:123
struct no_os_irq_ctrl_desc * pwm_irq_desc
Definition app_config.c:240
uint32_t nb_of_bytes_g
Definition app_support.c:45
int32_t deinit_pwm(void)
DeInitialize the PWM interface.
Definition app_config.c:420
struct no_os_dma_desc * ad405x_dma_desc
Definition app_config.c:249
struct no_os_dma_init_param ad405x_dma_init_param
Definition app_config.c:254
struct no_os_eeprom_init_param eeprom_init_params
Definition app_config.c:228
struct no_os_pwm_desc * cs_pwm_desc
Definition app_config.c:251
uint32_t nb_of_bytes_remaining_g
Definition app_support.c:46
struct no_os_uart_desc * uart_console_stdio_desc
Definition app_config.c:100
Header file for Mbed platform configurations.