summaryrefslogtreecommitdiff
path: root/include/driver/ds2482.h
blob: 80a9e1db001cefc0ee53a487dd92d73043b4d791 (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
/*
 * Copyright 2021 Birte Kristina Friesel
 *
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * DS2482-100 Single-Channel 1-Wire Master
 */
#pragma once

class DS2482 {
	private:
		DS2482(const DS2482 &copy);
		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;