diff --git a/firmware/export/i2c-pp.h b/firmware/export/i2c-pp.h index 55e84b65a4..f126fa812d 100644 --- a/firmware/export/i2c-pp.h +++ b/firmware/export/i2c-pp.h @@ -34,17 +34,6 @@ #ifndef _I2C_PP_H #define _I2C_PP_H -#define I2C_CTRL (*(volatile unsigned char*)(I2C_BASE+0x00)) -#define I2C_ADDR (*(volatile unsigned char*)(I2C_BASE+0x04)) -#define I2C_DATA(X) (*(volatile unsigned char*)(I2C_BASE+0xc+(4*X))) -#define I2C_STATUS (*(volatile unsigned char*)(I2C_BASE+0x1c)) - -/* I2C_CTRL bit definitions */ -#define I2C_SEND 0x80 - -/* I2C_STATUS bit definitions */ -#define I2C_BUSY (1<<6) - /* TODO: Fully implement i2c driver */ /* To be used by drivers that need to do multiple i2c operations diff --git a/firmware/target/arm/i2c-pp.c b/firmware/target/arm/i2c-pp.c index fef2082e60..b162606680 100644 --- a/firmware/target/arm/i2c-pp.c +++ b/firmware/target/arm/i2c-pp.c @@ -36,6 +36,17 @@ #include "ascodec.h" #include "as3514.h" +#define I2C_CTRL (*(volatile unsigned char*)(I2C_BASE+0x00)) +#define I2C_ADDR (*(volatile unsigned char*)(I2C_BASE+0x04)) +#define I2C_DATA(X) (*(volatile unsigned char*)(I2C_BASE+0xc+(4*X))) +#define I2C_STATUS (*(volatile unsigned char*)(I2C_BASE+0x1c)) + +/* I2C_CTRL bit definitions */ +#define I2C_SEND 0x80 + +/* I2C_STATUS bit definitions */ +#define I2C_BUSY (1<<6) + /* Local functions definitions */ static struct mutex i2c_mtx SHAREDBSS_ATTR;