|
| 1 | +#!/bin/false |
| 2 | +# This file is part of Espruino, a JavaScript interpreter for Microcontrollers |
| 3 | +# |
| 4 | +# Copyright (C) 2013 Gordon Williams <[email protected]> |
| 5 | +# |
| 6 | +# This Source Code Form is subject to the terms of the Mozilla Public |
| 7 | +# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 8 | +# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 9 | +# |
| 10 | +# ---------------------------------------------------------------------------------------- |
| 11 | +# This file contains information for a specific board - the available pins, and where LEDs, |
| 12 | +# Buttons, and other in-built peripherals are. It is used to build documentation as well |
| 13 | +# as various source and header files for Espruino. |
| 14 | +# ---------------------------------------------------------------------------------------- |
| 15 | + |
| 16 | +# ########################################################### |
| 17 | +# # THIS IS BETA - IDF4 SUPPORT IS NOT READY YET # |
| 18 | +# ########################################################### |
| 19 | + |
| 20 | +# A Note about the 'variables' parameter on ESP32 Builds |
| 21 | +# ------------------------------------------------------ |
| 22 | +# |
| 23 | +# For the ESP32 build, the number of JsVars is governed by two factors: |
| 24 | +# * Available memory |
| 25 | +# * Maximum number of JsVars for the used JsVar format |
| 26 | +# |
| 27 | +# This setting will chose the optimum JsVar format for a given number |
| 28 | +# of JsVars. |
| 29 | + |
| 30 | +# If you add PSRAM to your ESP32 or compile with modules removed, you |
| 31 | +# may wish to select a value using this table: |
| 32 | +# |
| 33 | +# Value | Max JsVars | Bytes per JsVar | Maximum References | |
| 34 | +# ------+--------------+-----------------+--------------------+ |
| 35 | +# 4095 | 4095 | 13 | 255 | |
| 36 | +# 8191 | 8191 | 13 | 15 | |
| 37 | +# 16383 | 16383 | 14 | 255 | |
| 38 | +# 65535 | 65535 | 16 | 255 | |
| 39 | +# ------+--------------+-----------------+--------------------+ |
| 40 | + |
| 41 | +# CAUTION: Chosing 8191 only allows 15 references to a variable. This |
| 42 | +# may be too restrictive to run some code. |
| 43 | + |
| 44 | +# Using too large a JsVar format may limit how many JsVars can fit into |
| 45 | +# available memory. Using too small a JsVar format will under utilise |
| 46 | +# available memory. |
| 47 | + |
| 48 | + |
| 49 | +import pinutils; |
| 50 | +info = { |
| 51 | + 'name' : "ESP32S3", |
| 52 | + 'espruino_page_link' : 'ESP32', |
| 53 | + 'default_console' : "EV_SERIAL1", |
| 54 | + 'default_console_baudrate' : "115200", |
| 55 | + 'variables' : 16383, # See note above |
| 56 | + 'io_buffer_size' : 1024, # How big is the input buffer (in 4 byte words). Default is 256, but this makes us less likely to drop data |
| 57 | + 'binary_name' : 'espruino_%v_esp32s3.bin', |
| 58 | + 'build' : { |
| 59 | + 'optimizeflags' : '-Og', |
| 60 | + 'libraries' : [ |
| 61 | + 'ESP32', |
| 62 | + 'NET', |
| 63 | + 'GRAPHICS', |
| 64 | + 'CRYPTO','SHA256','SHA512', |
| 65 | + 'TLS', |
| 66 | + 'TELNET', |
| 67 | + 'NEOPIXEL', |
| 68 | + 'FILESYSTEM', |
| 69 | +# 'FLASHFS', |
| 70 | + 'BLUETOOTH' |
| 71 | + ], |
| 72 | + 'makefile' : [ |
| 73 | + 'DEFINES+=-DESP_PLATFORM -DESP32=1', |
| 74 | + 'DEFINES+=-DESP_STACK_SIZE=25000', |
| 75 | + 'DEFINES+=-DJSVAR_MALLOC', # Allocate space for variables at jsvInit time |
| 76 | + 'DEFINES+=-DUSE_FONT_6X8', |
| 77 | + 'ESP32_FLASH_MAX=1572864' |
| 78 | + ] |
| 79 | + } |
| 80 | +}; |
| 81 | + |
| 82 | +chip = { |
| 83 | + 'part' : "ESP32S3", |
| 84 | + 'family' : "ESP32_IDF4", |
| 85 | + 'package' : "", |
| 86 | + 'ram' : 512, |
| 87 | + 'flash' : 0, |
| 88 | + 'speed' : 240, |
| 89 | + 'usart' : 3, |
| 90 | + 'spi' : 2, |
| 91 | + 'i2c' : 2, |
| 92 | + 'adc' : 2, |
| 93 | + 'dac' : 0, |
| 94 | + 'saved_code' : { |
| 95 | + 'address' : 0x320000, |
| 96 | + 'page_size' : 4096, |
| 97 | + 'pages' : 64, |
| 98 | + 'flash_available' : 1344, # firmware can be up to this size - see partitions_espruino.csv |
| 99 | + }, |
| 100 | +}; |
| 101 | +devices = { |
| 102 | + 'LED1' : { 'pin' : 'D2' }, |
| 103 | + 'BTN1' : { 'pin' : 'D0', "inverted":1, 'pinstate' : 'IN_PULLUP' } |
| 104 | +}; |
| 105 | + |
| 106 | +# left-right, or top-bottom order |
| 107 | +board_esp32 = { |
| 108 | + 'top' : ['GND','D23','D22','D1','D3','D21','D20','D19','D18','D5','D17','D16','D4','D0'], |
| 109 | + 'bottom' : ['D12','D14','D27','D26','D25','D33','D32','D35','D34','D39','D36','EN','3V3','GND'], |
| 110 | + 'right' : [ 'GND','D13','D9','D10','D11','D6','D7','D8','D15','D2'] |
| 111 | +}; |
| 112 | +board_esp32["bottom"].reverse() |
| 113 | +board_esp32["right"].reverse() |
| 114 | +board_esp32["_css"] = """ |
| 115 | +#board { |
| 116 | + width: 600px; |
| 117 | + height: 435px; |
| 118 | + left: 50px; |
| 119 | + top: 170px; |
| 120 | + background-image: url(img/ESP32.jpg); |
| 121 | +} |
| 122 | +#boardcontainer { |
| 123 | + height: 700px; |
| 124 | +} |
| 125 | +#board #right { |
| 126 | + top: 80px; |
| 127 | + left: 600px; |
| 128 | +} |
| 129 | +#board #top { |
| 130 | + bottom: 440px; |
| 131 | + left: 155px; |
| 132 | +} |
| 133 | +#board #bottom { |
| 134 | + top: 435px; |
| 135 | + left: 155px; |
| 136 | +} |
| 137 | +#board .rightpin { |
| 138 | + height: 28px; |
| 139 | +} |
| 140 | +#board .toppin, #board .bottompin { |
| 141 | + width: 24px; |
| 142 | +} |
| 143 | +"""; |
| 144 | + |
| 145 | +boards = [ board_esp32 ]; |
| 146 | + |
| 147 | +def get_pins(): |
| 148 | + pins = pinutils.generate_pins(0,39) # 40 General Purpose I/O Pins. |
| 149 | + |
| 150 | + # everything is non-5v tolerant |
| 151 | + #for pin in pins: |
| 152 | + # pin["functions"]["3.3"]=0; |
| 153 | + return pins |
0 commit comments