SingingCat 0
application
esp8266_flash.h
1#ifndef ESP_FLASH_H_
2#define ESP_FLASH_H_ 1
3
4#include "main-header.h"
5
6#define ESP_FLASH_BEGIN 0x02
7#define ESP_FLASH_DATA 0x03
8#define ESP_FLASH_END 0x04
9#define ESP_MEM_BEGIN 0x05
10#define ESP_MEM_END 0x06
11#define ESP_MEM_DATA 0x07
12#define ESP_SYNC 0x08
13#define ESP_WRITE_REG 0x09
14#define ESP_READ_REG 0x0a
15
16#define ESP_FLASH_BLOCK_SIZE 0x100
17#define ESP_CHECKSUM_MAGIC 0xef
18
19typedef struct espflash_response {
20 byte command;
21 byte status;
22 byte error;
23 byte reserved;
24 int size;
25 long value;
27
28int espflash_sync();
29int espflash_prepare(const void *targetadr, const int size);
30int espflash_finish();
31int espflash_write_block(const int seqnum, const byte *data);
32void espflash_settimeout(const int timeo);
33long esp_flash_checksum(const byte *data);
34int espflash_read_register(long regnum, long *result);
35void espflash_set_baud(int baud);
36#endif