You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
3.8 KiB

4 years ago
  1. /**
  2. ******************************************************************************
  3. * @author
  4. * @version V1.0.0
  5. * @date 12-JAN-2014
  6. * @brief This file contains all the functions prototypes for the IAP_TABLE firmware
  7. * library.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  12. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  13. * TIME. AS A RESULT, ICHAIER SHALL NOT BE HELD LIABLE FOR ANY
  14. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  15. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  16. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  17. *
  18. * <h2><center>&copy; COPYRIGHT 2014 ICHaier</center></h2>
  19. ******************************************************************************
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __ES8P5066_IAP_TABLE_H
  23. #define __ES8P5066_IAP_TABLE_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "ES8P5066.h"
  29. #include "type.h"
  30. /** @addtogroup IAP_TABLE
  31. * @{
  32. */
  33. /** @defgroup IAP_TABLE_Exported_Types
  34. * @{
  35. */
  36. /**
  37. * @}
  38. */
  39. /** @defgroup IAP_TABLE_Exported_Constants
  40. * @{
  41. */
  42. /** @defgroup IAP_TABLE_ADDR
  43. * @{
  44. */
  45. #define IAP_Code_PageProgram_addr 0x10000000
  46. #define IAP_Code_PageErase_addr 0x10000004
  47. #define IAP_Code_WordProgram_addr 0x10000008
  48. #define IAP_Data_PageProgram_addr 0x10000010
  49. #define IAP_Data_PageErase_addr 0x10000014
  50. #define IAP_Data_WordProgram_addr 0x10000018
  51. /* 回调函数定义 */
  52. typedef ErrorStatus(*IAP_PE)(uint32_t address, uint32_t addressInv, uint32_t sector);
  53. typedef ErrorStatus(*IAP_WP)(uint32_t address, uint32_t addressInv, uint32_t data);
  54. typedef ErrorStatus(*IAP_PP)(uint32_t address, uint32_t addressInv, uint8_t data[], uint32_t length, uint32_t erase);
  55. /* 函数声明 */
  56. ErrorStatus IAP_Code_PageErase(uint32_t address, uint32_t addressInv, uint32_t sector);
  57. ErrorStatus IAP_Code_WordProgram(uint32_t address, uint32_t addressInv, uint32_t data);
  58. ErrorStatus IAP_Code_PageProgram(uint32_t address, uint32_t addressInv, uint8_t data[], uint32_t length, uint32_t erase);
  59. ErrorStatus IAP_Data_PageErase(uint32_t address, uint32_t addressInv, uint32_t sector);
  60. ErrorStatus IAP_Data_WordProgram(uint32_t address, uint32_t addressInv, uint32_t data);
  61. ErrorStatus IAP_Data_PageProgram(uint32_t address, uint32_t addressInv, uint8_t data[], uint32_t length, uint32_t erase);
  62. ErrorStatus IAPRead(uint32_t *Ram_Addr, uint32_t Flash_Addr, uint8_t Len);
  63. void IAP_FLASH_Unlock(void);
  64. void IAP_FLASH_Lock(void);
  65. /** @defgroup IAP_PageProgram erase
  66. * @{
  67. */
  68. #define PageEraseEnable 0x00000001
  69. #define PageEraseDisable 0x00000000
  70. /** Flash REQ
  71. * @}
  72. */
  73. /* ---------------------------- */
  74. /** @defgroup typedef
  75. * @{
  76. */
  77. /* typedef void (* pfunc_erase)(uint32_t);
  78. typedef void (* pfunc_word)(uint32_t, uint32_t);
  79. typedef void (* pfunc_page)(uint32_t, unsigned char *, uint32_t, uint32_t); */
  80. /**
  81. * @}
  82. */
  83. /**
  84. * @}
  85. */
  86. /** @defgroup IAP_TABLE_Exported_Macros
  87. * @{
  88. */
  89. /**
  90. * @}
  91. */
  92. /** @defgroup IAP_TABLE_Exported_Functions
  93. * @{
  94. */
  95. /* __ASM ErrorStatus IAP_PageErase(uint32_t address);
  96. __ASM ErrorStatus IAP_WordProgram(uint32_t address, uint32_t data);
  97. __ASM ErrorStatus IAP_PageProgram(uint32_t address, uint32_t data[], uint32_t length, uint32_t erase); */
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101. #endif
  102. /**
  103. * @}
  104. */
  105. /**
  106. * @}
  107. */
  108. /**
  109. * @}
  110. */
  111. /******************* (C) COPYRIGHT 2014 ICHaier *****END OF FILE****/