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

Header for AD4134 IIO application. More...

#include <stdbool.h>
#include "ad713x.h"
Include dependency graph for ad4134_support.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AD7134_CONV_TIMEOUT   10000
 
#define AD713X_DEV_CONFIG_PWR_MODE_RD(x)   (((x) >> 1) & 0x1)
 
#define AD713X_DATA_PACKET_CONFIG_FRAME_RD(x)   (((x) >> 4) & 0x7)
 
#define AD713X_DATA_PACKET_CONFIG_DCLK_FREQ_MODE_RD(x)   (((x) >> 0) & 0xF)
 
#define AD713X_DIG_INT_CONFIG_FORMAT_MODE_RD(x)   (((x) >> 0) & 0x3)
 
#define AD713X_DIGFILTER_SEL_CH_MODE_RD(x, ch)   (((x) >> (2 * ch)) & 0x3)
 

Enumerations

enum  ad4134_data_capture_modes {
  DATA_CAPTURE_MODE_CONTINUOUS ,
  DATA_CAPTURE_MODE_BURST
}
 AD4134 list of data capture modes. More...
 
enum  ad4134_interface_modes {
  INTERFACE_MODE_TDM ,
  INTERFACE_MODE_BIT_BANGING ,
  INTERFACE_MODE_MINIMAL_IO
}
 AD4134 list of interface modes. More...
 
enum  ad4134_asrc_modes {
  ASRC_MODE_CONTROLLER ,
  ASRC_MODE_TARGET
}
 AD4134 list of ASRC modes. More...
 

Functions

enum ad4134_data_capture_modes ad4134_get_data_capture_mode (void)
 Get the data capture mode.
 
enum ad4134_interface_modes ad4134_get_interface_mode ()
 Get the interface mode.
 
enum ad4134_asrc_modes ad4134_get_asrc_mode (void)
 Get the ASRC mode.
 
int32_t ad7134_data_capture_init (struct ad713x_dev *dev)
 Perform the data capture initialization.
 
int32_t ad7134_read_all_channels_bit_banging (uint16_t *chn_data, bool check_odr_state)
 Read ADC data over DOUT0 and DOUT1 pins using bit-banging method for all channels.
 
int32_t ad7134_perform_conv_and_read_sample (uint16_t *adc_data, uint8_t ch)
 Read ADC single sample data.
 

Detailed Description

Header for AD4134 IIO application.

Copyright (c) 2020, 2023, 2025 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

◆ AD7134_CONV_TIMEOUT

#define AD7134_CONV_TIMEOUT   10000

◆ AD713X_DATA_PACKET_CONFIG_DCLK_FREQ_MODE_RD

#define AD713X_DATA_PACKET_CONFIG_DCLK_FREQ_MODE_RD (   x)    (((x) >> 0) & 0xF)

◆ AD713X_DATA_PACKET_CONFIG_FRAME_RD

#define AD713X_DATA_PACKET_CONFIG_FRAME_RD (   x)    (((x) >> 4) & 0x7)

◆ AD713X_DEV_CONFIG_PWR_MODE_RD

#define AD713X_DEV_CONFIG_PWR_MODE_RD (   x)    (((x) >> 1) & 0x1)

◆ AD713X_DIG_INT_CONFIG_FORMAT_MODE_RD

#define AD713X_DIG_INT_CONFIG_FORMAT_MODE_RD (   x)    (((x) >> 0) & 0x3)

◆ AD713X_DIGFILTER_SEL_CH_MODE_RD

#define AD713X_DIGFILTER_SEL_CH_MODE_RD (   x,
  ch 
)    (((x) >> (2 * ch)) & 0x3)

Enumeration Type Documentation

◆ ad4134_asrc_modes

AD4134 list of ASRC modes.

Enumerator
ASRC_MODE_CONTROLLER 
ASRC_MODE_TARGET 

◆ ad4134_data_capture_modes

AD4134 list of data capture modes.

Enumerator
DATA_CAPTURE_MODE_CONTINUOUS 
DATA_CAPTURE_MODE_BURST 

◆ ad4134_interface_modes

AD4134 list of interface modes.

Enumerator
INTERFACE_MODE_TDM 
INTERFACE_MODE_BIT_BANGING 
INTERFACE_MODE_MINIMAL_IO 

Function Documentation

◆ ad4134_get_asrc_mode()

enum ad4134_asrc_modes ad4134_get_asrc_mode ( void  )
inline

Get the ASRC mode.

Returns
ASRC mode
Here is the caller graph for this function:

◆ ad4134_get_data_capture_mode()

enum ad4134_data_capture_modes ad4134_get_data_capture_mode ( void  )
inline

Get the data capture mode.

Returns
Data capture mode
Here is the caller graph for this function:

◆ ad4134_get_interface_mode()

enum ad4134_interface_modes ad4134_get_interface_mode ( void  )
inline

Get the interface mode.

Returns
Interface mode
Here is the caller graph for this function:

◆ ad7134_data_capture_init()

int32_t ad7134_data_capture_init ( struct ad713x_dev *  dev)

Perform the data capture initialization.

Parameters
dev[in]- AD7134 Device descriptor.
Returns
0 in case of success, negative error code otherwise

This function configures the AD7134 registers to capture the data

Here is the caller graph for this function:

◆ ad7134_perform_conv_and_read_sample()

int32_t ad7134_perform_conv_and_read_sample ( uint16_t *  adc_data,
uint8_t  ch 
)

Read ADC single sample data.

Parameters
adc_data[in,out]- Pointer to adc data read variable
ch[in]- Channel for which data is to read
Returns
0 in case of success, negative error code otherwise

◆ ad7134_read_all_channels_bit_banging()

int32_t ad7134_read_all_channels_bit_banging ( uint16_t *  chn_data,
bool  check_odr_state 
)

Read ADC data over DOUT0 and DOUT1 pins using bit-banging method for all channels.

Parameters
chn_data[in,out]- Pointer to array for adc data for all channels
check_odr_state[in]- Whether to check for ODR state change
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function: