AEM
config.h
Go to the documentation of this file.
1 #ifndef CONFIG_H
2 #define CONFIG_H
3 
4 #include "I2C.h"
5 
6 /*************************************************************/
8 /*************************************************************/
9 typedef uint32_t timeStamp_t;
10 typedef float ADC_value_t;
11 typedef uint8_t ADCCID_t;
12 typedef uint32_t boardID;
17  uint8_t u8; //<! this value encodes the ADC id and the Channel id on a byte, high 4 bits are ADC id, low 4 bits are channel id
18  uint32_t u32; //<! this is the timestamp value
19  float f; //<!this is the sensor value
20 
21  /* operators used in comparisons for this struct type
22  */
23  boolean operator==(const u8u32f_struct& r) const {
24  return (u8 == r.u8) &&
25  (u32 == r.u32) &&
26  (f == r.f);
27  }
28  /* operators used in comparisons for this struct type
29  */boolean operator!=(const u8u32f_struct& r) const {
30  return !(*this == r);
31  }
32 } __attribute__((__packed__)); //<! packing ensures that onlyt the 9 bytes needed by the struct are used in memory
33 
34 
35 /*************************************************************/
37 /*************************************************************/
38 
39 #define BOARD_USE_BOARD_0 (0) /*<! slecect which board will be configured, a true value uses board ZERO otherwise BOARD_1 */
40 
41 
42 #define BOARD_BOARD_0_ID (0)
43 #define BOARD_BOARD_0_NB_ADCS (1)
44 #define BOARD_BOARD_0_ADC_0_NB_CHANNELS (8)
46 #define BOARD_BOARD_1_ID (1)
47 #define BOARD_BOARD_1_NB_ADCS (5)
49 // the following lines determine the number of channels querried per adc (or assimilated device)
50 // channels are queried from channel 0,
51 // there is currently no way to querry a cherry picked subset of the channels,
52 // if that is needed, then it will require more work
53 #define BOARD_BOARD_1_ADC_0_NB_CHANNELS (0)
54 #define BOARD_BOARD_1_ADC_1_NB_CHANNELS (0)
55 #define BOARD_BOARD_1_ADC_2_NB_CHANNELS (0)
56 #define BOARD_BOARD_1_ADC_3_NB_CHANNELS (0)
57 #define BOARD_BOARD_1_ADC_4_NB_CHANNELS (3)
60 /*************************************************************/
61 
62 /*************************************************************/
63 #define ADCMGR_SS_PIN (10) //<! pin for ADC slave select
64 
65 /*************************************************************/
67 /*************************************************************/
68 
69 #define SlaveApp_LED_PIN_1 (35) //<! AEM board heartbeat led pin 1
70 #define SlaveApp_LED_PIN_2 (36) //<! AEM board heartbeat led pin 2
71 #define SlaveApp_HB_TIME (500) //<! AEM board led heartbeat flash time in millisecs
72 
73 #define SlaveApp_SAY_HEARTBEAT_ONLY (true) //<! debugging define controls how data the slave prints to serial monitor, leave at TRUE for minimal output
74 #define SlaveApp_HB_SHOW_COUNT (300) //<! the number of data loop iterations before the slave outputs to serial monitor.
75 
76 #endif
77 
78 
struct u8u32f_struct __attribute__((__packed__))
uint32_t timeStamp_t
Definition: config.h:9
float f
Definition: config.h:19
uint8_t ADCCID_t
Definition: config.h:11
boolean operator!=(const u8u32f_struct &r) const
Definition: config.h:29
uint32_t u32
Definition: config.h:18
uint8_t u8
Definition: config.h:17
uint32_t boardID
Definition: config.h:12
boolean operator==(const u8u32f_struct &r) const
Definition: config.h:23
float ADC_value_t
Definition: config.h:10
Definition: config.h:16