FlashDev.c 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /* -----------------------------------------------------------------------------
  2. * Copyright (c) 2004 - 2014 ARM Ltd.
  3. *
  4. * This software is provided 'as-is', without any express or implied warranty.
  5. * In no event will the authors be held liable for any damages arising from
  6. * the use of this software. Permission is granted to anyone to use this
  7. * software for any purpose, including commercial applications, and to alter
  8. * it and redistribute it freely, subject to the following restrictions:
  9. *
  10. * 1. The origin of this software must not be misrepresented; you must not
  11. * claim that you wrote the original software. If you use this software in
  12. * a product, an acknowledgment in the product documentation would be
  13. * appreciated but is not required.
  14. *
  15. * 2. Altered source versions must be plainly marked as such, and must not be
  16. * misrepresented as being the original software.
  17. *
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. *
  20. *
  21. * $Date: 30. May 2014
  22. * $Revision: V1.00
  23. *
  24. * Project: Flash Device Description for NXP LPC18xx/43xx Flash using IAP
  25. * --------------------------------------------------------------------------- */
  26. #include "..\FlashOS.H" // FlashOS Structures
  27. #ifdef LPC18xx43xx
  28. #ifdef FLASH_512_BA
  29. struct FlashDevice const FlashDevice = {
  30. FLASH_DRV_VERS, // Driver Version, do not modify!
  31. "LPC18xx/43xx IAP 512kB Flash Bank A", // Device Name
  32. ONCHIP, // Device Type
  33. 0x1A000000, // Device Start Address
  34. 0x00080000, // Device Size (512kB)
  35. 1024, // Programming Page Size
  36. 0, // Reserved, must be 0
  37. 0xFF, // Initial Content of Erased Memory
  38. 5000, // Program Page Timeout 5000 mSec
  39. 5000, // Erase Sector Timeout 5000 mSec
  40. // Specify Size and Address of Sectors
  41. 0x002000, 0x000000, // Sector Size 8kB (8 Sectors)
  42. 0x010000, 0x010000, // Sector Size 64kB (7 Sectors)
  43. SECTOR_END
  44. };
  45. #endif
  46. #ifdef FLASH_512_BB
  47. struct FlashDevice const FlashDevice = {
  48. FLASH_DRV_VERS, // Driver Version, do not modify!
  49. "LPC18xx/43xx IAP 512kB Flash Bank B", // Device Name
  50. ONCHIP, // Device Type
  51. 0x1B000000, // Device Start Address
  52. 0x00080000, // Device Size (512kB)
  53. 1024, // Programming Page Size
  54. 0, // Reserved, must be 0
  55. 0xFF, // Initial Content of Erased Memory
  56. 5000, // Program Page Timeout 5000 mSec
  57. 5000, // Erase Sector Timeout 5000 mSec
  58. // Specify Size and Address of Sectors
  59. 0x002000, 0x000000, // Sector Size 8kB (8 Sectors)
  60. 0x010000, 0x010000, // Sector Size 64kB (7 Sectors)
  61. SECTOR_END
  62. };
  63. #endif
  64. #ifdef FLASH_384_BA
  65. struct FlashDevice const FlashDevice = {
  66. FLASH_DRV_VERS, // Driver Version, do not modify!
  67. "LPC18xx/43xx IAP 384kB Flash Bank A", // Device Name
  68. ONCHIP, // Device Type
  69. 0x1A000000, // Device Start Address
  70. 0x00060000, // Device Size (384kB)
  71. 1024, // Programming Page Size
  72. 0, // Reserved, must be 0
  73. 0xFF, // Initial Content of Erased Memory
  74. 5000, // Program Page Timeout 5000 mSec
  75. 5000, // Erase Sector Timeout 5000 mSec
  76. // Specify Size and Address of Sectors
  77. 0x002000, 0x000000, // Sector Size 8kB (8 Sectors)
  78. 0x010000, 0x010000, // Sector Size 64kB (5 Sectors)
  79. SECTOR_END
  80. };
  81. #endif
  82. #ifdef FLASH_384_BB
  83. struct FlashDevice const FlashDevice = {
  84. FLASH_DRV_VERS, // Driver Version, do not modify!
  85. "LPC18xx/43xx IAP 384kB Flash Bank B", // Device Name
  86. ONCHIP, // Device Type
  87. 0x1B000000, // Device Start Address
  88. 0x00060000, // Device Size (384kB)
  89. 1024, // Programming Page Size
  90. 0, // Reserved, must be 0
  91. 0xFF, // Initial Content of Erased Memory
  92. 5000, // Program Page Timeout 5000 mSec
  93. 5000, // Erase Sector Timeout 5000 mSec
  94. // Specify Size and Address of Sectors
  95. 0x002000, 0x000000, // Sector Size 8kB (8 Sectors)
  96. 0x010000, 0x010000, // Sector Size 64kB (5 Sectors)
  97. SECTOR_END
  98. };
  99. #endif
  100. #ifdef FLASH_256_BA
  101. struct FlashDevice const FlashDevice = {
  102. FLASH_DRV_VERS, // Driver Version, do not modify!
  103. "LPC18xx/43xx IAP 256kB Flash Bank A", // Device Name
  104. ONCHIP, // Device Type
  105. 0x1A000000, // Device Start Address
  106. 0x00040000, // Device Size (256kB)
  107. 1024, // Programming Page Size
  108. 0, // Reserved, must be 0
  109. 0xFF, // Initial Content of Erased Memory
  110. 5000, // Program Page Timeout 5000 mSec
  111. 5000, // Erase Sector Timeout 5000 mSec
  112. // Specify Size and Address of Sectors
  113. 0x002000, 0x000000, // Sector Size 8kB (8 Sectors)
  114. 0x010000, 0x010000, // Sector Size 64kB (3 Sectors)
  115. SECTOR_END
  116. };
  117. #endif
  118. #ifdef FLASH_256_BB
  119. struct FlashDevice const FlashDevice = {
  120. FLASH_DRV_VERS, // Driver Version, do not modify!
  121. "LPC18xx/43xx IAP 256kB Flash Bank B", // Device Name
  122. ONCHIP, // Device Type
  123. 0x1B000000, // Device Start Address
  124. 0x00040000, // Device Size (256kB)
  125. 1024, // Programming Page Size
  126. 0, // Reserved, must be 0
  127. 0xFF, // Initial Content of Erased Memory
  128. 5000, // Program Page Timeout 5000 mSec
  129. 5000, // Erase Sector Timeout 5000 mSec
  130. // Specify Size and Address of Sectors
  131. 0x002000, 0x000000, // Sector Size 8kB (8 Sectors)
  132. 0x010000, 0x010000, // Sector Size 64kB (3 Sectors)
  133. SECTOR_END
  134. };
  135. #endif
  136. #endif // LPC18xx43xx