u16 ProgramAtmelFlashSector(u32 sector, const u8 *source)
Programs a small Atmel sector with interrupts disabled, then polls its last byte.
u16 EraseAtmelFlashSector(u16 sector)
Erases one small Atmel sector by programming every byte to 0xff.
u16 EraseAtmelFlashBlock(u16 sector)
Erases thirty-two small sectors, trying each sector at most twice.
u16 EraseAtmelFlashChip(void)
Erases the Atmel chip and waits for completion with its configured timing.
u16 ProgramAtmelFlashBlock(u16 sector, u8 *source)
Programs an Atmel block in small sectors, trying each sector at most twice.
void StopFlashTimer(void)
Stops the flash timer and restores the saved interrupt-enable state.
u16 WaitForFlashWrite(u8 timingIndex, volatile u8 *address, u8 expected)
Polls for the expected byte until success or timeout, returning an operation error.
u8 * VerifyFlashCore(u8 *left, u8 *right, u16 size)
Returns the first differing byte in the right buffer, or NULL when all bytes match.
s32 ReadFlashId(void)
Enters flash ID mode, waits for the chip and reads its device and manufacturer IDs.
s32 SetFlashTimerIntr(u8 timerIndex, void(**callback)(void))
Selects a hardware timer and returns its timeout interrupt callback.
void FlashTimerIntr(void)
Counts down the active flash timeout and marks its expiration.
void ReadFlash(u16 sector, u32 offset, u8 *destination, s32 size)
Copies the RAM reader and reads a range using the standard sector geometry.
void CopyFlashReadRoutineToRam(void *destination)
Copies the byte reader to RAM and installs its Thumb entry point.
s32 Flash_VerifySector(u16 sector, s32 source)
Copies the verifier to RAM and compares a standard flash sector with source data.
void ReadFlashCore(const u8 *source, u8 *destination, u32 size)
Copies flash bytes into RAM; this routine executes from a RAM copy.
u8 ReadFlashByte(u8 *source)
Reads one byte; copied into RAM so the cartridge can be polled during a write.
s32 IdentifyFlash(void)
Selects matching chip handlers, falling back to the final table entry when unknown.
u8(*) gFlashReadRoutine(u8 *source)
u16 ProgramFlashSector(u16 sector, u8 *source)
Erases a standard sector and programs bytes until completion or an error.
u16 ProgramFlashSectorWithEraseRetry(u16 sector, u8 *source)
Erases and verifies a sector with retries, then programs its bytes.
u16 EraseFlashSector(u16 sector)
Erases one of sixteen sectors, restoring the cartridge wait setting afterward.
u16 ProgramFlashByte(u8 *source, u8 *destination)
Issues a byte-program command and waits for its destination to match.
u16 EraseFlashChip(void)
Issues the chip-erase command and waits for an erased byte.
The integer types, TRUE, UNUSED and the fixed-address macros.