Skip to content

Commit 46d6de4

Browse files
committed
oops - wrong place
1 parent ccd6b50 commit 46d6de4

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

documentation/devices/zephyr.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,30 @@ If you are using Ethernet, the Moddable SDK runtime automatically attempts to co
364364

365365
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.
366366

367-
### Storage – Files, Key-Value Store, and Flash
368-
369-
@@
370-
371367
### Displays
372368
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.
373369

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:
372+
373+
```js
374+
const partition = device.flash.open({path: "partition_name"});
375+
```
376+
377+
### `file`
378+
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`.
379+
380+
```js
381+
const file = device.files.openFile({path: "directory/file.txt"});
382+
```
383+
384+
### `keyValue`
385+
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+
const domain = device.keyValue.open({path: "wifi"});
389+
```
390+
374391
### TypeScript
375392
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.
376393

@@ -488,25 +505,3 @@ Zephyr display configuration are found in shield definition files. For example,
488505
"st_lcd_dsi_mb1835"
489506
],
490507
```
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:
494-
495-
```js
496-
const partition = device.flash.open({path: "partition_name"});
497-
```
498-
499-
### `file`
500-
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`.
501-
502-
```js
503-
const file = device.files.openFile({path: "directory/file.txt"});
504-
```
505-
506-
### `keyValue`
507-
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.
508-
509-
```js
510-
const domain = device.keyValue.open({path: "wifi"});
511-
```
512-

0 commit comments

Comments
 (0)