From 399c5385d5c449cc3cde314e7a4e42f7a242a4cb Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 17 Oct 2021 18:54:25 +0200 Subject: Add DS2482-100 Single-Channel 1-Wire Master driver --- src/app/datalogger/main.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/app/datalogger') diff --git a/src/app/datalogger/main.cc b/src/app/datalogger/main.cc index 2444c14..f9484b5 100644 --- a/src/app/datalogger/main.cc +++ b/src/app/datalogger/main.cc @@ -33,6 +33,9 @@ #ifdef CONFIG_driver_ccs811 #include "driver/ccs811.h" #endif +#ifdef CONFIG_driver_ds2482 +#include "driver/ds2482.h" +#endif #ifdef CONFIG_driver_max44009 #include "driver/max44009.h" #endif @@ -103,6 +106,20 @@ void loop(void) kout << "CCS811 tVOC / eCO₂ : " << ccs811.tvoc << " ppb / " << ccs811.eco2 << " ppm" << endl; #endif +#ifdef CONFIG_driver_ds2482 + unsigned char addr[8]; + ds2482.readROM(addr, 8); + kout << hex << "DS2482 ROM address: "; + for (unsigned char i = 0; i < 8; i++) { + kout << (unsigned int)addr[i]; + } + kout << " / "; + for (signed char i = 7; i >= 0; i--) { + kout << (unsigned int)addr[i]; + } + kout << endl; +#endif + #ifdef CONFIG_driver_hdc1080 /* hdc1080.heater(1); @@ -223,6 +240,10 @@ int main(void) arch.delay_ms(50); #endif +#ifdef CONFIG_driver_ds2482 + ds2482.setup(); +#endif + #ifdef CONFIG_driver_hdc1080 hdc1080.init(); if (hdc1080.getManufacturerID() != 0x5449) { -- cgit v1.2.3