forked from espruino/Espruino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ESP8266_BOARD.py
160 lines (155 loc) · 4.71 KB
/
ESP8266_BOARD.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <[email protected]>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# ----------------------------------------------------------------------------------------
# This file contains information for a specific board - the available pins, and where LEDs,
# Buttons, and other in-built peripherals are. It is used to build documentation as well
# as various source and header files for Espruino.
# ----------------------------------------------------------------------------------------
import pinutils;
info = {
'name' : "ESP8266",
'espruino_page_link' : 'EspruinoESP8266',
'default_console' : "EV_SERIAL1",
'default_console_baudrate' : "115200",
'variables' : 1700,
'binary_name' : 'espruino_%v_esp8266',
'build' : {
'libraries' : [
'NET',
'TELNET',
#'GRAPHICS',
'CRYPTO',
'NEOPIXEL',
],
'makefile' : [
'DEFINES+=-DSAVE_ON_FLASH_MATH',
'USE_DEBUGGER=0', # We can't use debugger as RTOS needs jsiIdle to keep exiting
]
}
};
chip = {
'part' : "ESP8266",
'family' : "ESP8266",
'package' : "",
'ram' : 80,
'flash' : 0,
'speed' : 160,
'usart' : 2,
'spi' : 1,
'i2c' : 1,
'adc' : 1,
'dac' : 0,
'saved_code' : {
'address' : 0x77000,
'page_size' : 4096,
'pages' : 4,
'flash_available' : 468, # firmware can be up to this size
},
};
devices = {
};
# left-right, or top-bottom order
board_esp12 = {
'top' : ['D1', 'D3', 'D5', 'D4', 'D0', 'D2', 'D15', 'GND'],
'bottom' : ['VCC', 'D13', 'D12', 'D14', 'D16', 'CH_EN', 'A0', 'RESET'],
'right' : ['D11', 'D8', 'D9', 'D10', 'D7', 'D6'],
};
board_esp12["bottom"].reverse()
board_esp12["right"].reverse()
board_esp12["_css"] = """
#board {
width: 600px;
height: 384px;
left: 50px;
top: 100px;
background-image: url(img/ESP8266_12.jpg);
}
#boardcontainer {
height: 600px;
}
#board #right {
top: 60px;
left: 600px;
}
#board #top {
bottom: 360px;
left: 195px;
}
#board #bottom {
top: 365px;
left: 195px;
}
#board .rightpin {
height: 48px;
}
#board .toppin, #board .bottompin {
width: 44px;
}
""";
# left-right, or top-bottom order
board_esp01 = {
'left' : ['D3', 'D0', 'D2', 'GND'],
'right' : ['VCC', 'RESET', 'CH_PD', 'D1'],
'_hide_not_on_connectors' : True
};
board_esp01["_css"] = """
#board {
width: 500px;
height: 299px;
left: 50px;
top: 0px;
background-image: url(img/ESP8266_01.jpg);
}
#boardcontainer {
height: 300px;
}
#board #right {
top: 30px;
left: 200px;
}
#board #left {
top: 65px;
right: 80px;
}
#board #right {
top: 65px;
left: 460px;
}
#board .leftpin {
height: 48px;
}
#board .rightpin {
height: 48px;
}
""";
boards = [ board_esp12, board_esp01 ];
def get_pins():
# add pins D0 .. D16,A0
pins = [
{ "name":"PD0", "sortingname":"D00", "port":"D", "num":"0", "functions":{"LED_1":0}, "csv":{} },
{ "name":"PD1", "sortingname":"D01", "port":"D", "num":"1", "functions":{"USART1_TX":0}, "csv":{} },
{ "name":"PD2", "sortingname":"D02", "port":"D", "num":"2", "functions":{"USART2_TX":0}, "csv":{} },
{ "name":"PD3", "sortingname":"D03", "port":"D", "num":"3", "functions":{"USART1_RX":0}, "csv":{} },
{ "name":"PD4", "sortingname":"D04", "port":"D", "num":"4", "functions":{}, "csv":{} },
{ "name":"PD5", "sortingname":"D05", "port":"D", "num":"5", "functions":{}, "csv":{} },
{ "name":"PD6", "sortingname":"D06", "port":"D", "num":"6", "functions":{}, "csv":{} },
{ "name":"PD7", "sortingname":"D07", "port":"D", "num":"7", "functions":{}, "csv":{} },
{ "name":"PD8", "sortingname":"D08", "port":"D", "num":"8", "functions":{}, "csv":{} },
{ "name":"PD9", "sortingname":"D09", "port":"D", "num":"9", "functions":{}, "csv":{} },
{ "name":"PD10", "sortingname":"D10", "port":"D", "num":"10", "functions":{}, "csv":{} },
{ "name":"PD11", "sortingname":"D11", "port":"D", "num":"11", "functions":{}, "csv":{} },
{ "name":"PD12", "sortingname":"D12", "port":"D", "num":"12", "functions":{}, "csv":{} },
{ "name":"PD13", "sortingname":"D13", "port":"D", "num":"13", "functions":{}, "csv":{} },
{ "name":"PD14", "sortingname":"D14", "port":"D", "num":"14", "functions":{}, "csv":{} },
{ "name":"PD15", "sortingname":"D15", "port":"D", "num":"15", "functions":{}, "csv":{} },
{ "name":"PD16", "sortingname":"D16", "port":"D", "num":"16", "functions":{}, "csv":{} },
{ "name":"PA0", "sortingname":"A00", "port":"A", "num":"17", "functions":{ "ADC1_IN0":0 }, "csv":{} }
]
return pins;