No empty .Rs/.Re
[netbsd-mini2440.git] / sys / dev / ic / pcf8584reg.h
blob02e15f8acd609b206d9e8859a1a531f168d6adc8
1 /* $NetBSD: pcf8584reg.h $ */
3 /* Written by Tobias Nygren. Released into the public domain. */
5 /* SCL clock frequency */
6 #define PCF8584_SCL_90 0 /* 90 kHz */
7 #define PCF8584_SCL_45 1 /* 45 kHz */
8 #define PCF8584_SCL_11 2 /* 11 kHz */
9 #define PCF8584_SCL_1_5 3 /* 1.5 kHz */
11 /* Internal clock frequency */
12 #define PCF8584_CLK_3 0 /* 3 MHz */
13 #define PCF8584_CLK_4_43 0x10 /* 4.43 MHz */
14 #define PCF8584_CLK_6 0x14 /* 6 MHz */
15 #define PCF8584_CLK_8 0x18 /* 8 MHz */
16 #define PCF8584_CLK_12 0x1C /* 12 MHz */
18 /* Control register bits (write only) */
19 #define PCF8584_CTRL_ACK (1<<0) /* send ACK */
20 #define PCF8584_CTRL_STO (1<<1) /* send STOP */
21 #define PCF8584_CTRL_STA (1<<2) /* send START */
22 #define PCF8584_CTRL_ENI (1<<3) /* Enable Interrupt */
23 #define PCF8584_CTRL_ES2 (1<<4) /* alternate register selection */
24 #define PCF8584_CTRL_ES1 (1<<5) /* alternate register selection */
25 #define PCF8584_CTRL_ESO (1<<6) /* Enable Serial Output */
26 #define PCF8584_CTRL_PIN (1<<7) /* Pending Interrupt Not */
28 /* Status register bits (read only) */
29 #define PCF8584_STATUS_BBN (1<<0) /* Bus Busy Not */
30 #define PCF8584_STATUS_LAB (1<<1) /* Lost Arbitration */
31 #define PCF8584_STATUS_AAS (1<<2) /* Adressed As Slave */
32 #define PCF8584_STATUS_LRB (1<<3) /* Last Received Bit (NAK+bcast det.) */
33 #define PCF8584_STATUS_BER (1<<4) /* Bus error */
34 #define PCF8584_STATUS_STS (1<<5) /* external STOP condition detected */
35 #define PCF8584_STATUS_INI (1<<6) /* 0 if initialized */
36 #define PCF8584_STATUS_PIN (1<<7) /* Pending Interrupt Not */
38 #define PCF8584_REG_S0_ 0 /* S0' own address */
39 #define PCF8584_REG_S2 PCF8584_CTRL_ES1 /* clock register */
40 #define PCF8584_REG_S3 PCF8584_CTRL_ES2 /* Interrupt vector */
42 #define PCF8584_CMD_START (PCF8584_CTRL_PIN | PCF8584_CTRL_ESO | \
43 PCF8584_CTRL_STA | PCF8584_CTRL_ACK)
44 #define PCF8584_CMD_STOP (PCF8584_CTRL_PIN | PCF8584_CTRL_ESO | \
45 PCF8584_CTRL_STO | PCF8584_CTRL_ACK)
46 #define PCF8584_CMD_NAK (PCF8584_CTRL_ESO)