#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <asm/delay.h>
#include "../w1.h"
#include "../w1_int.h"
Go to the source code of this file.
#define DS2482_CMD_1WIRE_READ_BYTE 0x96 /* Param: None */ |
#define DS2482_CMD_1WIRE_RESET 0xB4 /* Param: None */ |
#define DS2482_CMD_1WIRE_SINGLE_BIT 0x87 /* Param: Bit byte (bit7) */ |
#define DS2482_CMD_1WIRE_TRIPLET 0x78 /* Param: Dir byte (bit7) */ |
#define DS2482_CMD_1WIRE_WRITE_BYTE 0xA5 /* Param: Data byte */ |
#define DS2482_CMD_CHANNEL_SELECT 0xC3 /* Param: Channel byte - DS2482-800 only */ |
#define DS2482_CMD_RESET 0xF0 /* No param */ |
ds2482.c - provides i2c to w1-master bridge(s) Copyright (C) 2005 Ben Gardner bgard.nosp@m.ner@.nosp@m.wabte.nosp@m.c.co.nosp@m.m
The DS2482 is a sensor chip made by Dallas Semiconductor (Maxim). It is a I2C to 1-wire bridge. There are two variations: -100 and -800, which have 1 or 8 1-wire ports. The complete datasheet can be obtained from MAXIM's website at: http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4382
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. The DS2482 registers - there are 3 registers that are addressed by a read pointer. The read pointer is set by the last command executed.
To read the data, issue a register read for any address
Definition at line 32 of file ds2482.c.
#define DS2482_CMD_SET_READ_PTR 0xE1 /* Param: DS2482_PTR_CODE_xxx */ |
#define DS2482_CMD_WRITE_CONFIG 0xD2 /* Param: Config byte */ |
#define DS2482_PTR_CODE_CHANNEL 0xD2 /* DS2482-800 only */ |
#define DS2482_PTR_CODE_CONFIG 0xC3 |
#define DS2482_PTR_CODE_DATA 0xE1 |
#define DS2482_PTR_CODE_STATUS 0xF0 |
#define DS2482_REG_CFG_1WS 0x08 |
Configure Register bit definitions The top 4 bits always read 0. To write, the top nibble must be the 1's compl. of the low nibble.
Definition at line 54 of file ds2482.c.
#define DS2482_REG_CFG_APU 0x01 |
#define DS2482_REG_CFG_PPM 0x02 |
#define DS2482_REG_CFG_SPU 0x04 |
#define DS2482_REG_STS_1WB 0x01 |
#define DS2482_REG_STS_DIR 0x80 |
Status Register bit definitions (read only)
Definition at line 74 of file ds2482.c.
#define DS2482_REG_STS_LL 0x08 |
#define DS2482_REG_STS_PPD 0x02 |
#define DS2482_REG_STS_RST 0x10 |
#define DS2482_REG_STS_SBR 0x20 |
#define DS2482_REG_STS_SD 0x04 |
#define DS2482_REG_STS_TSB 0x40 |
#define DS2482_WAIT_IDLE_TIMEOUT 100 |
MODULE_DESCRIPTION |
( |
"DS2482 driver" |
| ) |
|
module_exit |
( |
sensors_ds2482_exit |
| ) |
|
module_init |
( |
sensors_ds2482_init |
| ) |
|