DOCUMENTATION Overview
Overview
Getting Started
BASE
Reference
Worker
Setup modules
COMMODETTO
Reference
Poco Renderer
Outlines
Creating Fonts
Crypt
Data
DEVICES
Moddable One
Moddable Two
Moddable Three
Moddable Four
ESP32
ESP8266
nRF52
nRF52 Low Power Notes
Raspberry Pi Pico
M5Core Ink
M5Paper
Wasm
SiLabs Gecko
QCA4020
Moddable Zero
DISPLAYS
Overview
Adafruit 1.8" ST7735
Adafruit OLED Display
BuyDisplay 2.8" CTP - ESP8266
Crystalfontz ePaper
DotStar
Generic 1.44"
Generic 2.4" & 2.8" (Resistive Touch) - ESP32
Generic 2.4" & 2.8" (Resistive Touch) - ESP8266
Generic 2.4" & 2.8" (Resistive Touch) - Pico
Sharp Memory
Sharp Memory Screen 1.3"
SparkFun TeensyView
Switch Science Reflective LCD
DRIVERS
DESTM32S display
DotStar display
ILI9341 display
LPM013M126A display
LS013B4DN04 display
MCP230XX GPIO expander
NeoStrand
SSD1306 display
SSD1351 display
ST7735 display
Files
IO
TC53 IO
Firmata
NETWORK
Reference
TLS (SecureSocket)
BLE
Ethernet
Web Things
PINS
Reference
Audio Output
PIU
Reference
Localization
Keyboard
Expanding Keyboard
Die Cut
Using After Effects Motion Data
TOOLS
Reference
Manifest
Defines in Manifests
Testing
XS
Handle
JavaScript language considerations on embedded devices using the XS engine
Mods – User Installed Extensions
ROM Colors
Using XS Preload to Optimize Applications
XS Conformance
XS Marshalling
XS Platforms
XS in C
XS linker warnings
xsbug
xst
XS Compartment
XS Profiler

Moddable SDK – Documentation Overview

Copyright 2019-2023 Moddable Tech, Inc.
Revised: April 6, 2023

This directory contains documentation for the Moddable SDK.

Getting Started

The Getting Started Guide provides step-by-step instructions for installing, configuring, and building the Moddable SDK for macOS, Linux, and Windows. It also provides instructions for keeping the Moddable SDK tools and build environment up to date over time.

Guides for working with specific microcontrollers supported by the Moddable SDK are in the devices directory. These include links to additional detail for specific development boards including Moddable One, Moddable Two, Moddable Three, and Moddable Four.

API Documentation for Modules

The JavaScript APIs for the modules in the Moddable SDK are documented in the following files:

  • Base: Fundamental runtime capabilities including time, timer, debug, instrumentation, and UUID
    • Setup: Using setup modules to configure a host before other modules execute
    • Worker: Using Web Workers and Shared Workers
  • Commodetto: Bitmap graphics library including parsing and rendering of BMP, JPEG, and PNG images, and BMFont files; classes for operating on bitmaps, and pixel format conversion
    • Poco: Examples and reference for using the JavaScript and C APIs of the Poco renderer
  • Crypt: Cryptographic primitives
  • Data: Base64 and hex encoding and decoding
  • Files: Storage capabilities including files, flash, preferences, resources, and ZIP
  • Network: Network socket and protocols built on socket including HTTP, WebSockets, MQTT, mDMS, DNS, SNTP, telnet, and ping; also, Wi-Fi APIs
    • Secure socket: Using the TLS /SSL and managing certificates
    • BLE: Creating Bluetooth LE clients and servers, including a guide to examples
  • Pins: Hardware protocols including digital (GPIO), analog, PWM, I2C, SMBus, and servo
    • Audio out: Playing audio and adding audio data to projects
  • Piu: User interface framework
    • Die cut: Using complex clipping shapes with Piu
    • Expanding keyboard: Adding an animated expanding keyboard to Piu projects
    • Keyboard: Adding a touch keyboard to Piu projects
    • Localization: Using JSON data to efficiently localize Piu applications

XS JavaScript Engine

The xs directory contains documentation about the XS JavaScript engine.

  • ROM Colors: Optimization applied by the XS linker to improve look-up speed of properties of objects stored in ROM
  • XS Conformance: Detailed test results for XS from the test262 language test suite
  • XS Differences: Discussion of design considerations for implementing JavaScript for a resource constrained target
  • XS Platforms: Porting XS to a new host
  • XS in C: API to bridge between C and JavaScript code
  • XS linker warnings: Discussion of warnings given by the XS linker when preparing code to be stored in ROM
  • Handle: How native implementations of JavaScript classes can reduce memory fragmentation
  • Mods: Working with archives of precompiled JavaScript modules (mods)
  • Preload: Reducing memory use and start-up time of JavaScript modules
  • xsbug: Using xsbug, the source-level debugger for XS
  • xst: Using xst, the command line tool for running test262 conformance tests

Developer Tools

The tools directory contains documentation for developer tools.

  • Tools: Command line build tools including mcconfig, mcrez, png2bmp, xsc, xsl, and desktop simulator
  • Manifest: Explanation of the JSON manifest files used to configure the build of projects
  • Defines: Using the project manifest to configure native code options