You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/devices/zephyr.md
+21-26Lines changed: 21 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -364,13 +364,30 @@ If you are using Ethernet, the Moddable SDK runtime automatically attempts to co
364
364
365
365
When using Wi-Fi and Ethernet, both set the device clock via NTP immediately after connecting. This is essential for secure network communication using TLS. If your device sets the time some other way, such as a Real-Time Clock peripheral, NTP clock synchronization is not done.
366
366
367
-
### Storage – Files, Key-Value Store, and Flash
368
-
369
-
@@
370
-
371
367
### Displays
372
368
If your project uses a display, typically by including `manifest_piu.json` or `manifest_commodetto.json`, the `mcdevicetree` tool automatically creates a `Screen` global for the board's display driver, if any. This allows the Piu user interface framework and Commodetto's Poco renderer to access the screen. For boards with multiple displays, the display specified in the `chosen` section of the device tree is used.
373
369
370
+
### `flash`
371
+
To access flash memory partitions, include the ECMA-419 flash module manifest `$MODDABLE/modules/io/flash/manifest.json` in your project's manifest. That creates the `device.flash.open` function to access flash partitions by name:
To access a file system, include the ECMA-419 file module manifest `$MODDABLE/modules/io/files/manifest.json` in your project's manifest. That creates the `device.files` property to access the file system. Your Zephyr Device Tree must have a valid file system defined in the Zephyr Device Tree at `root.children.fstab`.
To access the Zephyr key-value pair store (settings), include the ECMA-419 storage module manifest `$MODDABLE/modules/io/storage/manifest.json` in your project's manifest. That creates the `device.keyValue.open` function to access the key-value store. Your Zephyr Device Tree must have a valid settings subsystem defined in the Zephyr Device Tree.
386
+
387
+
```js
388
+
constdomain=device.keyValue.open({path:"wifi"});
389
+
```
390
+
374
391
### TypeScript
375
392
The `device` global is different for every Zephyr board, because every board has unique hardware capabiliites and confirmations. As a result, a universal TypeScript declarations file (a `.d.ts` file) cannot precisely define the `device` global for any single build. Instead, `mcdevicetree` generates the TypeScript declarations file for the board. These declarations are automatically used when building TypeScript code for Zephyr, ensuring that your code accesses only the hardware available on your development board.
376
393
@@ -488,25 +505,3 @@ Zephyr display configuration are found in shield definition files. For example,
488
505
"st_lcd_dsi_mb1835"
489
506
],
490
507
```
491
-
492
-
### `flash`
493
-
To access flash memory partitions, include the ECMA-419 flash module manifest `$MODDABLE/modules/io/flash/manifest.json` in your project's manifest. That creates the `device.flash.open` function to access flash partitions by name:
To access a file system, include the ECMA-419 file module manifest `$MODDABLE/modules/io/files/manifest.json` in your project's manifest. That creates the `device.files` property to access the file system. Your Zephyr Device Tree must have a valid file system defined in the Zephyr Device Tree at `root.children.fstab`.
To access the Zephyr key-value pair store (settings), include the ECMA-419 storage module manifest `$MODDABLE/modules/io/storage/manifest.json` in your project's manifest. That creates the `device.keyValue.open` function to access the key-value store. Your Zephyr Device Tree must have a valid settings subsystem defined in the Zephyr Device Tree.
0 commit comments