Xmega Application Note | |||||
00001 /* This file has been prepared for Doxygen automatic documentation generation.*/ 00062 #ifndef SP_DRIVER_H 00063 #define SP_DRIVER_H 00064 00065 #include "avr_compiler.h" 00066 00067 /* Define the size of the flash page if not defined in the header files. */ 00068 #ifndef FLASH_PAGE_SIZE 00069 #error FLASH_PAGE_SIZE must be defined if not defined in header files. 00070 //#define FLASH_PAGE_SIZE 512 00071 #endif /*FLASH_PAGE_SIZE*/ 00072 00073 /* Define the Start of the application table if not defined in the header files. */ 00074 #ifndef APPTABLE_SECTION_START 00075 #error APPTABLE_SECTION_START must be defined if not defined in header files. 00076 # //#define APPTABLE_SECTION_START 0x01E000 //APPTABLE address for ATxmega128A1 00077 #endif /*APPTABLE_SECTION_START*/ 00078 00090 uint8_t SP_ReadByte(uint32_t address); 00091 00103 uint16_t SP_ReadWord(uint32_t address); 00104 00113 uint8_t SP_ReadCalibrationByte(uint8_t index); 00114 00123 uint8_t SP_ReadFuseByte(uint8_t index); 00124 00133 void SP_WriteLockBits(uint8_t data); 00134 00141 uint8_t SP_ReadLockBits(void); 00142 00151 uint8_t SP_ReadUserSignatureByte(uint16_t index); 00152 00157 void SP_EraseUserSignatureRow(void); 00158 00163 void SP_WriteUserSignatureRow(void); 00164 00172 void SP_EraseApplicationSections(void); 00173 00180 void SP_EraseApplicationPage(uint32_t address); 00181 00189 void SP_EraseWriteApplicationPage(uint32_t address); 00190 00200 void SP_WriteApplicationPage(uint32_t address); 00201 00209 void SP_LoadFlashWord(uint16_t address, uint16_t data); 00210 00220 void SP_LoadFlashPage(const uint8_t * data); 00221 00229 void SP_ReadFlashPage(const uint8_t * data, uint32_t address); 00230 00235 void SP_EraseFlashBuffer(void); 00236 00243 void SP_EraseBootPage(uint32_t address); 00244 00252 void SP_EraseWriteBootPage(uint32_t address); 00253 00263 void SP_WriteBootPage(uint32_t address); 00264 00269 uint32_t SP_ApplicationCRC(void); 00270 00275 uint32_t SP_BootCRC(void); 00276 00282 void SP_LockSPM(void); 00283 00288 void SP_WaitForSPM(void); 00289 00290 #endif /* SP_DRIVER_H */
Generated on Tue Jul 29 13:31:05 2008 for AVR1316 XMEGA Self programming by ![]() |