precision-converters-firmware
Loading...
Searching...
No Matches
Macros | Functions | Variables
app_config.c File Reference

Application configurations module for digipots IIO FW. More...

#include <stdbool.h>
#include "app_config.h"
Include dependency graph for app_config.c:

Macros

#define SPI_CLOCK   1000000
 
#define I2C_CLOCK   100000
 
#define SPI_DEV_NUM   1
 

Functions

int32_t init_system (void)
 Initialize system peripherals.
 

Variables

struct no_os_spi_init_param spi_mode2_init_params
 
struct no_os_spi_init_param spi_mode0_init_params
 
struct no_os_i2c_init_param i2c_init_params
 
struct no_os_uart_init_param uart_iio_comm_init_params
 
struct no_os_uart_init_param uart_console_stdio_init_params
 
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
 
active_dpot_device oactive_dev
 

Detailed Description

Application configurations module for digipots IIO FW.

Copyright 2025(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ I2C_CLOCK

#define I2C_CLOCK   100000

◆ SPI_CLOCK

#define SPI_CLOCK   1000000

◆ SPI_DEV_NUM

#define SPI_DEV_NUM   1

Function Documentation

◆ init_system()

int32_t init_system ( void  )

Initialize system peripherals.

Initialize the system peripherals.

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

Variable Documentation

◆ eeprom_desc

struct no_os_eeprom_desc* eeprom_desc

◆ i2c_init_params

struct no_os_i2c_init_param i2c_init_params
Initial value:
= {
.device_id = I2C_ID,
.platform_ops = &i2c_ops,
.max_speed_hz = I2C_CLOCK
}
#define i2c_ops
Definition app_config_stm32.h:111
#define I2C_CLOCK
Definition app_config.c:43
#define I2C_ID
Definition app_config_stm32.h:42

◆ oactive_dev

active_dpot_device oactive_dev
Initial value:
= {
.intf_type = DEFAULT_INTERFACE_TYPE,
.active_device_name = DEFAULT_DEVICE_NAME,
.active_device = DEFAULT_ACTIVE_DEVICE,
.device_i2c_addr = DEFAULT_DEVICE_I2C_ADDR,
.max_chns_pot = DEFAULT_NUM_CHNS_POT,
.max_chns_linGain = DEFAULT_NUM_CHNS_LINGAIN,
}
#define DEFAULT_INTERFACE_TYPE
Definition app_config.h:113
#define DEFAULT_NUM_CHNS_POT
Definition app_config.h:110
#define DEFAULT_OPERATING_MODE
Definition app_config.h:112
#define DEFAULT_DEVICE_NAME
Definition app_config.h:108
#define DEFAULT_NUM_CHNS_LINGAIN
Definition app_config.h:111
#define DEFAULT_DEVICE_I2C_ADDR
Definition app_config.h:109
#define DEFAULT_ACTIVE_DEVICE
Definition app_config.h:107

◆ spi_mode0_init_params

struct no_os_spi_init_param spi_mode0_init_params
Initial value:
= {
.max_speed_hz = SPI_CLOCK,
.mode = NO_OS_SPI_MODE_0,
.chip_select = SPI_CSB,
.platform_ops = &spi_ops,
.device_id = SPI_DEV_NUM,
}
#define spi_ops
Definition app_config.h:86
#define spi_extra_init_params
Definition app_config.h:80
#define SPI_CSB
Definition app_config_mbed.h:33
#define SPI_CLOCK
Definition app_config.c:42
#define SPI_DEV_NUM
Definition app_config.c:44

◆ spi_mode2_init_params

struct no_os_spi_init_param spi_mode2_init_params
Initial value:
= {
.max_speed_hz = SPI_CLOCK,
.mode = NO_OS_SPI_MODE_2,
.chip_select = SPI_CSB,
.platform_ops = &spi_ops,
.device_id = SPI_DEV_NUM,
}

◆ uart_console_stdio_desc

struct no_os_uart_desc* uart_console_stdio_desc

◆ uart_console_stdio_init_params

struct no_os_uart_init_param uart_console_stdio_init_params
Initial value:
= {
.device_id = UART_ID,
.baud_rate = IIO_UART_BAUD_RATE,
.size = NO_OS_UART_CS_8,
.parity = NO_OS_UART_PAR_NO,
.stop = NO_OS_UART_STOP_1_BIT,
.asynchronous_rx = true,
.irq_id = UART_IRQ_ID,
.platform_ops = &uart_ops,
}
#define uart_extra_init_params
Definition app_config.h:78
#define IIO_UART_BAUD_RATE
Definition app_config.h:164
#define uart_ops
Definition app_config.h:87
#define UART_ID
Definition app_config_stm32.h:77
#define UART_IRQ_ID
Definition app_config_stm32.h:43

◆ uart_iio_com_desc

struct no_os_uart_desc* uart_iio_com_desc

◆ uart_iio_comm_init_params

struct no_os_uart_init_param uart_iio_comm_init_params
Initial value:
= {
.device_id = UART_ID,
.baud_rate = IIO_UART_BAUD_RATE,
.size = NO_OS_UART_CS_8,
.parity = NO_OS_UART_PAR_NO,
.stop = NO_OS_UART_STOP_1_BIT,
.asynchronous_rx = true,
.irq_id = APP_UART_USB_IRQ,
.platform_ops = &vcom_ops,
}
#define vcom_extra_init_params
Definition app_config.h:79
#define vcom_ops
Definition app_config.h:88
#define APP_UART_USB_IRQ
Definition app_config_stm32.h:46