Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ds2482.c File Reference
#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.

Data Structures

struct  ds2482_w1_chan
 
struct  ds2482_data
 

Macros

#define DS2482_CMD_RESET   0xF0 /* No param */
 
#define DS2482_CMD_SET_READ_PTR   0xE1 /* Param: DS2482_PTR_CODE_xxx */
 
#define DS2482_CMD_CHANNEL_SELECT   0xC3 /* Param: Channel byte - DS2482-800 only */
 
#define DS2482_CMD_WRITE_CONFIG   0xD2 /* Param: Config byte */
 
#define DS2482_CMD_1WIRE_RESET   0xB4 /* Param: None */
 
#define DS2482_CMD_1WIRE_SINGLE_BIT   0x87 /* Param: Bit byte (bit7) */
 
#define DS2482_CMD_1WIRE_WRITE_BYTE   0xA5 /* Param: Data byte */
 
#define DS2482_CMD_1WIRE_READ_BYTE   0x96 /* Param: None */
 
#define DS2482_CMD_1WIRE_TRIPLET   0x78 /* Param: Dir byte (bit7) */
 
#define DS2482_PTR_CODE_STATUS   0xF0
 
#define DS2482_PTR_CODE_DATA   0xE1
 
#define DS2482_PTR_CODE_CHANNEL   0xD2 /* DS2482-800 only */
 
#define DS2482_PTR_CODE_CONFIG   0xC3
 
#define DS2482_REG_CFG_1WS   0x08
 
#define DS2482_REG_CFG_SPU   0x04
 
#define DS2482_REG_CFG_PPM   0x02
 
#define DS2482_REG_CFG_APU   0x01
 
#define DS2482_REG_STS_DIR   0x80
 
#define DS2482_REG_STS_TSB   0x40
 
#define DS2482_REG_STS_SBR   0x20
 
#define DS2482_REG_STS_RST   0x10
 
#define DS2482_REG_STS_LL   0x08
 
#define DS2482_REG_STS_SD   0x04
 
#define DS2482_REG_STS_PPD   0x02
 
#define DS2482_REG_STS_1WB   0x01
 
#define DS2482_WAIT_IDLE_TIMEOUT   100
 

Functions

 MODULE_AUTHOR ("Ben Gardner <[email protected]>")
 
 MODULE_DESCRIPTION ("DS2482 driver")
 
 MODULE_LICENSE ("GPL")
 
 module_init (sensors_ds2482_init)
 
 module_exit (sensors_ds2482_exit)
 

Macro Definition Documentation

#define DS2482_CMD_1WIRE_READ_BYTE   0x96 /* Param: None */

Definition at line 39 of file ds2482.c.

#define DS2482_CMD_1WIRE_RESET   0xB4 /* Param: None */

Definition at line 36 of file ds2482.c.

#define DS2482_CMD_1WIRE_SINGLE_BIT   0x87 /* Param: Bit byte (bit7) */

Definition at line 37 of file ds2482.c.

#define DS2482_CMD_1WIRE_TRIPLET   0x78 /* Param: Dir byte (bit7) */

Definition at line 41 of file ds2482.c.

#define DS2482_CMD_1WIRE_WRITE_BYTE   0xA5 /* Param: Data byte */

Definition at line 38 of file ds2482.c.

#define DS2482_CMD_CHANNEL_SELECT   0xC3 /* Param: Channel byte - DS2482-800 only */

Definition at line 34 of file ds2482.c.

#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 */

Definition at line 33 of file ds2482.c.

#define DS2482_CMD_WRITE_CONFIG   0xD2 /* Param: Config byte */

Definition at line 35 of file ds2482.c.

#define DS2482_PTR_CODE_CHANNEL   0xD2 /* DS2482-800 only */

Definition at line 46 of file ds2482.c.

#define DS2482_PTR_CODE_CONFIG   0xC3

Definition at line 47 of file ds2482.c.

#define DS2482_PTR_CODE_DATA   0xE1

Definition at line 45 of file ds2482.c.

#define DS2482_PTR_CODE_STATUS   0xF0

Definition at line 44 of file ds2482.c.

#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

Definition at line 57 of file ds2482.c.

#define DS2482_REG_CFG_PPM   0x02

Definition at line 56 of file ds2482.c.

#define DS2482_REG_CFG_SPU   0x04

Definition at line 55 of file ds2482.c.

#define DS2482_REG_STS_1WB   0x01

Definition at line 81 of file ds2482.c.

#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

Definition at line 78 of file ds2482.c.

#define DS2482_REG_STS_PPD   0x02

Definition at line 80 of file ds2482.c.

#define DS2482_REG_STS_RST   0x10

Definition at line 77 of file ds2482.c.

#define DS2482_REG_STS_SBR   0x20

Definition at line 76 of file ds2482.c.

#define DS2482_REG_STS_SD   0x04

Definition at line 79 of file ds2482.c.

#define DS2482_REG_STS_TSB   0x40

Definition at line 75 of file ds2482.c.

#define DS2482_WAIT_IDLE_TIMEOUT   100

Definition at line 197 of file ds2482.c.

Function Documentation

MODULE_AUTHOR ( "Ben Gardner <[email protected]>"  )
MODULE_DESCRIPTION ( "DS2482 driver )
module_exit ( sensors_ds2482_exit  )
module_init ( sensors_ds2482_init  )
MODULE_LICENSE ( "GPL"  )