Skip to content

Commit

Permalink
esp32: explain "dependency"
Browse files Browse the repository at this point in the history
  • Loading branch information
mkellner committed Sep 13, 2024
1 parent 1f9351b commit ca7e95b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/devices/moddable-six.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 31 additions & 5 deletions documentation/devices/esp32.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Using the Moddable SDK with ESP32
Copyright 2016-2024 Moddable Tech, Inc.<BR>
Revised: August 8, 2024
Revised: September 13, 2024

This document provides a guide to building apps for the ESP32 line of SoCs from Espressif. The Moddable SDK supports [ESP32](https://www.espressif.com/en/products/socs/esp32), [ESP32-S2](https://www.espressif.com/en/products/socs/esp32-s2), [ESP32-S3](https://www.espressif.com/en/products/socs/esp32-s3), [ESP32-C3](https://www.espressif.com/en/products/socs/esp32-c3), [ESP32-C6](https://www.espressif.com/en/products/socs/esp32-c6), and [ESP32-H2](https://www.espressif.com/en/products/socs/esp32-h2).

Expand Down Expand Up @@ -31,6 +31,7 @@ This document provides a guide to building apps for the ESP32 line of SoCs from
* [Build configuration](#usb_build)
* [TinyUSB](#usb_tinyusb) (esp32s2, esp32s3)
* [Serial-JTAG](#usb_serial_jtag) (esp32s3, esp32c3, esp32c6, esp32h2)
* [Using ESP Registry components](#idf-components)


<a id="overview"></a>
Expand Down Expand Up @@ -131,7 +132,9 @@ ESP32-S3 is the successor to the original ESP32. It has the following features:
The Moddable SDK supports devices built on ESP32-S3. The following table lists each device, its platform identifier, a list of key features specific to the device, and links to additional resources.

| Name | Platform identifier | Key features | Links |
| :---: | :--- | :--- | :--- |
| :---: | :--- | :--- | :--- |
| <img src="./../assets/devices/moddable-six.png" width=125><BR>Moddable Six | `esp32/moddable_six`<BR>`esp32/moddable_six_cdc`<br>`simulator/moddable_six` | **2.4" IPS display**<BR>240 x 320 QVGA<BR>16-bit color<BR>8-bit parallel display bus<BR>Capacitive touch<BR>Neopixel<BR>Qwiic connector<BR>Optional speaker<br><BR>20 External pins | <li>[Moddable Six developer guide](./moddable-six.md)</li><li>[Moddable product page](https://www.moddable.com/hardware)</li> |
| <img src="./../assets/devices/moddable-display-6.png" width=125><BR>Moddable Display 2 | `esp32/moddable_display_6`<BR>`simulator/moddable_six` | **2.4" IPS display**<BR>240 x 320 QVGA<BR>16-bit color<BR>8-bit parallel display bus<BR>Capacitive touch<BR>Neopixel<BR>Qwiic connector<BR>Optional speaker<br><BR>20 External pins | <li>[Moddable Display developer guide](./moddable-display.md)</li><li>[Moddable product page](https://www.moddable.com/hardware)</li> |
| <img src="https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/_images/esp32-s3-devkitc-1-v1.1-isometric.png" width=125><BR>ESP32-S3-DevKitC-1-N8 | `esp32/esp32s3` | |<li>[Product page](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html)</li> |
| <img src="./../assets/devices/adafruit-qt-py-eps32-s3.png" width=125><BR>Adafruit QT Py ESP32-S3 | `esp32/qtpys3` | Neopixel, 1 button, STEMMA/QWIIC | <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/feather_s3_tft` | 1.14" TFT display<BR> 240 x 135 16-bit color | <li>[Product page](https://www.adafruit.com/product/5483)</li>|
Expand Down Expand Up @@ -1054,7 +1057,7 @@ Done

After you press __Reset__ on the device, the device will restart and connect to `xsbug`.

These devices use this technique:
These are some of the devices use this technique:

| Platform | Device |
| :---: | :--- |
Expand Down Expand Up @@ -1083,15 +1086,38 @@ Build your application:

`mcconfig -d -m -p esp32/esp32s3_cdc`

These devices use this technique:
These are some of the devices use this technique:

| Platform | Device |
| :---: | :--- |
| :---: | :--- |
| `esp32/moddable_six_cdc` | Moddable Six |
| `esp32/c3_devkit_rust` | Espressif C3 DevKit Rust |
| `esp32/esp32c3_cdc` | Espressif C3 DevKitM |
| `esp32/esp32s3_cdc` | Espressif ESP32-S3-DevKitC |
| `esp32/qtpyc3` | Adafruit QT Py C3 |
| `esp32/xiao_esp32c3` | Seeed Xiao ESP32C3 |


<a id="idf-components"></a>

## Using ESP Registry components

The [ESP Component Registry](https://components.espressif.com/) contains many components and libraries for the Espressif devices.

You can write modules that expose the functionality of these components to your JavaScript modules.

Add a `dependency` property in the `platforms`:`esp32` section of the manifest:

```json
"platforms": {
"esp32": {
"dependency": [
{ "name": "onewire_bus", "version": "^1.0.2" }
]
}
}
```

The library and include files from the dependencies will be loaded from the ESP Registry automatically and made available to your project. You can then write your module with a native part to interface with the component.

The [onewire module](https://github.com/Moddable-OpenSource/moddable/tree/public/modules/drivers/onewire) demonstrates the use of `dependency`.
25 changes: 23 additions & 2 deletions documentation/tools/manifest.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Manifest
Copyright 2017-2023 Moddable Tech, Inc.<BR>
Revised: August 3, 2023
Copyright 2017-2024 Moddable Tech, Inc.<BR>
Revised: September 13, 2024

A manifest is a JSON file that describes the modules and resources necessary to build a Moddable app. This document explains the properties of the JSON object and how manifests are processed by the Moddable SDK build tools.

Expand Down Expand Up @@ -614,6 +614,25 @@ For example, if the `platforms` object of a manifest is as follows, building for
}
```

The `esp32` platform has an additional property `dependency` which can be used to [add ESP Registry components](../devices/esp32/manifest.md#idf-components) to your project.

```json
"platforms": {
"esp32": {
"dependency": [
{ "name": "onewire_bus", "version": "^1.0.2" },
{ "namespace": "waveshare", "name": "esp_lcd_jd9365_8", "version": "^0.0.2" }
]
}
}
```

`namespace` is optional and defaults to `espressif`.

The library and include files from the dependencies will be loaded from the ESP Registry and made available to you. You can then write your module with a native part to interface with the component.

The [onewire module](https://github.com/Moddable-OpenSource/moddable/tree/public/modules/drivers/onewire) demonstrates the use of `dependency`.

<a id="subplatforms"></a>
#### Subplatforms

Expand Down Expand Up @@ -660,6 +679,8 @@ The `SUBPLATFORM` variable is automatically defined by `mcconfig`. A wildcard is
}
}
```


***

<a id="bundle"></a>
Expand Down

0 comments on commit ca7e95b

Please sign in to comment.