diff --git a/src/ec/it8587e/i2c.c b/src/ec/it8587e/i2c.c index 53183b4..1139e22 100644 --- a/src/ec/it8587e/i2c.c +++ b/src/ec/it8587e/i2c.c @@ -7,16 +7,6 @@ //TODO: find best value #define I2C_TIMEOUT 1000 -#define HOSTA_BYTE_DONE (1 << 7) -#define HOSTA_TIMEOUT (1 << 6) -#define HOSTA_NACK (1 << 5) -#define HOSTA_FAIL (1 << 4) -#define HOSTA_BUS_ERR (1 << 3) -#define HOSTA_DEV_ERR (1 << 2) -#define HOSTA_FINISH (1 << 1) -#define HOSTA_BUSY (1 << 0) -#define HOSTA_ERR (HOSTA_TIMEOUT | HOSTA_NACK | HOSTA_FAIL | HOSTA_BUS_ERR | HOSTA_DEV_ERR) - void i2c_reset(bool kill) { if (HOSTAA & HOSTA_BUSY) { // Set kill bit diff --git a/src/ec/it8587e/include/ec/smbus.h b/src/ec/it8587e/include/ec/smbus.h index 487b7f1..8e328c8 100644 --- a/src/ec/it8587e/include/ec/smbus.h +++ b/src/ec/it8587e/include/ec/smbus.h @@ -3,6 +3,16 @@ #include +#define HOSTA_BYTE_DONE (1 << 7) +#define HOSTA_TIMEOUT (1 << 6) +#define HOSTA_NACK (1 << 5) +#define HOSTA_FAIL (1 << 4) +#define HOSTA_BUS_ERR (1 << 3) +#define HOSTA_DEV_ERR (1 << 2) +#define HOSTA_FINISH (1 << 1) +#define HOSTA_BUSY (1 << 0) +#define HOSTA_ERR (HOSTA_TIMEOUT | HOSTA_NACK | HOSTA_FAIL | HOSTA_BUS_ERR | HOSTA_DEV_ERR) + // Host status for channel A volatile uint8_t __xdata __at(0x1C00) HOSTAA; // Host control for channel A