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 --- include/driver/ds2482.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/driver/ds2482.h (limited to 'include/driver') diff --git a/include/driver/ds2482.h b/include/driver/ds2482.h new file mode 100644 index 0000000..cb0b577 --- /dev/null +++ b/include/driver/ds2482.h @@ -0,0 +1,26 @@ +/* + * Copyright 2021 Daniel Friesel + * + * SPDX-License-Identifier: BSD-2-Clause + * + * DS2482-100 Single-Channel 1-Wire Master + */ +#pragma once + +class DS2482 { + private: + DS2482(const DS2482 ©); + unsigned char const address; + unsigned char txbuf[2]; + unsigned char rxbuf[1]; + + public: + DS2482(unsigned char const addr) : address(addr) {} + + void setup(); + void busReset(); + unsigned char status(); + void readROM(unsigned char *data, unsigned char len); +}; + +extern DS2482 ds2482; -- cgit v1.2.3