Contiki 3.x
config.h
1 /* MC1322x flash config system */
2 
3 #ifndef MC1322X_CONFIG_H
4 #define MC1322X_CONFIG_H
5 
6 #define MC1322X_CONFIG_PAGE 0x1E000 /* nvm page where conf will be stored */
7 #define MC1322X_CONFIG_VERSION 1
8 #define MC1322X_CONFIG_MAGIC 0x1322
9 
10 /* bitfield for various config flags */
11 struct FLAGS {
12  uint32_t demod:1; /* radio demodulation mode */
13  uint32_t autoack:1; /* radio autoack vs. promiscuous mode */
14  uint32_t nvmtype:4; /* stores the result of nvm_detect */
15  uint32_t : 26;
16 };
17 
18 typedef struct {
19  uint16_t magic; /* mc1322x magic number 0x1322 */
20  uint16_t version; /* mc1322x config version number */
21  uint64_t eui;
22  uint8_t channel; /* value to pass to set_channel */
23  uint8_t power; /* value to pass to set_power */
24  struct FLAGS flags;
25 } mc1322xConfig;
26 
27 extern mc1322xConfig mc1322x_config;
28 
29 void mc1322x_config_set_default(mc1322xConfig *c);
30 void mc1322x_config_save(mc1322xConfig *c);
31 void mc1322x_config_restore(mc1322xConfig *c);
32 int mc1322x_config_valid(mc1322xConfig *c);
33 void mc1322x_config_print(void);
34 
35 #endif