Loading...
Searching...
No Matches
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
9#pragma once
10
18
19#include "board.h"
20#include "ccs811.h"
21#include "saul_reg.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
31#ifndef CCS811_PARAM_I2C_DEV
32#define CCS811_PARAM_I2C_DEV (I2C_DEV(0))
33#endif
34#ifndef CCS811_PARAM_I2C_ADDR
35#define CCS811_PARAM_I2C_ADDR (CCS811_I2C_ADDRESS_1)
36#endif
37#ifndef CCS811_PARAM_MODE
38#define CCS811_PARAM_MODE (CCS811_MODE_1S)
39#endif
40#ifndef CCS811_PARAM_RESET_PIN
41#define CCS811_PARAM_RESET_PIN (GPIO_UNDEF)
42#endif
43#ifndef CCS811_PARAM_WAKE_PIN
44#define CCS811_PARAM_WAKE_PIN (GPIO_UNDEF)
45#endif
46#ifndef CCS811_PARAM_INT_PIN
47#define CCS811_PARAM_INT_PIN (GPIO_PIN(0, 0))
48#endif
49#ifndef CCS811_PARAM_INT_MODE
50#define CCS811_PARAM_INT_MODE (CCS811_INT_NONE)
51#endif
52
53#ifndef CCS811_PARAMS
54#ifdef MODULE_CCS811_FULL
55#define CCS811_PARAMS { .i2c_dev = CCS811_PARAM_I2C_DEV, \
56 .i2c_addr = CCS811_PARAM_I2C_ADDR, \
57 .mode = CCS811_PARAM_MODE, \
58 .int_pin = CCS811_PARAM_INT_PIN, \
59 .int_mode = CCS811_PARAM_INT_MODE, \
60 .wake_pin = CCS811_PARAM_WAKE_PIN, \
61 .reset_pin = CCS811_PARAM_RESET_PIN \
62 }
63#else
64#define CCS811_PARAMS { .i2c_dev = CCS811_PARAM_I2C_DEV, \
65 .i2c_addr = CCS811_PARAM_I2C_ADDR, \
66 .mode = CCS811_PARAM_MODE, \
67 .wake_pin = CCS811_PARAM_WAKE_PIN, \
68 .reset_pin = CCS811_PARAM_RESET_PIN \
69 }
70#endif
71#endif
72#ifndef CCS811_SAUL_INFO
73#define CCS811_SAUL_INFO { .name = "ccs811" }
74#endif
76
81{
82 CCS811_PARAMS
83};
84
89{
90 CCS811_SAUL_INFO
91};
92
93#ifdef __cplusplus
94}
95#endif
96
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