precision-converters-firmware
ad4130_user_config.h
Go to the documentation of this file.
1 /*************************************************************************/
13 #ifndef _AD4130_USER_CONFIG_H_
14 #define _AD4130_USER_CONFIG_H_
15 
16 /******************************************************************************/
17 /***************************** Include Files **********************************/
18 /******************************************************************************/
19 
20 #include <stdint.h>
21 #include "ad413x.h"
22 
23 /******************************************************************************/
24 /********************** Macros and Constants Definition ***********************/
25 /******************************************************************************/
26 
27 /* Select channel config for default user config (applicable to all channels) */
28 //#define DIFFERENTIAL_CHN_CFG // Uncomment to select differential config
29 
30 /* Select FS (or ODR) for default user config (applicable to all channels) */
31 #if (FS_CONFIG_VALUE != 0)
32 #define AD4130_FS_CONFIG FS_CONFIG_VALUE
33 #else
34 #define AD4130_FS_CONFIG 1 // ODR = 2.4KSPS (max)
35 #endif
36 
37 /* Filter type for default user config
38  * Note: Applicable for all setups to keep the same ODR for all channels */
39 #define AD4130_FILTER_TYPE AD413X_SYNC3_STANDALONE
40 
41 /* Scaler factor used in FS to ODR conversion (For SINC3/4 filter) */
42 #define FS_TO_ODR_CONV_SCALER (32U * AD4130_FS_CONFIG)
43 
44 /* Select the positive and negative analog inputs for each channel */
45 #if defined(DIFFERENTIAL_CHN_CFG)
46 #define CHN0_AINP AD413X_AIN0
47 #define CHN0_AINM AD413X_AIN1
48 #define CHN1_AINP AD413X_AIN2
49 #define CHN1_AINM AD413X_AIN3
50 #define CHN2_AINP AD413X_AIN4
51 #define CHN2_AINM AD413X_AIN5
52 #define CHN3_AINP AD413X_AIN6
53 #define CHN3_AINM AD413X_AIN7
54 #define CHN4_AINP AD413X_AIN8
55 #define CHN4_AINM AD413X_AIN9
56 #define CHN5_AINP AD413X_AIN10
57 #define CHN5_AINM AD413X_AIN11
58 #define CHN6_AINP AD413X_AIN12
59 #define CHN6_AINM AD413X_AIN13
60 #define CHN7_AINP AD413X_AIN14
61 #define CHN7_AINM AD413X_AIN15
62 #define ADC_USER_CHANNELS ADC_DIFFERENTIAL_CHNS
63 #else
64 #define CHN0_AINP AD413X_AIN0
65 #define CHN0_AINM AD413X_AVSS
66 #define CHN1_AINP AD413X_AIN1
67 #define CHN1_AINM AD413X_AVSS
68 #define CHN2_AINP AD413X_AIN2
69 #define CHN2_AINM AD413X_AVSS
70 #define CHN3_AINP AD413X_AIN3
71 #define CHN3_AINM AD413X_AVSS
72 #define CHN4_AINP AD413X_AIN4
73 #define CHN4_AINM AD413X_AVSS
74 #define CHN5_AINP AD413X_AIN5
75 #define CHN5_AINM AD413X_AVSS
76 #define CHN6_AINP AD413X_AIN6
77 #define CHN6_AINM AD413X_AVSS
78 #define CHN7_AINP AD413X_AIN7
79 #define CHN7_AINM AD413X_AVSS
80 #define CHN8_AINP AD413X_AIN8
81 #define CHN8_AINM AD413X_AVSS
82 #define CHN9_AINP AD413X_AIN9
83 #define CHN9_AINM AD413X_AVSS
84 #define CHN10_AINP AD413X_AIN10
85 #define CHN10_AINM AD413X_AVSS
86 #define CHN11_AINP AD413X_AIN11
87 #define CHN11_AINM AD413X_AVSS
88 #define CHN12_AINP AD413X_AIN12
89 #define CHN12_AINM AD413X_AVSS
90 #define CHN13_AINP AD413X_AIN13
91 #define CHN13_AINM AD413X_AVSS
92 #define CHN14_AINP AD413X_AIN14
93 #define CHN14_AINM AD413X_AVSS
94 #define CHN15_AINP AD413X_AIN15
95 #define CHN15_AINM AD413X_AVSS
96 #define ADC_USER_CHANNELS ADC_PSEUDO_DIFF_CHNS
97 #endif
98 
99 /******************************************************************************/
100 /********************** Public/Extern Declarations ****************************/
101 /******************************************************************************/
102 
103 extern struct ad413x_init_param ad4130_user_config_params;
104 
105 #endif /* end of _AD4130_USER_CONFIG_H_ */
struct ad413x_init_param ad4130_user_config_params
Definition: ad4130_user_config.c:29