precision-converters-firmware
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
ad4692_support.h File Reference

Support header file for AD4692. More...

#include "no_os_gpio.h"
#include "ad4692.h"
Include dependency graph for ad4692_support.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AD4692_MAX_SLOTS_AS   128
 
#define CS_CHANGE   1
 
#define AD4692_N_CNV_TOGGLES   2
 
#define AD4692_EXIT_MANUAL_MODE   0x0
 

Enumerations

enum  ad4692_sequencer_modes {
  STANDARD_SEQUENCER ,
  ADVANCED_SEQUENCER
}
 AD4692 sequencer modes. More...
 

Functions

int ad4692_toggle_cnv (struct no_os_gpio_desc *gpio_cnv)
 Toggle CNV GPIO.
 
int ad4692_configure_channel_priorities (uint8_t *chn_priorities, uint8_t *channel_sequence, uint8_t *num_as_slots, uint8_t *acc_count)
 Configure the advanced sequencer slots.
 
int ad4692_configure_acc_mask (uint16_t channel_mask, enum ad4692_sequencer_modes sequencer, uint8_t *chn_priorities)
 Configure the accumulator mask.
 
int ad4692_exit_manual_mode (struct ad4692_desc *desc, struct no_os_gpio_desc *cnv_desc)
 Exit manual mode and switch to CNV clock mode.
 

Detailed Description

Support header file for AD4692.

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.

Macro Definition Documentation

◆ AD4692_EXIT_MANUAL_MODE

#define AD4692_EXIT_MANUAL_MODE   0x0

◆ AD4692_MAX_SLOTS_AS

#define AD4692_MAX_SLOTS_AS   128

◆ AD4692_N_CNV_TOGGLES

#define AD4692_N_CNV_TOGGLES   2

◆ CS_CHANGE

#define CS_CHANGE   1

Enumeration Type Documentation

◆ ad4692_sequencer_modes

AD4692 sequencer modes.

Enumerator
STANDARD_SEQUENCER 
ADVANCED_SEQUENCER 

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_exit_manual_mode()

int ad4692_exit_manual_mode ( struct ad4692_desc *  desc,
struct no_os_gpio_desc *  cnv_desc 
)

Exit manual mode and switch to CNV clock mode.

Parameters
descPointer to the AD4692 descriptor.
cnv_descPointer to the CNV GPIO descriptor.
Returns
int 0 on success, negative error code on failure.

◆ 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.
Here is the caller graph for this function: