xref: /netbsd-src/sys/dev/i2c/am2315reg.h (revision aa56d549ada3ad8ca41ef7a1d22e6213014ab725)
1 /*	$NetBSD: am2315reg.h,v 1.2 2017/12/29 02:20:47 christos Exp $	*/
2 
3 /*
4  * Copyright (c) 2017 Brad Spencer <brad@anduin.eldar.org>
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _DEV_I2C_AM2315REG_H_
20 #define _DEV_I2C_AM2315REG_H_
21 
22 #define AM2315_TYPICAL_ADDR	0x5c
23 
24 #define AM2315_READ_REGISTERS   0x03
25 #define AM2315_WRITE_REGISTERS  0x10
26 
27 #define AM2315_REGISTER_HIGH_RH 0x00
28 #define AM2315_REGISTER_LOW_RH 0x01
29 #define AM2315_REGISTER_HIGH_TEMP 0x02
30 #define AM2315_REGISTER_LOW_TEMP 0x03
31 #define AM2315_REGISTER_RETENTION_04 0x04
32 #define AM2315_REGISTER_RETENTION_05 0x05
33 #define AM2315_REGISTER_RETENTION_06 0x06
34 #define AM2315_REGISTER_RETENTION_07 0x07
35 #define AM2315_REGISTER_HIGH_MODEL 0x08
36 #define AM2315_REGISTER_LOW_MODEL 0x09
37 #define AM2315_REGISTER_VERSION 0x0a
38 #define AM2315_REGISTER_ID_PT_24_31 0x0b
39 #define AM2315_REGISTER_ID_PT_16_23 0x0c
40 #define AM2315_REGISTER_ID_PT_8_15 0x0d
41 #define AM2315_REGISTER_ID_PT_0_7 0x0e
42 #define AM2315_REGISTER_STATUS 0x0f
43 #define AM2315_REGISTER_HIGH_USER1 0x10
44 #define AM2315_REGISTER_LOW_USER1 0x11
45 #define AM2315_REGISTER_HIGH_USER2 0x12
46 #define AM2315_REGISTER_LOW_USER2 0x13
47 #define AM2315_REGISTER_RETENTION_14 0x14
48 #define AM2315_REGISTER_RETENTION_15 0x15
49 #define AM2315_REGISTER_RETENTION_16 0x16
50 #define AM2315_REGISTER_RETENTION_17 0x17
51 #define AM2315_REGISTER_RETENTION_18 0x18
52 #define AM2315_REGISTER_RETENTION_19 0x19
53 #define AM2315_REGISTER_RETENTION_1a 0x1a
54 #define AM2315_REGISTER_RETENTION_1b 0x1b
55 #define AM2315_REGISTER_RETENTION_1c 0x1c
56 #define AM2315_REGISTER_RETENTION_1d 0x1d
57 #define AM2315_REGISTER_RETENTION_1e 0x1e
58 #define AM2315_REGISTER_RETENTION_1f 0x1f
59 
60 #define AM2315_TEMP_NEGATIVE 0x80
61 
62 #endif
63