|
precision-converters-firmware
|
Source file for the AD552XR IIO Application Support. More...
#include <stdint.h>#include "app_config.h"#include "ad552xr_support.h"#include "ad552xr_user_config.h"#include "ad552xr.h"#include "no_os_error.h"#include "no_os_alloc.h"#include "no_os_util.h"#include "no_os_spi.h"#include "stm32_pwm_ex.h"
Classes | |
| struct | ad552xr_spi_intr_tx_info |
| Structure to hold the SPI transfer information in SPI interrupt mode. | |
Macros | |
| #define | TIM_COMPENSATION (150) |
| #define | TIM_BYTE_TRANSFER (8 * HZ_NS_CONVERT(SPI_SPEED)) |
| #define | NUM_BYTES_TRANSFER |
| #define | TIM_DMA_HIGH_TIME (TIM_BYTE_TRANSFER) |
| #define | TIM_DMA_LOW_TIME (20) |
| #define | TIM_DMA_PERIOD (TIM_DMA_LOW_TIME + TIM_DMA_HIGH_TIME) |
| #define | TIM_CS_HIGH_TIME (100) |
| #define | TIM_CS_LOW_TIME (NUM_BYTES_TRANSFER * TIM_DMA_PERIOD) |
| #define | TIM_DAC_UPDATE_PERIOD (TIM_CS_LOW_TIME + TIM_COMPENSATION) |
Functions | |
| int32_t | ad552xr_set_sampling_rate (uint32_t val) |
| Set the sampling rate. | |
| int32_t | ad552xr_get_sampling_rate (uint32_t *val) |
| Get the sampling rate. | |
| int32_t | ad552xr_data_transfer_start (struct iio_device_data *iio_dev_data, uint8_t *dst_data_buffer) |
| Start the device data transfer for SPI interrupt interface mode. | |
| int32_t | ad552xr_data_transfer_system_init (void) |
| Initialize the Data Transfer System. | |
| int32_t | ad552xr_data_transfer_system_remove (void) |
| De-initialize the Data Transfer System. | |
| int32_t | ad552xr_data_transfer_prepare (void *dev, uint32_t mask) |
| Prepares the device for data transfer. | |
| int32_t | ad552xr_data_transfer_stop (void *dev) |
| Stop the device data transfer. | |
Source file for the AD552XR IIO Application Support.
This module contains support functions needed for IIO application
Copyright (c) 2026 Analog Devices, Inc.
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.
| #define NUM_BYTES_TRANSFER |
| #define TIM_BYTE_TRANSFER (8 * HZ_NS_CONVERT(SPI_SPEED)) |
| #define TIM_COMPENSATION (150) |
| #define TIM_CS_HIGH_TIME (100) |
| #define TIM_CS_LOW_TIME (NUM_BYTES_TRANSFER * TIM_DMA_PERIOD) |
| #define TIM_DAC_UPDATE_PERIOD (TIM_CS_LOW_TIME + TIM_COMPENSATION) |
| #define TIM_DMA_HIGH_TIME (TIM_BYTE_TRANSFER) |
| #define TIM_DMA_LOW_TIME (20) |
| #define TIM_DMA_PERIOD (TIM_DMA_LOW_TIME + TIM_DMA_HIGH_TIME) |
| int32_t ad552xr_data_transfer_prepare | ( | void * | dev, |
| uint32_t | mask | ||
| ) |
Prepares the device for data transfer.
| dev[in,out]- | Application descriptor. |
| mask[in]- | Channels select mask. |
| int32_t ad552xr_data_transfer_start | ( | struct iio_device_data * | iio_dev_data, |
| uint8_t * | dst_data_buffer | ||
| ) |
Start the device data transfer for SPI interrupt interface mode.
This function will be called from IIO Trigger ISR. In the first call, it will populate the data buffer with valid data and LDAC commands. Then it will enable TGP timer to trigger HW LDAC if necessary. The SPI data frames will be transferred for every function call. In the end of the LDAC cycle, if SW LDAC is configured for any channel, it will be triggered in the end of SPI transfer. This cycle will be repeated until the stop function is called.
| iio_dev_data[in] | - IIO device data instance. |
| dst_data_buffer[in,out] | - Destination data buffer to populate the data. |
| int32_t ad552xr_data_transfer_stop | ( | void * | dev | ) |
Stop the device data transfer.
| dev[in,out]- | Application descriptor. |
| int32_t ad552xr_data_transfer_system_init | ( | void | ) |
Initialize the Data Transfer System.

| int32_t ad552xr_data_transfer_system_remove | ( | void | ) |
De-initialize the Data Transfer System.

| int32_t ad552xr_get_sampling_rate | ( | uint32_t * | val | ) |
Get the sampling rate.
| val[out] | - Sample rate value. |
| int32_t ad552xr_set_sampling_rate | ( | uint32_t | val | ) |
Set the sampling rate.
| val[in] | - Sample rate value. |