precision-converters-firmware
Loading...
Searching...
No Matches
ad4134_support.h
Go to the documentation of this file.
1/***************************************************************************/
12#ifndef AD4134_SUPPORT_H_
13#define AD4134_SUPPORT_H_
14
15/******************************************************************************/
16/***************************** Include Files **********************************/
17/******************************************************************************/
18#include <stdbool.h>
19#include "ad713x.h"
20
21/******************************************************************************/
22/********************** Macros and Constants Definition ***********************/
23/******************************************************************************/
24/* Timeout count to avoid stuck into potential infinite loop while checking
25 * for new data into an acquisition buffer. The actual timeout factor is determined
26 * through 'sampling_frequency' attribute of IIO app, but this period here makes sure
27 * we are not stuck into a forever loop in case data capture is interrupted
28 * or failed in between. */
29#define AD7134_CONV_TIMEOUT 10000
30
31/*
32 * AD713X_REG_DEVICE_CONFIG Readback defines
33 */
34#define AD713X_DEV_CONFIG_PWR_MODE_RD(x) (((x) >> 1) & 0x1)
35
36/*
37 * AD713X_REG_DATA_PACKET_CONFIG Readback defines
38 */
39#define AD713X_DATA_PACKET_CONFIG_FRAME_RD(x) (((x) >> 4) & 0x7)
40#define AD713X_DATA_PACKET_CONFIG_DCLK_FREQ_MODE_RD(x) (((x) >> 0) & 0xF)
41
42/*
43 * AD713X_REG_DIGITAL_INTERFACE_CONFIG Readback defines
44 */
45#define AD713X_DIG_INT_CONFIG_FORMAT_MODE_RD(x) (((x) >> 0) & 0x3)
46
47/*
48 * AD713X_REG_CHAN_DIG_FILTER_SEL Readback defines
49 */
50#define AD713X_DIGFILTER_SEL_CH_MODE_RD(x, ch) (((x) >> (2 * ch)) & 0x3)
51
52/******************************************************************************/
53/********************** Variables and User Defined Data Types *****************/
54/******************************************************************************/
63
73
82
83/******************************************************************************/
84/************************ Public Declarations *********************************/
85/******************************************************************************/
89
90int32_t ad7134_data_capture_init(struct ad713x_dev *dev);
91int32_t ad7134_read_all_channels_bit_banging(uint16_t *chn_data,
92 bool check_odr_state);
93int32_t ad7134_perform_conv_and_read_sample(uint16_t *adc_data, uint8_t ch);
94
95#endif /* AD4134_SUPPORT_H_ */
ad4134_asrc_modes
AD4134 list of ASRC modes.
Definition ad4134_support.h:78
@ ASRC_MODE_CONTROLLER
Definition ad4134_support.h:79
@ ASRC_MODE_TARGET
Definition ad4134_support.h:80
enum ad4134_asrc_modes ad4134_get_asrc_mode(void)
Get the ASRC mode.
Definition ad4134_support.c:132
int32_t ad7134_data_capture_init(struct ad713x_dev *dev)
Perform the data capture initialization.
Definition ad4134_support.c:143
ad4134_interface_modes
AD4134 list of interface modes.
Definition ad4134_support.h:68
@ INTERFACE_MODE_BIT_BANGING
Definition ad4134_support.h:70
@ INTERFACE_MODE_MINIMAL_IO
Definition ad4134_support.h:71
@ INTERFACE_MODE_TDM
Definition ad4134_support.h:69
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.
Definition ad4134_support.c:371
enum ad4134_interface_modes ad4134_get_interface_mode()
Get the interface mode.
Definition ad4134_support.c:114
enum ad4134_data_capture_modes ad4134_get_data_capture_mode(void)
Get the data capture mode.
Definition ad4134_support.c:123
ad4134_data_capture_modes
AD4134 list of data capture modes.
Definition ad4134_support.h:59
@ DATA_CAPTURE_MODE_BURST
Definition ad4134_support.h:61
@ DATA_CAPTURE_MODE_CONTINUOUS
Definition ad4134_support.h:60
int32_t ad7134_perform_conv_and_read_sample(uint16_t *adc_data, uint8_t ch)
Read ADC single sample data.
Definition ad4134_support.c:504
Definition ad77681.h:497