]> rtime.felk.cvut.cz Git - sysless.git/blobdiff - libs4c/i2c/i2c_c552.c
LPC17xx and LPC178x: updates to ensure compatibility with new NXP header files.
[sysless.git] / libs4c / i2c / i2c_c552.c
index f38b931b962c5710fa1b0f7ad3f13772bf569b51..f2fc3708d2c21eded4b2ee528ed4c97dcbad607b 100644 (file)
@@ -35,7 +35,18 @@ int c552_stroke(i2c_drv_t *drv);
 
 // I2C Registers
 
-#ifdef __LPC17xx_H__
+#if defined(__LPC177x_8x_H__)
+
+#define C552_CONSET(port)  (((LPC_I2C_TypeDef *)(port))->CONSET)  /* Control Set Register */
+#define C552_STAT(port)    (((LPC_I2C_TypeDef *)(port))->STAT)    /* Status Register */
+#define C552_DAT(port)     (((LPC_I2C_TypeDef *)(port))->DAT)     /* Data Register */
+#define C552_ADR(port)     (((LPC_I2C_TypeDef *)(port))->ADR0)    /* Slave Address Register */
+#define C552_SCLH(port)    (((LPC_I2C_TypeDef *)(port))->SCLH)    /* SCL Duty Cycle Register (high half word) */
+#define C552_SCLL(port)    (((LPC_I2C_TypeDef *)(port))->SCLL)    /* SCL Duty Cycle Register (low half word) */
+#define C552_CONCLR(port)  (((LPC_I2C_TypeDef *)(port))->CONCLR)  /* Control Clear Register */
+#define C552_MMCTRL(port)  (((LPC_I2C_TypeDef *)(port))->MMCTRL)    /* Monitor Mode Control */
+
+#elif defined(__LPC17xx_H__)
 
 #define C552_CONSET(port)  (((I2C_TypeDef *)(port))->I2CONSET)  /* Control Set Register */
 #define C552_STAT(port)    (((I2C_TypeDef *)(port))->I2STAT)    /* Status Register */