reg_i2c.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /** @file reg_i2c.h
  2. * @brief I2C Register Layer Header File
  3. * @date 29.May.2013
  4. * @version 03.05.02
  5. *
  6. * This file contains:
  7. * - Definitions
  8. * - Types
  9. * - Interface Prototypes
  10. * .
  11. * which are relevant for the I2C driver.
  12. */
  13. /* (c) Texas Instruments 2009-2013, All rights reserved. */
  14. #ifndef __REG_I2C_H__
  15. #define __REG_I2C_H__
  16. #include "sys_common.h"
  17. #include "gio.h"
  18. /* USER CODE BEGIN (0) */
  19. /* USER CODE END */
  20. /* I2c Register Frame Definition */
  21. /** @struct i2cBase
  22. * @brief I2C Base Register Definition
  23. *
  24. * This structure is used to access the I2C module registers.
  25. */
  26. /** @typedef i2cBASE_t
  27. * @brief I2C Register Frame Type Definition
  28. *
  29. * This type is used to access the I2C Registers.
  30. */
  31. typedef volatile struct i2cBase
  32. {
  33. uint32 OAR; /**< 0x0000 I2C Own Address register */
  34. uint32 IMR; /**< 0x0004 I2C Interrupt Mask/Status register */
  35. uint32 STR; /**< 0x0008 I2C Interrupt Status register */
  36. uint32 CLKL; /**< 0x000C I2C Clock Divider Low register */
  37. uint32 CLKH; /**< 0x0010 I2C Clock Divider High register */
  38. uint32 CNT; /**< 0x0014 I2C Data Count register */
  39. uint32 DRR; /**< 0x0018 I2C Data Receive register */
  40. uint32 SAR; /**< 0x001C I2C Slave Address register */
  41. uint32 DXR; /**< 0x0020 I2C Data Transmit register */
  42. uint32 MDR; /**< 0x0024 I2C Mode register */
  43. uint32 IVR; /**< 0x0028 I2C Interrupt Vector register */
  44. uint32 EMDR; /**< 0x002C I2C Extended Mode register */
  45. uint32 PSC; /**< 0x0030 I2C Prescaler register */
  46. uint32 PID11; /**< 0x0034 I2C Peripheral ID register 1 */
  47. uint32 PID12; /**< 0x0038 I2C Peripheral ID register 2 */
  48. uint32 DMAC; /**< 0x003C I2C DMA Control Register */
  49. uint32 rsvd1; /**< 0x0040 Reserved */
  50. uint32 rsvd2; /**< 0x0044 Reserved */
  51. uint32 FUN; /**< 0x0048 Pin Function Register */
  52. uint32 DIR; /**< 0x004C Pin Direction Register */
  53. uint32 DIN; /**< 0x0050 Pin Data In Register */
  54. uint32 DOUT; /**< 0x0054 Pin Data Out Register */
  55. uint32 SET; /**< 0x0058 Pin Data Set Register */
  56. uint32 CLR; /**< 0x005C Pin Data Clr Register */
  57. uint32 ODR; /**< 0x0060 Pin Open Drain Output Enable Register */
  58. uint32 PD; /**< 0x0064 Pin Pullup/Pulldown Disable Register */
  59. uint32 PSL; /**< 0x0068 Pin Pullup/Pulldown Selection Register */
  60. } i2cBASE_t;
  61. /** @def i2cREG1
  62. * @brief I2C Register Frame Pointer
  63. *
  64. * This pointer is used by the I2C driver to access the I2C module registers.
  65. */
  66. #define i2cREG1 ((i2cBASE_t *)0xFFF7D400U)
  67. /* USER CODE BEGIN (1) */
  68. /* USER CODE END */
  69. /** @def i2cPORT1
  70. * @brief I2C GIO Port Register Pointer
  71. *
  72. * Pointer used by the GIO driver to access I/O PORT of I2C
  73. * (use the GIO drivers to access the port pins).
  74. */
  75. #define i2cPORT1 ((gioPORT_t *)0xFFF7D44CU)
  76. /* USER CODE BEGIN (2) */
  77. /* USER CODE END */
  78. #endif