1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef __BOOTLOAD_H__
- #define __BOOTLOAD_H__
- typedef unsigned char byte;
- #define BL_PACKET_LEN 64
- #define BL_HEADER_LEN 5
- #define BL_DATA_LEN (BL_PACKET_LEN - BL_HEADER_LEN)
- enum {
- READ_VERSION = 0x00,
- READ_FLASH = 0x01,
- WRITE_FLASH = 0x02,
- ERASE_FLASH = 0x03,
- READ_EEDATA = 0x04,
- WRITE_EEDATA = 0x05,
- READ_CONFIG = 0x06,
-
- WRITE_CONFIG = 0x07,
- UPDATE_LED = 0x32,
- RESET = 0xFF
- };
- typedef union _bl_packet {
- byte _byte[64];
- struct {
- byte command;
- byte len;
- struct {
- byte low;
- byte high;
- byte upper;
- } address;
- byte data[BL_DATA_LEN];
- };
- } bl_packet;
- #endif
|