hw_eeprom.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. //*****************************************************************************
  2. //
  3. // hw_eeprom.h - Macros used when accessing the EEPROM controller.
  4. //
  5. // Copyright (c) 2011-2014 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Redistribution and use in source and binary forms, with or without
  9. // modification, are permitted provided that the following conditions
  10. // are met:
  11. //
  12. // Redistributions of source code must retain the above copyright
  13. // notice, this list of conditions and the following disclaimer.
  14. //
  15. // Redistributions in binary form must reproduce the above copyright
  16. // notice, this list of conditions and the following disclaimer in the
  17. // documentation and/or other materials provided with the
  18. // distribution.
  19. //
  20. // Neither the name of Texas Instruments Incorporated nor the names of
  21. // its contributors may be used to endorse or promote products derived
  22. // from this software without specific prior written permission.
  23. //
  24. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. //
  36. // This is part of revision 2.1.0.12573 of the Tiva Firmware Development Package.
  37. //
  38. //*****************************************************************************
  39. #ifndef __HW_EEPROM_H__
  40. #define __HW_EEPROM_H__
  41. //*****************************************************************************
  42. //
  43. // The following are defines for the EEPROM register offsets.
  44. //
  45. //*****************************************************************************
  46. #define EEPROM_EESIZE 0x400AF000 // EEPROM Size Information
  47. #define EEPROM_EEBLOCK 0x400AF004 // EEPROM Current Block
  48. #define EEPROM_EEOFFSET 0x400AF008 // EEPROM Current Offset
  49. #define EEPROM_EERDWR 0x400AF010 // EEPROM Read-Write
  50. #define EEPROM_EERDWRINC 0x400AF014 // EEPROM Read-Write with Increment
  51. #define EEPROM_EEDONE 0x400AF018 // EEPROM Done Status
  52. #define EEPROM_EESUPP 0x400AF01C // EEPROM Support Control and
  53. // Status
  54. #define EEPROM_EEUNLOCK 0x400AF020 // EEPROM Unlock
  55. #define EEPROM_EEPROT 0x400AF030 // EEPROM Protection
  56. #define EEPROM_EEPASS0 0x400AF034 // EEPROM Password
  57. #define EEPROM_EEPASS1 0x400AF038 // EEPROM Password
  58. #define EEPROM_EEPASS2 0x400AF03C // EEPROM Password
  59. #define EEPROM_EEINT 0x400AF040 // EEPROM Interrupt
  60. #define EEPROM_EEHIDE0 0x400AF050 // EEPROM Block Hide 0
  61. #define EEPROM_EEHIDE 0x400AF050 // EEPROM Block Hide
  62. #define EEPROM_EEHIDE1 0x400AF054 // EEPROM Block Hide 1
  63. #define EEPROM_EEHIDE2 0x400AF058 // EEPROM Block Hide 2
  64. #define EEPROM_EEDBGME 0x400AF080 // EEPROM Debug Mass Erase
  65. #define EEPROM_PP 0x400AFFC0 // EEPROM Peripheral Properties
  66. //*****************************************************************************
  67. //
  68. // The following are defines for the bit fields in the EEPROM_EESIZE register.
  69. //
  70. //*****************************************************************************
  71. #define EEPROM_EESIZE_WORDCNT_M 0x0000FFFF // Number of 32-Bit Words
  72. #define EEPROM_EESIZE_BLKCNT_M 0x07FF0000 // Number of 16-Word Blocks
  73. #define EEPROM_EESIZE_WORDCNT_S 0
  74. #define EEPROM_EESIZE_BLKCNT_S 16
  75. //*****************************************************************************
  76. //
  77. // The following are defines for the bit fields in the EEPROM_EEBLOCK register.
  78. //
  79. //*****************************************************************************
  80. #define EEPROM_EEBLOCK_BLOCK_M 0x0000FFFF // Current Block
  81. #define EEPROM_EEBLOCK_BLOCK_S 0
  82. //*****************************************************************************
  83. //
  84. // The following are defines for the bit fields in the EEPROM_EEOFFSET
  85. // register.
  86. //
  87. //*****************************************************************************
  88. #define EEPROM_EEOFFSET_OFFSET_M \
  89. 0x0000000F // Current Address Offset
  90. #define EEPROM_EEOFFSET_OFFSET_S \
  91. 0
  92. //*****************************************************************************
  93. //
  94. // The following are defines for the bit fields in the EEPROM_EERDWR register.
  95. //
  96. //*****************************************************************************
  97. #define EEPROM_EERDWR_VALUE_M 0xFFFFFFFF // EEPROM Read or Write Data
  98. #define EEPROM_EERDWR_VALUE_S 0
  99. //*****************************************************************************
  100. //
  101. // The following are defines for the bit fields in the EEPROM_EERDWRINC
  102. // register.
  103. //
  104. //*****************************************************************************
  105. #define EEPROM_EERDWRINC_VALUE_M \
  106. 0xFFFFFFFF // EEPROM Read or Write Data with
  107. // Increment
  108. #define EEPROM_EERDWRINC_VALUE_S \
  109. 0
  110. //*****************************************************************************
  111. //
  112. // The following are defines for the bit fields in the EEPROM_EEDONE register.
  113. //
  114. //*****************************************************************************
  115. #define EEPROM_EEDONE_WORKING 0x00000001 // EEPROM Working
  116. #define EEPROM_EEDONE_WKERASE 0x00000004 // Working on an Erase
  117. #define EEPROM_EEDONE_WKCOPY 0x00000008 // Working on a Copy
  118. #define EEPROM_EEDONE_NOPERM 0x00000010 // Write Without Permission
  119. #define EEPROM_EEDONE_WRBUSY 0x00000020 // Write Busy
  120. //*****************************************************************************
  121. //
  122. // The following are defines for the bit fields in the EEPROM_EESUPP register.
  123. //
  124. //*****************************************************************************
  125. #define EEPROM_EESUPP_ERETRY 0x00000004 // Erase Must Be Retried
  126. #define EEPROM_EESUPP_PRETRY 0x00000008 // Programming Must Be Retried
  127. //*****************************************************************************
  128. //
  129. // The following are defines for the bit fields in the EEPROM_EEUNLOCK
  130. // register.
  131. //
  132. //*****************************************************************************
  133. #define EEPROM_EEUNLOCK_UNLOCK_M \
  134. 0xFFFFFFFF // EEPROM Unlock
  135. //*****************************************************************************
  136. //
  137. // The following are defines for the bit fields in the EEPROM_EEPROT register.
  138. //
  139. //*****************************************************************************
  140. #define EEPROM_EEPROT_PROT_M 0x00000007 // Protection Control
  141. #define EEPROM_EEPROT_PROT_RWNPW \
  142. 0x00000000 // This setting is the default. If
  143. // there is no password, the block
  144. // is not protected and is readable
  145. // and writable
  146. #define EEPROM_EEPROT_PROT_RWPW 0x00000001 // If there is a password, the
  147. // block is readable or writable
  148. // only when unlocked
  149. #define EEPROM_EEPROT_PROT_RONPW \
  150. 0x00000002 // If there is no password, the
  151. // block is readable, not writable
  152. #define EEPROM_EEPROT_ACC 0x00000008 // Access Control
  153. //*****************************************************************************
  154. //
  155. // The following are defines for the bit fields in the EEPROM_EEPASS0 register.
  156. //
  157. //*****************************************************************************
  158. #define EEPROM_EEPASS0_PASS_M 0xFFFFFFFF // Password
  159. #define EEPROM_EEPASS0_PASS_S 0
  160. //*****************************************************************************
  161. //
  162. // The following are defines for the bit fields in the EEPROM_EEPASS1 register.
  163. //
  164. //*****************************************************************************
  165. #define EEPROM_EEPASS1_PASS_M 0xFFFFFFFF // Password
  166. #define EEPROM_EEPASS1_PASS_S 0
  167. //*****************************************************************************
  168. //
  169. // The following are defines for the bit fields in the EEPROM_EEPASS2 register.
  170. //
  171. //*****************************************************************************
  172. #define EEPROM_EEPASS2_PASS_M 0xFFFFFFFF // Password
  173. #define EEPROM_EEPASS2_PASS_S 0
  174. //*****************************************************************************
  175. //
  176. // The following are defines for the bit fields in the EEPROM_EEINT register.
  177. //
  178. //*****************************************************************************
  179. #define EEPROM_EEINT_INT 0x00000001 // Interrupt Enable
  180. //*****************************************************************************
  181. //
  182. // The following are defines for the bit fields in the EEPROM_EEHIDE0 register.
  183. //
  184. //*****************************************************************************
  185. #define EEPROM_EEHIDE0_HN_M 0xFFFFFFFE // Hide Block
  186. //*****************************************************************************
  187. //
  188. // The following are defines for the bit fields in the EEPROM_EEHIDE register.
  189. //
  190. //*****************************************************************************
  191. #define EEPROM_EEHIDE_HN_M 0xFFFFFFFE // Hide Block
  192. //*****************************************************************************
  193. //
  194. // The following are defines for the bit fields in the EEPROM_EEHIDE1 register.
  195. //
  196. //*****************************************************************************
  197. #define EEPROM_EEHIDE1_HN_M 0xFFFFFFFF // Hide Block
  198. //*****************************************************************************
  199. //
  200. // The following are defines for the bit fields in the EEPROM_EEHIDE2 register.
  201. //
  202. //*****************************************************************************
  203. #define EEPROM_EEHIDE2_HN_M 0xFFFFFFFF // Hide Block
  204. //*****************************************************************************
  205. //
  206. // The following are defines for the bit fields in the EEPROM_EEDBGME register.
  207. //
  208. //*****************************************************************************
  209. #define EEPROM_EEDBGME_ME 0x00000001 // Mass Erase
  210. #define EEPROM_EEDBGME_KEY_M 0xFFFF0000 // Erase Key
  211. #define EEPROM_EEDBGME_KEY_S 16
  212. //*****************************************************************************
  213. //
  214. // The following are defines for the bit fields in the EEPROM_PP register.
  215. //
  216. //*****************************************************************************
  217. #define EEPROM_PP_SIZE_M 0x0000FFFF // EEPROM Size
  218. #define EEPROM_PP_SIZE_64 0x00000000 // 64 bytes of EEPROM
  219. #define EEPROM_PP_SIZE_128 0x00000001 // 128 bytes of EEPROM
  220. #define EEPROM_PP_SIZE_256 0x00000003 // 256 bytes of EEPROM
  221. #define EEPROM_PP_SIZE_512 0x00000007 // 512 bytes of EEPROM
  222. #define EEPROM_PP_SIZE_1K 0x0000000F // 1 KB of EEPROM
  223. #define EEPROM_PP_SIZE_2K 0x0000001F // 2 KB of EEPROM
  224. #define EEPROM_PP_SIZE_3K 0x0000003F // 3 KB of EEPROM
  225. #define EEPROM_PP_SIZE_4K 0x0000007F // 4 KB of EEPROM
  226. #define EEPROM_PP_SIZE_5K 0x000000FF // 5 KB of EEPROM
  227. #define EEPROM_PP_SIZE_6K 0x000001FF // 6 KB of EEPROM
  228. #define EEPROM_PP_SIZE_S 0
  229. #endif // __HW_EEPROM_H__