Loading...
Searching...
No Matches
ccs811_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Gunar Schorcht
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
15
16#include "board.h"
17#include "ccs811.h"
18#include "saul_reg.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
28#ifndef CCS811_PARAM_I2C_DEV
29#define CCS811_PARAM_I2C_DEV (I2C_DEV(0))
30#endif
31#ifndef CCS811_PARAM_I2C_ADDR
32#define CCS811_PARAM_I2C_ADDR (CCS811_I2C_ADDRESS_1)
33#endif
34#ifndef CCS811_PARAM_MODE
35#define CCS811_PARAM_MODE (CCS811_MODE_1S)
36#endif
37#ifndef CCS811_PARAM_RESET_PIN
38#define CCS811_PARAM_RESET_PIN (GPIO_UNDEF)
39#endif
40#ifndef CCS811_PARAM_WAKE_PIN
41#define CCS811_PARAM_WAKE_PIN (GPIO_UNDEF)
42#endif
43#ifndef CCS811_PARAM_INT_PIN
44#define CCS811_PARAM_INT_PIN (GPIO_PIN(0, 0))
45#endif
46#ifndef CCS811_PARAM_INT_MODE
47#define CCS811_PARAM_INT_MODE (CCS811_INT_NONE)
48#endif
49
50#ifndef CCS811_PARAMS
51#ifdef MODULE_CCS811_FULL
52#define CCS811_PARAMS { .i2c_dev = CCS811_PARAM_I2C_DEV, \
53 .i2c_addr = CCS811_PARAM_I2C_ADDR, \
54 .mode = CCS811_PARAM_MODE, \
55 .int_pin = CCS811_PARAM_INT_PIN, \
56 .int_mode = CCS811_PARAM_INT_MODE, \
57 .wake_pin = CCS811_PARAM_WAKE_PIN, \
58 .reset_pin = CCS811_PARAM_RESET_PIN \
59 }
60#else
61#define CCS811_PARAMS { .i2c_dev = CCS811_PARAM_I2C_DEV, \
62 .i2c_addr = CCS811_PARAM_I2C_ADDR, \
63 .mode = CCS811_PARAM_MODE, \
64 .wake_pin = CCS811_PARAM_WAKE_PIN, \
65 .reset_pin = CCS811_PARAM_RESET_PIN \
66 }
67#endif
68#endif
69#ifndef CCS811_SAUL_INFO
70#define CCS811_SAUL_INFO { .name = "ccs811" }
71#endif
73
78{
79 CCS811_PARAMS
80};
81
86{
87 CCS811_SAUL_INFO
88};
89
90#ifdef __cplusplus
91}
92#endif
93
Device Driver for AMS CCS811 digital gas sensor.
static const saul_reg_info_t ccs811_saul_info[]
Additional meta information to keep in the SAUL registry.
static const ccs811_params_t ccs811_params[]
CCS811 configuration.
SAUL registry interface definition.
CCS811 device initialization parameters.
Definition ccs811.h:92
Additional data to collect for each entry.
Definition saul_reg.h:48