blob: bd5399919ec09f5e21ba4e639c5874d94ab11042 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/*
* Copyright 2020 Daniel Friesel
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.h"
#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C)
#include "driver/i2c.h"
#else
#include "driver/soft_i2c.h"
#endif
#include "driver/ccs811.h"
void loop(void)
{
kout << "CCS811 status is " << ccs811.check() << endl;
}
int main(void)
{
arch.setup();
gpio.setup();
kout.setup();
if (i2c.setup() != 0) {
return 1;
}
kout << "I2C setup OK" << endl;
ccs811.init();
arch.idle_loop();
return 0;
}
|