7 #ifndef FIB_BOOTLOADER_H_
8 #define FIB_BOOTLOADER_H_
13 #define FIB_RESET_GO_ZERO 0xF00F0100
15 #define FIB_RESET_GO_JUMP 0xF00F0110
16 #define FIB_RESET_BAUD_RATE 0xF00F0111
17 #define FIB_RESET_READ_UNPROTECT 0xF00F0112
18 #define FIB_RESET_GPIO_BOOTMODE 0xF00F0113
19 #define FIB_RESET_PART_DATA 0xF00F0114
20 #define FIB_RESET_NMI_HARD_FAULT 0xF00F0115
25 typedef uint32_t FibStatus;
28 #define FIB_ERR_UNALIGNED 1
29 #define FIB_ERR_INVALID_ADDRESS 2
30 #define FIB_ERR_INVALID_TYPE 3
31 #define FIB_ERR_WRITE_PROTECTED 4
32 #define FIB_ERR_WRITE_FAILED 5
33 #define FIB_ERR_ERASE_REQUIRED 6
34 #define FIB_ERR_VERIFY_FAILED 7
39 typedef uint32_t FibEraseType;
41 #define MFB_MASS_ERASE 0x01
42 #define MFB_PAGE_ERASE 0x02
43 #define CIB_ERASE 0x03
45 #define DO_ERASE 0x0100
46 #define DO_VERIFY 0x0200
51 FibStatus fibFlashWrite(uint32_t address, uint8_t *data,
52 uint32_t writeLength, uint32_t verifyLength);
54 FibStatus fibFlashErase(FibEraseType eraseType, uint32_t address);
56 #endif //FIB_BOOTLOADER_H_