Skip to content

Commit 862dadd

Browse files
committed
version 7.0.0, zephyr io config
1 parent 0d4ab31 commit 862dadd

File tree

2 files changed

+59
-3
lines changed

2 files changed

+59
-3
lines changed

documentation/devices/zephyr.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@
33
Copyright 2026 Moddable Tech, Inc.<BR>
44
Updated: January 13, 2026
55

6-
This document is a guide to building apps with the Zephyr SDK.
6+
This document is a guide to building Moddable apps with the Zephyr SDK.
77

88
## Table of Contents
99

1010
* [Overview](#overview)
11+
* [Platforms](#platforms)
12+
* [zephyr](#platforms-zephyr)
1113
* [Build Types](#builds)
1214
* [Debug](#build-debug)
1315
* [Instrumented](#build-instrumented)
1416
* [Release](#build-release)
1517
* Setup instructions
18+
1619
| [![Apple logo](./../assets/moddable/mac-logo.png)](#mac) | [![Windows logo](./../assets/moddable/win-logo.png)](#win) | [![Linux logo](./../assets/moddable/lin-logo.png)](#lin) |
1720
| :--- | :--- | :--- |
1821
| • [Installing](#mac-instructions)<BR>• [Troubleshooting](#mac-troubleshooting) | • [Installing](#win-instructions)<BR>• [Troubleshooting](#win-troubleshooting) | • [Installing](#lin-instructions)<BR>• [Troubleshooting](#lin-troubleshooting)
1922
* [Using Zephyr Device Tree in JavaScript](#devicetree)
2023
* [Debugging Native Code](#debugging-native-code)
2124
* [Adding a new board](#new-board)
25+
* [IO Connfiguration](#io-config)
2226

2327
<a id="overview"></a>
2428
## Overview
@@ -70,7 +74,7 @@ Omitting both the `-d` and `-i` options on the `mcconfig` command line selects a
7074
<a id="mac"></a>
7175
## macOS
7276

73-
The Moddable SDK build uses Zephyr SDK v4.2.0-rc1 (commit `ffb28eed`).
77+
The Moddable SDK build uses Zephyr SDK v4.3 or later.
7478

7579
<a id="mac-instructions"></a>
7680
### Installing
@@ -421,3 +425,55 @@ To add new board to Moddable:
421425
cd $MODDABLE/examples/helloworld
422426
mcconfig -d -m -p zephyr/new_board
423427
```
428+
429+
<a id="io-config"></a>
430+
## IO Configuration
431+
432+
Zephyr uses .dts files files to define hardware IO configuration.
433+
Moddable uses .overlay files specified in the `zephyrOverlay` section of `manifest.json`.
434+
435+
The Nordic [`nrf52840dk` device]( ../../build/devices/zephyr/targets/nrf52840dk/manifest.json) device manifest demonstrates:
436+
437+
"zephyrOverlay": [
438+
"./analog.overlay",
439+
"./pwm.overlay"
440+
],
441+
442+
### `analog`
443+
444+
Use `port` and `channel` to choose which analog channel to sample from. Different devices may use a different port naming schemes.
445+
446+
const analogInput = new device.io.Analog({
447+
port: "adc",
448+
channel: 0
449+
});
450+
451+
### `digital`
452+
453+
Use an object with `port` and `pin` to describe the pin of a Digital object.
454+
455+
const led = new device.io.Digital({
456+
...options,
457+
pin: {port: "gpioe", pin: 1},
458+
mode: Digital.Output,
459+
});
460+
461+
### `pwm`
462+
463+
Use `port` and `channel` to specify what zephyr configuration to use. You can also specify the frequncy by the `hz` property, and resolution (in number of bits) with the `resolution` property.
464+
465+
const led1 = new device.io.PWM({
466+
port: "pwm0",
467+
hz: "100",
468+
resolution: "10",
469+
channel: "0"
470+
});
471+
472+
### `display`
473+
474+
Zephyr display configuration are found in shield definition files. For example, the `stm32u5a9j_dk` target's [`manifest.json`]( ../../build/devices/zephyr/targets/stm32u5a9j_dk/manifest.json) contains:
475+
476+
"zephyrShields": [
477+
"st_lcd_dsi_mb1835"
478+
],
479+

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.1.0
1+
7.0.0

0 commit comments

Comments
 (0)