precision-converters-firmware
ad717x_console_app.h
Go to the documentation of this file.
1 
17 #ifndef AD717X_CONSOLE_APP_H_
18 #define AD717X_CONSOLE_APP_H_
19 
20 /******************************************************************************/
21 /***************************** Include Files **********************************/
22 /******************************************************************************/
23 
24 #include "adi_console_menu.h"
25 #include "app_config.h"
26 
27 /******************************************************************************/
28 /********************** Macros and Constants Definitions **********************/
29 /******************************************************************************/
30 
31 #define ADC_REF_VOLTAGE 2.5 // in volts
32 
33 #if defined(DEV_AD7177_2)
34 #define ADC_RESOLUTION 32 // in bits
35 #else
36 #define ADC_RESOLUTION 24 // in bits
37 #endif
38 
39 
40 // Define the number of channels for selected device
41 #if defined(DEV_AD4111) || defined(DEV_AD4112) || \
42  defined(DEV_AD4114) || defined(DEV_AD4115) || \
43  defined(DEV_AD7173_8) || defined(DEV_AD7175_8) ||\
44  defined(DEV_AD4116)
45 #define NUMBER_OF_CHANNELS 16U
46 #elif defined(DEV_AD7172_4)
47 #define NUMBER_OF_CHANNELS 8U
48 #else
49 #define NUMBER_OF_CHANNELS 4U
50 #endif
51 
52 
53 // Define the number of setups for selected device
54 #if defined(DEV_AD4111) || defined(DEV_AD4112) || \
55  defined(DEV_AD4114) || defined(DEV_AD4115) || \
56  defined(DEV_AD7173_8) || defined(DEV_AD7172_4) || \
57  defined(DEV_AD7175_8)|| defined(DEV_AD4116)
58 #define NUMBER_OF_SETUPS 8U
59 #else
60 #define NUMBER_OF_SETUPS 4U
61 #endif
62 
63 /******************************************************************************/
64 /********************** Variables and User Defined Data Types *****************/
65 /******************************************************************************/
66 
68 
69 /* AD717x Setup Configuration Structure */
70 typedef struct {
71  uint32_t setup; // Selected setup
72  uint32_t filter; // Filter type
73  uint32_t postfilter; // Post filter type for SINC5+1 Filter
74  uint32_t post_filter_enabled; // Post filter enable status
75  uint32_t odr_bits; // Output data rate register bits
76  uint32_t polarity; // Bipolar or Unipolar analog input
77  uint32_t reference; // Reference source for ADC
78  uint32_t input_buffers; // Buffers on analog inputs
79  uint32_t reference_buffers; // Buffers on reference source
80  uint32_t pos_analog_input; // Positive analog input
81  uint32_t neg_analog_input; // Negative analog input
82  uint32_t channel_enabled; // Channel Enable/Disable flag
83  uint32_t setup_assigned; // Setup assigned to a channel
85 
86 /******************************************************************************/
87 /************************ Public Declarations *********************************/
88 /******************************************************************************/
89 
90 int32_t ad717x_app_initialize(void);
91 
92 #endif /* AD717X_CONSOLE_APP_H_ */
console_menu ad717x_main_menu
Definition: ad717x_menu_defines.h:1204
int32_t ad717x_app_initialize(void)
Initialize the AD717x device and associated low level peripherals.
Definition: ad717x_console_app.c:135
: A simple console menu manager handler
Configuration file of nanodac firmware example program.
Definition: ad717x_console_app.h:70
uint32_t reference
Definition: ad717x_console_app.h:77
uint32_t postfilter
Definition: ad717x_console_app.h:73
uint32_t pos_analog_input
Definition: ad717x_console_app.h:80
uint32_t post_filter_enabled
Definition: ad717x_console_app.h:74
uint32_t input_buffers
Definition: ad717x_console_app.h:78
uint32_t filter
Definition: ad717x_console_app.h:72
uint32_t odr_bits
Definition: ad717x_console_app.h:75
uint32_t setup
Definition: ad717x_console_app.h:71
uint32_t reference_buffers
Definition: ad717x_console_app.h:79
uint32_t setup_assigned
Definition: ad717x_console_app.h:83
uint32_t neg_analog_input
Definition: ad717x_console_app.h:81
uint32_t polarity
Definition: ad717x_console_app.h:76
uint32_t channel_enabled
Definition: ad717x_console_app.h:82
Definition: adi_console_menu.h:89