i2c.h 493 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _LPC32XX_I2C_H
  2. #define _LPC32XX_I2C_H
  3. #include <common.h>
  4. #include <asm/types.h>
  5. /* i2c register set */
  6. struct lpc32xx_i2c_base {
  7. union {
  8. u32 rx;
  9. u32 tx;
  10. };
  11. u32 stat;
  12. u32 ctrl;
  13. u32 clk_hi;
  14. u32 clk_lo;
  15. u32 adr;
  16. u32 rxfl;
  17. u32 txfl;
  18. u32 rxb;
  19. u32 txb;
  20. u32 stx;
  21. u32 stxfl;
  22. };
  23. #ifdef CONFIG_DM_I2C
  24. enum {
  25. I2C_0, I2C_1, I2C_2,
  26. };
  27. struct lpc32xx_i2c_dev {
  28. struct lpc32xx_i2c_base *base;
  29. int index;
  30. uint speed;
  31. };
  32. #endif /* CONFIG_DM_I2C */
  33. #endif /* _LPC32XX_I2C_H */