Go to the documentation of this file.00001 #ifndef _DEV_AVRTARGET_H_
00002 #define _DEV_AVRTARGET_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include <cfg/progif.h>
00037 #include <stdint.h>
00038
00060 #ifndef AVRTARGET_PAGESIZE
00061
00066 #define AVRTARGET_PAGESIZE 128
00067 #endif
00068
00069
00070
00071
00072 #define AVRSIGNATURE_MEGA8 0x001E9307UL
00073 #define AVRSIGNATURE_MEGA168 0x001E9406UL
00074 #define AVRSIGNATURE_MEGA103 0x001E9701UL
00075 #define AVRSIGNATURE_MEGA128 0x001E9702UL
00076 #define AVRSIGNATURE_MEGA1280 0x001E9703UL
00077 #define AVRSIGNATURE_MEGA1281 0x001E9704UL
00078 #define AVRSIGNATURE_90CAN128 0x001E9781UL
00079 #define AVRSIGNATURE_MEGA2560 0x001E9801UL
00080 #define AVRSIGNATURE_MEGA2561 0x001E9802UL
00081
00082
00083
00084
00085 #define AVRCMD_PROG_ENABLE 0xAC530000UL
00086 #define AVRCMD_CHIP_ERASE 0xAC800000UL
00087 #define AVRCMD_READ_PROG_MEM_LO 0x20000000UL
00088 #define AVRCMD_READ_PROG_MEM_HI 0x28000000UL
00089 #define AVRCMD_LOAD_PROG_MEM_PAGE_LO 0x40000000UL
00090 #define AVRCMD_LOAD_PROG_MEM_PAGE_HI 0x48000000UL
00091 #define AVRCMD_WRITE_PROG_MEM_PAGE 0x4c000000UL
00092 #define AVRCMD_LOAD_EXT_ADDR_BYTE 0x4d000000UL
00093 #define AVRCMD_READ_EEPROM_MEM 0xA0000000UL
00094 #define AVRCMD_WRITE_EEPROM_MEM 0xC0000000UL
00095 #define AVRCMD_LOAD_EEPROM_MEM_PAGE 0xC1000000UL
00096 #define AVRCMD_WRITE_EEPROM_MEM_PAGE 0xC2000000UL
00097 #define AVRCMD_READ_LOCK_BITS 0x58000000UL
00098 #define AVRCMD_WRITE_LOCK_BITS 0xACE00000UL
00099 #define AVRCMD_READ_SIGNATURE_BYTE 0x30000000UL
00100 #define AVRCMD_WRITE_FUSE_BITS 0xACA00000UL
00101 #define AVRCMD_WRITE_FUSE_HI_BITS 0xACA80000UL
00102 #define AVRCMD_WRITE_FUSE_EXT_BITS 0xACA40000UL
00103 #define AVRCMD_READ_FUSE_BITS 0x50000000UL
00104 #define AVRCMD_READ_FUSE_HI_BITS 0x58080000UL
00105 #define AVRCMD_READ_FUSE_EXT_BITS 0x50080000UL
00106 #define AVRCMD_READ_CALIBRATION_BYTE 0x38000000UL
00107 #define AVRCMD_POLL_READY 0xF0000000UL
00108
00109 __BEGIN_DECLS
00110
00111 extern int AvrTargetInit(void);
00112 extern void AvrTargetSelect(ureg_t act);
00113 extern void AvrTargetReset(ureg_t on);
00114 extern uint32_t AvrTargetCmd(uint32_t cmd);
00115 extern uint32_t AvrTargetSignature(void);
00116 extern uint32_t AvrTargetFusesRead(void);
00117 extern uint32_t AvrTargetFusesWriteSafe(uint32_t fuses);
00118 extern int AvrTargetProgEnable(void);
00119 extern int AvrTargetPollReady(unsigned int tmo);
00120 extern int AvrTargetChipErase(void);
00121 extern void AvrTargetPageLoad(uint32_t page, CONST uint8_t * data);
00122 extern int AvrTargetPageWrite(uint32_t page);
00123 extern int AvrTargetPageVerify(uint32_t page, CONST uint8_t * data);
00124
00125 __END_DECLS
00126
00127 #endif