Chirp SonicLib  4.5.2
chirp_board_config.h
1 /*
2  * chirp_board_config.h
3  *
4  * This file defines default values for the required symbols used to build an
5  * application with the Chirp SonicLib API and driver. These symbols are used
6  * for static array allocations and counters in SonicLib (and often
7  * applications), and are based on the number of specific resources on the
8  * target board.
9  *
10  * For this file to be included, you must define the symbol
11  * INVN_SONICLIB_INTERNAL_BOARD_CONFIG in your build system, for example, using
12  * the gcc -D option. Otherwise, soniclib will look for this header relative
13  * to your include path. That is, if you do not define the above symbol, you
14  * MUST have chirp_board_config.h directly on your include path.
15  *
16  * In the latter case, you can start with a copy of this file placed somewhere
17  * in your include path, then modify it to your liking.
18  *
19  * Three symbols are conditionally defined:
20  * INCLUDE_WHITNEY_SUPPORT - includes support for CHx01 parts
21  * CHIRP_MAX_NUM_SENSORS - the number of possible sensor devices (i.e. the
22  * number of sensor ports)
23  * CHIRP_NUM_BUSES - the number of I2C/SPI buses on the board that are used
24  * for those sensor ports
25  *
26  * Two additional symbols are conditionally defined for shasta only:
27  * CHIRP_SENSOR_INT_PIN - Pin used for interrupts. 1=INT1, 2=INT2
28  * CHIPR_SENSOR_TRIG_PIN - Pin used for triggering. 1=INT1, 2=INT2
29  *
30  * If you wish to override these values, then you must compile with different
31  * symbol definitions (-D option with gcc).
32  *
33  * For example, to build with 2 max sensors, 1 bus, and with shasta
34  * (ICU-x0201) support, use:
35  *
36  * -DCHIRP_MAX_NUM_SENSORS=2 -DCHIRP_NUM_BUSES=1 -DINCLUDE_SHASTA_SUPPORT
37  */
38 
39 #ifndef CHIRP_BOARD_CONFIG_H_
40 #define CHIRP_BOARD_CONFIG_H_
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 #if !defined(INCLUDE_SHASTA_SUPPORT) && !defined(INCLUDE_WHITNEY_SUPPORT)
47 #define INCLUDE_WHITNEY_SUPPORT
48 #endif
49 
50 /* Settings for the Chirp driver test setup */
51 #ifndef CHIRP_MAX_NUM_SENSORS
52 #define CHIRP_MAX_NUM_SENSORS 4 // maximum possible number of sensor devices
53 #endif
54 
55 #ifndef CHIRP_NUM_BUSES
56 #define CHIRP_NUM_BUSES 2 // number of I2C/SPI buses used by sensors
57 #endif
58 
59 #ifndef CHIRP_RTC_CAL_PULSE_MS
60 #define CHIRP_RTC_CAL_PULSE_MS 100 /* Default length of RTC calibration pulse */
61 #endif
62 
63 #ifdef INCLUDE_SHASTA_SUPPORT
64 #ifndef CHIRP_SENSOR_INT_PIN
65 #define CHIRP_SENSOR_INT_PIN 1
66 #endif
67 #ifndef CHIRP_SENSOR_TRIG_PIN
68 #define CHIRP_SENSOR_TRIG_PIN 1
69 #endif
70 #endif // INCLUDE_SHASTA_SUPPORT
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* CHIRP_BOARD_CONFIG_H_ */