precision-converters-firmware
ad777x_support.h
Go to the documentation of this file.
1 /***************************************************************************//*
2  * @file ad777x_support.h
3  * @brief AD777x No-OS driver support header file
4 ******************************************************************************
5  * Copyright (c) 2022 Analog Devices, Inc. All Rights Reserved.
6  *
7  * This software is proprietary to Analog Devices, Inc. and its licensors.
8  * By using this software you agree to the terms of the associated
9  * Analog Devices Software License Agreement.
10 ******************************************************************************/
11 #ifndef AD777x_SUPPORT_H_
12 #define AD777x_SUPPORT_H_
13 
14 /******************************************************************************/
15 /***************************** Include Files **********************************/
16 /******************************************************************************/
17 
18 #include <stdbool.h>
19 #include <stdint.h>
20 #include "ad7779.h"
21 
22 /******************************************************************************/
23 /********************* Macros and Constants Definitions ***********************/
24 /******************************************************************************/
25 
26 /* Timeout count to avoid stuck into potential infinite loop while checking
27  * for new data into an acquisition buffer. The actual timeout factor is determined
28  * through 'sampling_frequency' attribute of IIO app, but this period here makes sure
29  * we are not stuck into a forever loop in case data capture is interrupted
30  * or failed in between.
31  * Note: This timeout factor is dependent upon the MCU clock frequency. Below timeout
32  * is tested for SDP-K1 platform @180Mhz default core clock */
33 #define AD777x_CONV_TIMEOUT 10000
34 
35 /******************************************************************************/
36 /********************** Public/Extern Declarations ****************************/
37 /******************************************************************************/
38 extern int32_t ad777x_raw_data_read(ad7779_dev *dev, uint8_t ch_num,
39  uint32_t *sd_adc_code);
40 
41 extern int32_t ad777x_read_all_channels(ad7779_dev *dev, uint32_t *sd_adc_code);
42 
43 extern int32_t ad777x_enable_single_dout(ad7779_dev *dev);
44 
45 int32_t ad7779_sar_data_read(ad7779_dev *dev, ad7779_sar_mux mux,
46  uint16_t *sar_code);
47 
48 #endif /* end of AD777x_SUPPORT_H_ */
int32_t ad777x_enable_single_dout(ad7779_dev *dev)
Enable single DOUT for all 8 channels.
Definition: ad777x_support.c:168
int32_t ad777x_read_all_channels(ad7779_dev *dev, uint32_t *sd_adc_code)
Read the SD ADC Code of all channels.
Definition: ad777x_support.c:133
int32_t ad7779_sar_data_read(ad7779_dev *dev, ad7779_sar_mux mux, uint16_t *sar_code)
Read SAR ADC data.
Definition: ad777x_support.c:189
int32_t ad777x_raw_data_read(ad7779_dev *dev, uint8_t ch_num, uint32_t *sd_adc_code)
Read the SD ADC Code.
Definition: ad777x_support.c:56