ccs811_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
17 #ifndef CCS811_PARAMS_H
18 #define CCS811_PARAMS_H
19 
20 #include "board.h"
21 #include "ccs811.h"
22 #include "saul_reg.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #ifndef CCS811_PARAM_I2C_DEV
33 #define CCS811_PARAM_I2C_DEV (I2C_DEV(0))
34 #endif
35 #ifndef CCS811_PARAM_I2C_ADDR
36 #define CCS811_PARAM_I2C_ADDR (CCS811_I2C_ADDRESS_1)
37 #endif
38 #ifndef CCS811_PARAM_MODE
39 #define CCS811_PARAM_MODE (CCS811_MODE_1S)
40 #endif
41 #ifndef CCS811_PARAM_RESET_PIN
42 #define CCS811_PARAM_RESET_PIN (GPIO_UNDEF)
43 #endif
44 #ifndef CCS811_PARAM_WAKE_PIN
45 #define CCS811_PARAM_WAKE_PIN (GPIO_UNDEF)
46 #endif
47 #ifndef CCS811_PARAM_INT_PIN
48 #define CCS811_PARAM_INT_PIN (GPIO_PIN(0, 0))
49 #endif
50 #ifndef CCS811_PARAM_INT_MODE
51 #define CCS811_PARAM_INT_MODE (CCS811_INT_NONE)
52 #endif
53 
54 #ifndef CCS811_PARAMS
55 #ifdef MODULE_CCS811_FULL
56 #define CCS811_PARAMS { .i2c_dev = CCS811_PARAM_I2C_DEV, \
57  .i2c_addr = CCS811_PARAM_I2C_ADDR, \
58  .mode = CCS811_PARAM_MODE, \
59  .int_mode = CCS811_PARAM_INT_MODE, \
60  .int_pin = CCS811_PARAM_INT_PIN, \
61  .wake_pin = CCS811_PARAM_WAKE_PIN, \
62  .reset_pin = CCS811_PARAM_RESET_PIN \
63  }
64 #else
65 #define CCS811_PARAMS { .i2c_dev = CCS811_PARAM_I2C_DEV, \
66  .i2c_addr = CCS811_PARAM_I2C_ADDR, \
67  .mode = CCS811_PARAM_MODE, \
68  .wake_pin = CCS811_PARAM_WAKE_PIN, \
69  .reset_pin = CCS811_PARAM_RESET_PIN \
70  }
71 #endif
72 #endif
73 #ifndef CCS811_SAUL_INFO
74 #define CCS811_SAUL_INFO { .name = "ccs811" }
75 #endif
76 
82 {
83  CCS811_PARAMS
84 };
85 
90 {
91  CCS811_SAUL_INFO
92 };
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* CCS811_PARAMS_H */
99 
ccs811_params
static const ccs811_params_t ccs811_params[]
CCS811 configuration.
Definition: ccs811_params.h:81
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
saul_reg.h
SAUL registry interface definition.
ccs811_saul_info
static const saul_reg_info_t ccs811_saul_info[]
Additional meta information to keep in the SAUL registry.
Definition: ccs811_params.h:89
ccs811.h
Device Driver for AMS CCS811 digital gas sensor.
ccs811_params_t
CCS811 device initialization parameters.
Definition: ccs811.h:93