diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-10-17 18:54:25 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-10-17 18:54:25 +0200 |
commit | 399c5385d5c449cc3cde314e7a4e42f7a242a4cb (patch) | |
tree | b950081831a6db6c05f2b5accb4db785e4c0b0d2 /src/app | |
parent | 9fd36d9cc10fbefa578bf8b1b2c308bf775af4f9 (diff) |
Add DS2482-100 Single-Channel 1-Wire Master driver
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/datalogger/main.cc | 21 |
1 files changed, 21 insertions, 0 deletions
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) { |