Skip to content

Commit

Permalink
Supported ATOMS3 Lite #1028
Browse files Browse the repository at this point in the history
  • Loading branch information
kitazaki authored and mkellner committed Feb 11, 2023
1 parent eb376d2 commit 918c6d2
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 1 deletion.
66 changes: 66 additions & 0 deletions build/devices/esp32/targets/atoms3_lite/host/provider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright (c) 2023 Moddable Tech, Inc.
*
* This file is part of the Moddable SDK Runtime.
*
* The Moddable SDK Runtime is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Moddable SDK Runtime is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
*
*/

import Analog from "embedded:io/analog";
import Digital from "embedded:io/digital";
import DigitalBank from "embedded:io/digitalbank";
import I2C from "embedded:io/i2c";
import PulseCount from "embedded:io/pulsecount";
import PulseWidth from "embedded:io/pulsewidth";
import PWM from "embedded:io/pwm";
import Serial from "embedded:io/serial";
import SMBus from "embedded:io/smbus";
import SPI from "embedded:io/spi";

const device = {
I2C: {
default: {
io: I2C,
data: 2,
clock: 1
},
internal: {
io: I2C,
data: 38,
clock: 39
}
},
SPI: {
default: {
io: SPI,
port: 3,
clock: 17,
out: 21
}
},
Analog: {
default: {
io: Analog,
pin: 8
}
},
io: {Analog, Digital, DigitalBank, I2C, PulseCount, PulseWidth, PWM, Serial, SMBus, SPI},
pin: {
button: 41,
}
};

export default device;

39 changes: 39 additions & 0 deletions build/devices/esp32/targets/atoms3_lite/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"build":{
"ESP32_SUBCLASS": "esp32s3",
"USE_USB": "1",
"SDKCONFIGPATH": "$(MODDABLE)/build/devices/esp32/targets/atoms3_lite/sdkconfig"
},
"include": [
"$(MODULES)/pins/smbus/manifest.json",
"$(MODULES)/pins/digital/manifest.json",
"$(MODULES)/pins/digital/monitor/manifest.json",
"$(MODULES)/drivers/button/manifest.json"
],
"modules": {
"*": [
"$(MODULES)/drivers/neopixel/*",
"$(MODULES)/drivers/neopixel/esp32/*",
"../m5stack_fire/m5button"
],
"setup/target": "./setup-target"
},
"preload": [
"setup/target",
"neopixel",
"m5button"
],
"defines": {
"i2c": {
"sda_pin": 38,
"scl_pin": 39
},
"neopixel": {
"length": 1,
"pin": 35,
"order": "#GRB",
"rmt_channel": "RMT_CHANNEL_0"
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
CONFIG_TINYUSB=y
CONFIG_TINYUSB_CDC_ENABLED=y

#
# Descriptor configuration
#
CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID=n
CONFIG_TINYUSB_DESC_USE_DEFAULT_PID=n
CONFIG_TINYUSB_DESC_CUSTOM_VID=0xbeef
CONFIG_TINYUSB_DESC_CUSTOM_PID=0x1cee
CONFIG_TINYUSB_DESC_BCD_DEVICE=0x0100
CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Moddable"
CONFIG_TINYUSB_DESC_PRODUCT_STRING="Moddable"
CONFIG_TINYUSB_DESC_SERIAL_STRING="123456"
CONFIG_TINYUSB_DESC_CDC_STRING="xsbug"
# end of Descriptor configuration

CONFIG_CONSOLE_UART_DEFAULT=y
CONFIG_CONSOLE_UART=y
CONFIG_CONSOLE_UART_NUM=0
CONFIG_CONSOLE_UART_BAUDRATE=115200

# CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"

CONFIG_ESP_SYSTEM_PANIC_GDBSTUB=n
CONFIG_ESP_COREDUMP_ENABLE_TO_UART=n
CONFIG_ESP_COREDUMP_ENABLE=n

36 changes: 36 additions & 0 deletions build/devices/esp32/targets/atoms3_lite/setup-target.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Digital from "pins/digital";
//import Monitor from "monitor";
import M5Button from "m5button";
import config from "mc/config";
import Timer from "timer";
import Button from "button";
import I2C from "pins/i2c";
import NeoPixel from "neopixel";

class Flash {
constructor(options) {
return new Button({
...options,
pin: 0,
invert: true
});
}
}

globalThis.Host = Object.freeze({
Button: {
Default: Flash,
Flash
}
}, true);

export default function (done) {
globalThis.button = {
a: new M5Button(41)
};

globalThis.lights = new NeoPixel({});

done();
}

Binary file added documentation/assets/devices/atoms3_lite.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion documentation/devices/esp32.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The Moddable SDK supports devices built on ESP32-S3. The following table lists e
| <img src="./../assets/devices/adafruit-qt-py-eps32-s3.png" width=125><BR>Adafruit QT Py ESP32-S3 | `esp32/qtpys3` | | <li>[Product page](https://www.adafruit.com/product/5426)</li> |
| <img src="./../assets/devices/adafruit-esp32-s3-tft-feather.png" width=125><BR>Adafruit ESP32-S3 TFT Feather | `esp32/s3_tft_feather` | 1.14" TFT display<BR> 240 x 135 16-bit color | <li>[Product page](https://www.adafruit.com/product/5483)</li>|
|<img src="./../assets/devices/atoms3.png" width=125><BR>AtomS3| `esp32/atoms3` | 0.85" IPS display<BR> 128 x 128 16-bit color<BR> 1 button<BR> IMU |<li>[Product page](https://docs.m5stack.com/en/core/AtomS3)</li>|

|<img src="./../assets/devices/atoms3_lite.png" width=125><BR>AtomS3 Lite| `esp32/atoms3_lite` | Neopixel, 1 button |<li>[Product page](https://docs.m5stack.com/en/core/AtomS3%20Lite)</li>|

<a id="platforms-esp32-c3"></a>
### ESP32-C3
Expand Down

0 comments on commit 918c6d2

Please sign in to comment.