summaryrefslogtreecommitdiff
path: root/i2c.h
blob: 86a141c1e86d027b851984e4f158f0937d87099a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <glib.h>

#define PCF8574                 0x20	/* secondary I2C peripheral device */
#define Second_PW_Port		0	/* PCF8574 at three-bit address 0 is for dual PW or Delay board (PCB 205A) */
#define Second_Dly_Port         1       /* PCF8574 at three-bit address 1 is for dual delay board (obsolete, was for AVX-DD-A3-PS-TC) */
#define To_Self_Cal_Port        2       /* PCF8574 at three-bit address 2 is for self-cal PCB 226A */
#define From_Self_Cal_Port      3       /* PCF8574 at three-bit address 3 is for self-cal PCB 226A */
#define Octal_Relay_Driver	4	/* PCF8574 at three-bit address 4 is for octal relay driver, PCB 244A */
#define Extra_DACs_Low_Port	5	/* PCF8574 at three-bit address 5 is for low byte of PCB 313A DAC board */
#define Extra_DACs_High_Port	6	/* PCF8574 at three-bit address 6 is for high byte of PCB 313A DAC board */

#define PCF8574A                0x38    /* Main I2C peripheral device */
#define Button_Press_Port       0       /* PCF8574A at three-bit address 0 is for detecting button presses */
#define LCD_Port                1       /* PCF8574A at three-bit address 1 is for LCD */
#define Lower_Encoder_Port      2       /* PCF8574A at three-bit address 2 is for lower encoder counters */
#define Upper_Encoder_Port      3       /* PCF8574A at three-bit address 3 is for upper encoder counter */
#define Curr_Mon_LSB            4       /* PCF8574A at three-bit address 4 is for current monitor */
#define Curr_Mon_MSB            5       /* PCF8574A at three-bit address 5 is for current monitor */
#define rise_time_port          4       /* PCF8574A at three-bit address 4 is for rise time circuit in AVRQ */

/* 6 and 7 reserved for dual-channel current monitor */

#define Overload_Input 64               /* mask for main overload input */
#define Over_Temp 0x10                  /* over-temperature */
#define Over_Volt 0x20                  /* over-voltage */
#define Over_Other 0x40                 /* over-other */


void I2C_Write(gulong address, guchar value);
guchar I2C_Read(gulong address);