Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
rboot-private.h
1 #ifndef __RBOOT_PRIVATE_H__
2 #define __RBOOT_PRIVATE_H__
3 
5 // rBoot open source boot loader for ESP8266.
6 // Copyright 2015 Richard A Burton
7 // richardaburton@gmail.com
8 // See license.txt for license terms.
10 
11 typedef int int32;
12 typedef unsigned int uint32;
13 typedef unsigned char uint8;
14 
15 #include <rboot.h>
16 
17 #define NOINLINE __attribute__ ((noinline))
18 
19 #define ROM_MAGIC 0xe9
20 #define ROM_MAGIC_NEW1 0xea
21 #define ROM_MAGIC_NEW2 0x04
22 
23 #define TRUE 1
24 #define FALSE 0
25 
26 // buffer size, must be at least 0x10 (size of rom_header_new structure)
27 #define BUFFER_SIZE 0x100
28 
29 // esp8266 built in rom functions
30 extern uint32 SPIRead(uint32 addr, void *outptr, uint32 len);
31 extern uint32 SPIEraseSector(int);
32 extern uint32 SPIWrite(uint32 addr, void *inptr, uint32 len);
33 extern void ets_printf(char*, ...);
34 extern void ets_delay_us(int);
35 extern void ets_memset(void*, uint8, uint32);
36 extern void ets_memcpy(void*, const void*, uint32);
37 
38 // functions we'll call by address
39 typedef void stage2a(uint32);
40 typedef void usercode(void);
41 
42 // standard rom header
43 typedef struct {
44  // general rom header
45  uint8 magic;
46  uint8 count;
47  uint8 flags1;
48  uint8 flags2;
49  usercode* entry;
50 } rom_header;
51 
52 typedef struct {
53  uint8* address;
54  uint32 length;
56 
57 // new rom header (irom section first) there is
58 // another 8 byte header straight afterward the
59 // standard header
60 typedef struct {
61  // general rom header
62  uint8 magic;
63  uint8 count; // second magic for new header
64  uint8 flags1;
65  uint8 flags2;
66  uint32 entry;
67  // new type rom, lib header
68  uint32 add; // zero
69  uint32 len; // length of irom section
71 
72 #endif
Definition: rboot-private.h:52
Definition: rboot-private.h:43
Definition: rboot-private.h:60