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