Commit 2d6699e8 authored by Ivan Tyagov's avatar Ivan Tyagov

Fixup mod io

See merge request nexedi/osie!40
parents 4e53f19d 0a02dd20
// global relay state // global relay state - XXX: use a list rather than individual variables
uint8_t I2C_0_RELAYS_STATE = 0; // state of 4 relays at I2C slave 0 uint8_t I2C_0_RELAYS_STATE = 0; // state of 4 relays at I2C slave 0
uint8_t I2C_1_RELAYS_STATE = 0; // state of 4 relays at I2C slave 1 uint8_t I2C_1_RELAYS_STATE = 0; // state of 4 relays at I2C slave 1
...@@ -8,8 +8,11 @@ static char *DEFAULT_I2C_0_ADDR = "0x58"; ...@@ -8,8 +8,11 @@ static char *DEFAULT_I2C_0_ADDR = "0x58";
// the list of attached I2C slaves // the list of attached I2C slaves
const int DEFAULT_I2C_SLAVE_ADDR = 0x58; const int DEFAULT_I2C_SLAVE_ADDR = 0x58;
// XXX:code assumes only 8 I2C slaves but it can be up to 127 // the current architecture of LIME2 supports up to 127 MOD-IO I2C slaves
int I2C_SLAVE_ADDR_LIST[] = {0, 0, 0, 0, 0, 0, 0, 0}; int I2C_SLAVE_ADDR_LIST[127] = {0};
// the number of physical relays
int DEFAULT_RELAY_COUNT = 4;
// the block device at host machine // the block device at host machine
static char *DEFAULT_I2C_BLOCK_DEVICE_NAME = "/dev/i2c-1"; static char *DEFAULT_I2C_BLOCK_DEVICE_NAME = "/dev/i2c-1";
...@@ -173,7 +176,6 @@ static int getAnalogInputStateAIN(int i2c_addr, int **analog_input, uint8_t read ...@@ -173,7 +176,6 @@ static int getAnalogInputStateAIN(int i2c_addr, int **analog_input, uint8_t read
} }
// step 3: write command over I2c // step 3: write command over I2c
//__u8 read_reg = 0x30; /* Device register to access */
char read_buf[10]; char read_buf[10];
read_buf[0] = read_reg; read_buf[0] = read_reg;
if (write(file, read_buf, 1) != 1) if (write(file, read_buf, 1) != 1)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment