Path: blob/master/drivers/i2c/algos/i2c-algo-pcf.h
17602 views
/* -------------------------------------------------------------------- */1/* i2c-pcf8584.h: PCF 8584 global defines */2/* -------------------------------------------------------------------- */3/* Copyright (C) 1996 Simon G. Vogl41999 Hans Berglund56This program is free software; you can redistribute it and/or modify7it under the terms of the GNU General Public License as published by8the Free Software Foundation; either version 2 of the License, or9(at your option) any later version.1011This program is distributed in the hope that it will be useful,12but WITHOUT ANY WARRANTY; without even the implied warranty of13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14GNU General Public License for more details.1516You should have received a copy of the GNU General Public License17along with this program; if not, write to the Free Software18Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */19/* -------------------------------------------------------------------- */2021/* With some changes from Frodo Looijaard <[email protected]> */2223#ifndef I2C_PCF8584_H24#define I2C_PCF8584_H 12526/* ----- Control register bits ---------------------------------------- */27#define I2C_PCF_PIN 0x8028#define I2C_PCF_ESO 0x4029#define I2C_PCF_ES1 0x2030#define I2C_PCF_ES2 0x1031#define I2C_PCF_ENI 0x0832#define I2C_PCF_STA 0x0433#define I2C_PCF_STO 0x0234#define I2C_PCF_ACK 0x013536#define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)37#define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)38#define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)39#define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)4041/* ----- Status register bits ----------------------------------------- */42/*#define I2C_PCF_PIN 0x80 as above*/4344#define I2C_PCF_INI 0x40 /* 1 if not initialized */45#define I2C_PCF_STS 0x2046#define I2C_PCF_BER 0x1047#define I2C_PCF_AD0 0x0848#define I2C_PCF_LRB 0x0849#define I2C_PCF_AAS 0x0450#define I2C_PCF_LAB 0x0251#define I2C_PCF_BB 0x015253/* ----- Chip clock frequencies --------------------------------------- */54#define I2C_PCF_CLK3 0x0055#define I2C_PCF_CLK443 0x1056#define I2C_PCF_CLK6 0x1457#define I2C_PCF_CLK 0x1858#define I2C_PCF_CLK12 0x1c5960/* ----- transmission frequencies ------------------------------------- */61#define I2C_PCF_TRNS90 0x00 /* 90 kHz */62#define I2C_PCF_TRNS45 0x01 /* 45 kHz */63#define I2C_PCF_TRNS11 0x02 /* 11 kHz */64#define I2C_PCF_TRNS15 0x03 /* 1.5 kHz */656667/* ----- Access to internal registers according to ES1,ES2 ------------ */68/* they are mapped to the data port ( a0 = 0 ) */69/* available when ESO == 0 : */7071#define I2C_PCF_OWNADR 072#define I2C_PCF_INTREG I2C_PCF_ES273#define I2C_PCF_CLKREG I2C_PCF_ES17475#endif /* I2C_PCF8584_H */767778