|
precision-converters-firmware
|
Support file for AD4692 device. More...
#include "string.h"#include "ad4692_support.h"#include "ad4692_iio.h"#include "app_config.h"#include "no_os_error.h"#include "no_os_delay.h"#include "no_os_util.h"
Functions | |
| int32_t | ad4692_data_transfer_init (struct ad4692_desc *desc, enum ad4692_spi_mode mode) |
| Initialize the data transfer system for a given ADC mode. | |
| int32_t | ad4692_data_transfer_read_converted_data (struct ad4692_desc *desc, uint8_t chn, uint32_t *adc_data) |
| Delegation: read converted data from active mode. | |
| void | ad4692_update_active_channels (uint32_t ch_mask) |
| Update active channels based on sequencer mode and channel mask. | |
| int32_t | ad4692_data_transfer_prepare (void *dev, uint32_t ch_mask) |
| Delegation: prepare transfer for active mode. | |
| int32_t | ad4692_data_transfer_end (void *dev) |
| Delegation: end transfer for active mode. | |
| int32_t | ad4692_data_transfer_remove (struct ad4692_desc *desc) |
| Delegation: remove active mode resources. | |
| int32_t | ad4692_data_transfer_submit (struct iio_device_data *iio_dev_data) |
| Delegation: submit samples for active mode. | |
| int32_t | ad4692_data_transfer_trigger_handler (struct iio_device_data *iio_dev_data) |
| Delegation: trigger handler for active mode. | |
| int32_t | ad4692_data_transfer_update_freq (uint32_t *sampling_rate) |
| Delegation: update sampling frequency for active mode. | |
| uint32_t | ad4692_get_max_sampling_rate (enum ad4692_spi_mode mode) |
| Get maximum sampling rate for a given ADC mode. | |
| void | ad4692_get_tx_command (uint8_t *local_tx_data) |
| Get the Tx buffer respective to the enabled channels. | |
| int | ad4692_configure_acc_mask (uint16_t channel_mask, enum ad4692_sequencer_modes sequencer, uint8_t *chn_priorities) |
| Configure the accumulator mask. | |
| int | ad4692_configure_channel_priorities (uint8_t *chn_priorities, uint8_t *channel_sequence, uint8_t *num_of_as_slots, uint8_t *acc_count) |
| Configure the advanced sequencer slots. | |
| int | ad4692_configure_channel (struct ad4692_desc *desc) |
| Configure the per channel accumulator count limit and enable the desired channels in the AD4692 device. | |
| int | ad4692_exit_manual_mode (struct ad4692_desc *desc) |
| Exit manual mode and switch to CNV clock mode. | |
| int | ad4692_configure_pwm_rate (struct no_os_pwm_desc *desc, uint32_t sampling_rate) |
| Configure PWM with optimal prescaler for given sampling rate. | |
Variables | |
| volatile bool | buf_size_updated = false |
Support file for AD4692 device.
Copyright (c) 2026 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.
| int ad4692_configure_acc_mask | ( | uint16_t | channel_mask, |
| enum ad4692_sequencer_modes | sequencer, | ||
| uint8_t * | chn_priorities | ||
| ) |
Configure the accumulator mask.
| channel_mask[in] | - Channel mask (Applicable in case of standard sequencer) |
| sequencer[in] | - Sequencer mode |
| chn_priorities[in] | - Channel priority (Applicable in case of advanced sequencer) |

| int ad4692_configure_channel | ( | struct ad4692_desc * | desc | ) |
Configure the per channel accumulator count limit and enable the desired channels in the AD4692 device.
| desc[in] | - AD4692 device descriptor |
| int ad4692_configure_channel_priorities | ( | uint8_t * | chn_priorities, |
| uint8_t * | channel_sequence, | ||
| uint8_t * | num_of_as_slots, | ||
| uint8_t * | acc_count | ||
| ) |
Configure the advanced sequencer slots.
| chn_priorities[in] | - channel priorities to be configured |
| channel_sequence[out] | - Channel sequence as configured in the AS Slots |
| num_of_as_slots[out] | - Number of slots in the advanced sequencer |
| acc_count[in] | - Accumulator count limit |
This function configures the advanced sequencer slots based on the priorities assigned to each channel(max 2 priorities are allowed in the application). Example: If the user configures the following channels as P1 (highest priority): Ch0,Ch1,Ch2 and the following as P2 (Least priority): Ch3,Ch4 Then the advanced sequencer configurations would look like: Ch0-Ch1-Ch2-Ch3-Ch0-Ch1-Ch2-Ch4

| int ad4692_configure_pwm_rate | ( | struct no_os_pwm_desc * | desc, |
| uint32_t | sampling_rate | ||
| ) |
Configure PWM with optimal prescaler for given sampling rate.
| desc[in] | - PWM descriptor to configure |
| sampling_rate[in] | - Desired sampling rate in samples per second |
| int32_t ad4692_data_transfer_end | ( | void * | dev | ) |
Delegation: end transfer for active mode.
| dev[in] | - IIO device instance |
| int32_t ad4692_data_transfer_init | ( | struct ad4692_desc * | desc, |
| enum ad4692_spi_mode | mode | ||
| ) |
Initialize the data transfer system for a given ADC mode.
| desc[in] | - AD4692 device descriptor |
| mode[in] | - ADC mode to initialize |

| int32_t ad4692_data_transfer_prepare | ( | void * | dev, |
| uint32_t | ch_mask | ||
| ) |
Delegation: prepare transfer for active mode.
| dev[in] | - IIO device instance |
| ch_mask[in] | - Channel mask indicating which channels to enable |
| int32_t ad4692_data_transfer_read_converted_data | ( | struct ad4692_desc * | desc, |
| uint8_t | chn, | ||
| uint32_t * | adc_data | ||
| ) |
Delegation: read converted data from active mode.
| desc[in] | - AD4692 device descriptor |
| chn[in] | - Channel number to read |
| adc_data[out] | - Pointer to store the converted data |

| int32_t ad4692_data_transfer_remove | ( | struct ad4692_desc * | desc | ) |
Delegation: remove active mode resources.
| desc[in] | - AD4692 device descriptor |

| int32_t ad4692_data_transfer_submit | ( | struct iio_device_data * | iio_dev_data | ) |
Delegation: submit samples for active mode.
| iio_dev_data[in] | - IIO device data instance |
| int32_t ad4692_data_transfer_trigger_handler | ( | struct iio_device_data * | iio_dev_data | ) |
Delegation: trigger handler for active mode.
| iio_dev_data[in] | - IIO device data instance |
| int32_t ad4692_data_transfer_update_freq | ( | uint32_t * | sampling_rate | ) |
Delegation: update sampling frequency for active mode.
| sampling_rate[in,out] | - Pointer to requested/actual sampling rate |

| int ad4692_exit_manual_mode | ( | struct ad4692_desc * | desc | ) |
Exit manual mode and switch to CNV clock mode.
| desc[in] | - AD4692 device descriptor |

| uint32_t ad4692_get_max_sampling_rate | ( | enum ad4692_spi_mode | mode | ) |
Get maximum sampling rate for a given ADC mode.
| mode[in] | - ADC mode |

| void ad4692_get_tx_command | ( | uint8_t * | local_tx_data | ) |
Get the Tx buffer respective to the enabled channels.
| local_tx_data[out] | - Tx buffer to populate with channel commands |
| void ad4692_update_active_channels | ( | uint32_t | ch_mask | ) |
Update active channels based on sequencer mode and channel mask.
| ch_mask[in] | - Channel mask (used in standard sequencer mode) |
| volatile bool buf_size_updated = false |