precision-converters-firmware
Loading...
Searching...
No Matches
Functions
ad4692_support.c File Reference

Support file for AD4692 device. More...

#include "ad4692_support.h"
#include "no_os_error.h"
#include "no_os_delay.h"
#include "app_config.h"
#include "ad4692_iio.h"
#include "string.h"
Include dependency graph for ad4692_support.c:

Functions

int ad4692_toggle_cnv (struct no_os_gpio_desc *gpio_cnv)
 Toggle CNV GPIO.
 
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.
 

Detailed Description

Support file for AD4692 device.

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

Function Documentation

◆ ad4692_configure_acc_mask()

int ad4692_configure_acc_mask ( uint16_t  channel_mask,
enum ad4692_sequencer_modes  sequencer,
uint8_t *  chn_priorities 
)

Configure the accumulator mask.

Parameters
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)
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad4692_configure_channel_priorities()

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.

Parameters
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
Returns
0 in case of success, negative error code otherwise.

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

Here is the caller graph for this function:

◆ ad4692_toggle_cnv()

int ad4692_toggle_cnv ( struct no_os_gpio_desc *  gpio_cnv)

Toggle CNV GPIO.

Parameters
gpio_cnv[in,out]- GPIO CNV Descriptor
Returns
0 in case of success, negative error code otherwise.