precision-converters-firmware
app_config.h
Go to the documentation of this file.
1 /*************************************************************************/
13 #ifndef _APP_CONFIG_H_
14 #define _APP_CONFIG_H_
15 
16 /******************************************************************************/
17 /***************************** Include Files **********************************/
18 /******************************************************************************/
19 #include <stdint.h>
20 #include <PinNames.h>
21 
22 /******************************************************************************/
23 /********************** Macros and Constants Definitions **********************/
24 /******************************************************************************/
25 
26 // **** Note for User: ACTIVE_DEVICE selection ****//
27 /* Define the device type here from the list of below device type defines
28  * (one at a time. Defining more than one device can result into compile error).
29  * e.g. #define DEV_AD4111 -> This will make AD4111 as an ACTIVE_DEVICE.
30  * The ACTIVE_DEVICE is default set to AD4111, if device type is not defined.
31  * */
32 //#define DEV_AD4111
33 
34 /* NOTE: Only EVAL-AD4114SDZ, EVAL-AD4115SDZ and EVAL-AD4116ASDZ support Arduino and SDP_120
35  * interface. The other EVAL Boards (EVAL-AD4111SDZ, EVAL-AD4112SDZ,
36  * EVAL-AD7172-4SDZ, EVAL-AD7172-2SDZ , EVAL-AD7173-8SDZ, EVAL-AD7175-2SDZ,
37  * EVAL-AD7175-8SDZ, EVAL-AD7176-2SDZ, EVAL-AD7177-2SDZ) support only the
38  * SDP-120 interface.
39  */
40 
41 /* NOTE: Uncomment the SDP_120 #define below to enable the SDP-120 connector */
42 
43 // #define SDP_120
44 
45 #ifdef SDP_120
46 /* SPI Pins on SDP-K1 SDP-120 Interface */
47 #define I2C_SCL SDP_I2C_SCL // PH_7
48 #define I2C_SDA SDP_I2C_SDA // PC_9
49 
50 #define SPI_CSB SDP_SPI_CS_A // PB_9
51 #define SPI_HOST_SDI SDP_SPI_MISO // PF_8
52 #define SPI_HOST_SDO SDP_SPI_MOSI // PF_9
53 #define SPI_SCK SDP_SPI_SCK // PH_6
54 #else
55 /* SPI Pins on SDP-K1-Arduino Interface */
56 #define SPI_CSB ARDUINO_UNO_D10 // SPI_CS
57 #define SPI_HOST_SDO ARDUINO_UNO_D11 // SPI_MOSI
58 #define SPI_HOST_SDI ARDUINO_UNO_D12 // SPI_MISO
59 #define SPI_SCK ARDUINO_UNO_D13 // SPI_SCK
60 #define I2C_SCL ARDUINO_UNO_D15
61 #define I2C_SDA ARDUINO_UNO_D14
62 #endif
63 
64 // Common pin mappings
65 #define LED_GREEN LED3
66 
67 
68 #if defined(DEV_AD4111)
69 #define ACTIVE_DEVICE_NAME "AD4111"
70 #elif defined(DEV_AD4112)
71 #define ACTIVE_DEVICE_NAME "AD4112"
72 #elif defined(DEV_AD4114)
73 #define ACTIVE_DEVICE_NAME "AD4114"
74 #elif defined(DEV_AD4115)
75 #define ACTIVE_DEVICE_NAME "AD4115"
76 #elif defined(DEV_AD4116)
77 #define ACTIVE_DEVICE_NAME "AD4116"
78 #elif defined(DEV_AD7172_2)
79 #define AD7172_2_INIT
80 #define ACTIVE_DEVICE_NAME "AD7172-2"
81 #elif defined(DEV_AD7172_4)
82 #define AD7172_4_INIT
83 #define ACTIVE_DEVICE_NAME "AD7172-4"
84 #elif defined(DEV_AD7173_8)
85 #define AD7173_8_INIT
86 #define ACTIVE_DEVICE_NAME "AD7173-8"
87 #elif defined(DEV_AD7175_2)
88 #define AD7175_2_INIT
89 #define ACTIVE_DEVICE_NAME "AD7175-2"
90 #elif defined(DEV_AD7175_8)
91 #define AD7175_8_INIT
92 #define ACTIVE_DEVICE_NAME "AD7175-8"
93 #elif defined(DEV_AD7176_2)
94 #define AD7176_2_INIT
95 #define ACTIVE_DEVICE_NAME "AD7176-2"
96 #elif defined(DEV_AD7177_2)
97 #define AD7177_2_INIT
98 #define ACTIVE_DEVICE_NAME "AD7177-2"
99 #else
100 #warning No/Unsupported ADxxxxy symbol defined. AD4111 defined
101 #define DEV_AD4111
102 #define ACTIVE_DEVICE_NAME "AD4111"
103 #endif
104 
105 /* Denominator of the scale factor to be applied while converting raw values to actual voltage */
106 #if defined(DEV_AD4111) || defined(DEV_AD4112) || \
107  defined(DEV_AD4114) || defined(DEV_AD4115) || defined (DEV_AD4116)
108 #define SCALE_FACTOR_DR 0.1
109 #else
110 #define SCALE_FACTOR_DR 1
111 #endif
112 
113 #endif //_APP_CONFIG_H_