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

Configuration file for AD355xr device application. More...

#include <stdint.h>
#include "common.h"
#include "no_os_uart.h"
#include "no_os_pwm.h"
#include "no_os_irq.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 MBED_PLATFORM   0
 
#define STM32_PLATFORM   1
 
#define SPI_DMA   0
 
#define SPI_INTERRUPT   1
 
#define XSTR(s)   #s
 
#define STR(s)   XSTR(s)
 
#define DEV_AD3552R
 
#define ACTIVE_DEVICE_NAME   "ad3552r"
 
#define DEVICE_NAME   "DEV_AD3552R"
 
#define ACTIVE_DEVICE_ID   AD3552R_ID
 
#define NUMBER_OF_CHANNELS   2U
 
#define ACTIVE_PLATFORM   MBED_PLATFORM
 
#define USE_VIRTUAL_COM_PORT
 
#define INTERFACE_MODE   SPI_INTERRUPT
 
#define DAC_RESOLUTION   16
 
#define HW_CARRIER_NAME   TARGET_NAME
 
#define IIO_UART_BAUD_RATE   (230400)
 
#define FIRMWARE_NAME   "ad355xr_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 CONSOLE_STDIO_PORT_AVAILABLE
 
#define CONV_PERIOD_NSEC(x)   (((float)(1.0 / x) * 1000000) * 1000)
 
#define CONV_FREQUENCY_HZ(x)   (((float)(1.0 / x) * 1000000) * 1000)
 
#define CONV_DUTY_CYCLE_NSEC(x, y)   (((float)y / 100) * CONV_PERIOD_NSEC(x))
 

Functions

int32_t init_system (void)
 Initialize the system peripherals. More...
 
int32_t init_ldac_pwm_trigger (void)
 Initialize the PWM trigger contoller for ldac. More...
 
void ldac_pos_edge_detect_callback (void *ctx)
 Interrupt Service Routine to monitor ldac positive edge. More...
 

Variables

struct no_os_uart_desc * uart_iio_com_desc
 
struct no_os_pwm_desc * ldac_pwm_desc
 
struct no_os_pwm_desc * spi_dma_tx_stop_pwm_desc
 
struct no_os_irq_ctrl_desc * trigger_irq_desc
 

Detailed Description

Configuration file for AD355xr device application.

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

◆ ACTIVE_DEVICE_NAME

#define ACTIVE_DEVICE_NAME   "ad3552r"

◆ ACTIVE_PLATFORM

#define ACTIVE_PLATFORM   MBED_PLATFORM

◆ CONSOLE_STDIO_PORT_AVAILABLE

#define CONSOLE_STDIO_PORT_AVAILABLE

◆ CONV_DUTY_CYCLE_NSEC

#define CONV_DUTY_CYCLE_NSEC (   x,
 
)    (((float)y / 100) * CONV_PERIOD_NSEC(x))

◆ CONV_FREQUENCY_HZ

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

◆ CONV_PERIOD_NSEC

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

◆ DAC_RESOLUTION

#define DAC_RESOLUTION   16

◆ DEV_AD3552R

#define DEV_AD3552R

◆ DEVICE_NAME

#define DEVICE_NAME   "DEV_AD3552R"

◆ FIRMWARE_NAME

#define FIRMWARE_NAME   "ad355xr_iio"

◆ HW_CARRIER_NAME

#define HW_CARRIER_NAME   TARGET_NAME

◆ IIO_UART_BAUD_RATE

#define IIO_UART_BAUD_RATE   (230400)

◆ INTERFACE_MODE

#define INTERFACE_MODE   SPI_INTERRUPT

◆ MBED_PLATFORM

#define MBED_PLATFORM   0

◆ NUMBER_OF_CHANNELS

#define NUMBER_OF_CHANNELS   2U

◆ PLATFORM_NAME

#define PLATFORM_NAME   HW_CARRIER_NAME

◆ 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

◆ init_ldac_pwm_trigger()

int32_t init_ldac_pwm_trigger ( void  )

Initialize the PWM trigger contoller for ldac.

Returns
0 in case of success, negative error code otherwise

◆ 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

◆ ldac_pos_edge_detect_callback()

void ldac_pos_edge_detect_callback ( void *  ctx)

Interrupt Service Routine to monitor ldac positive edge.

Parameters
ctx[in]- Callback context (unused)
Returns
None
Note
this function is unused. we are handling ldac interrupt directly from EXTI IRQHandler.

Variable Documentation

◆ ldac_pwm_desc

struct no_os_pwm_desc* ldac_pwm_desc
extern

◆ spi_dma_tx_stop_pwm_desc

struct no_os_pwm_desc* spi_dma_tx_stop_pwm_desc
extern

◆ trigger_irq_desc

struct no_os_irq_ctrl_desc* trigger_irq_desc
extern

◆ uart_iio_com_desc

struct no_os_uart_desc* uart_iio_com_desc
extern