summaryrefslogtreecommitdiff
path: root/include/driver/lm75.h
blob: 2d1f0cb3abde02f061491de2036f089d3c1c3ce9 (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
/*
 * Copyright 2020 Birte Kristina Friesel
 *
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Driver for LM75B Digital Temperature Sensor and Thermal Watchdog.
 */
#ifndef LM75_H
#define LM75_H

class LM75 {
	private:
		LM75(const LM75 &copy);
		unsigned char const address;
		unsigned char txbuf[3];
		unsigned char rxbuf[2];

	public:
		LM75(unsigned char const addr) : address(addr) {}

		float getTemp();
		unsigned int getOS();
		unsigned int getHyst();
		void setOS(signed char os);
		void setHyst(signed char hyst);
		void init();
		void shutdown();
};

extern LM75 lm75;

#endif