rpi-io 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -7
  2. package/package.json +6 -3
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # rpi-io
2
- ![Static Badge](https://img.shields.io/badge/rpi--io-_1.1_-FF5500?style=flat) ![Static Badge](https://img.shields.io/badge/Nodejs-%3E_23-66cc33?logo=nodedotjs&logoColor=white) ![Static Badge](https://img.shields.io/badge/NPM-%3E_10-CC3534?logo=npm&logoColor=white) ![Static Badge](https://img.shields.io/badge/Raspberry_Pi-Zero2_4B_5B-C51A4A?logo=raspberrypi&logoColor=white) ![Static Badge](https://img.shields.io/badge/OS-Bookworm_Trixie-0D7AB9?style=flat)
2
+ ![Static Badge](https://img.shields.io/badge/rpi--io-_1.1.4_-FF5500?style=flat) ![Static Badge](https://img.shields.io/badge/Nodejs-%3E_23-66cc33?logo=nodedotjs&logoColor=white) ![Static Badge](https://img.shields.io/badge/NPM-%3E_10-CC3534?logo=npm&logoColor=white) ![Static Badge](https://img.shields.io/badge/Raspberry_Pi-Zero2_4B_5B-C51A4A?logo=raspberrypi&logoColor=white) ![Static Badge](https://img.shields.io/badge/OS-Bookworm_Trixie-0D7AB9?style=flat)
3
3
 
4
4
 
5
5
  **rpi-io** is a lite [ESM](https://nodejs.org/api/esm.html#modules-ecmascript-modules) module for **Node.js** to control **Raspberry Pi** GPIO: access (in, out), input event detection and [PWM](https://en.wikipedia.org/wiki/Pulse-width_modulation) peripheral control.
@@ -12,7 +12,7 @@
12
12
  - Input/Output - [libgpiod](https://libgpiod.readthedocs.io/en/stable/) v1.6.3 (*Bookworm*) and v2.2.1 (*Trixie*)
13
13
  - PWM - [sysfs](https://en.wikipedia.org/wiki/Sysfs) interface.
14
14
 
15
- ## Installation
15
+ ## Installation
16
16
 
17
17
  ````shell
18
18
  npm install rpi-io
@@ -24,7 +24,7 @@ By default rpi-io does not require specific configuration.
24
24
 
25
25
  If you want to use [hardware-based PWM](https://pinout.xyz/pinout/pwm) peripherals, some configuration is required:
26
26
 
27
- - Open the file `/boot/firmware/config.txt` and add the required [dtoverlay](https://www.raspberrypi.com/documentation/computers/configuration.html#part3.1) configuration for PWM as showned in the examples below.
27
+ - Open the file `/boot/firmware/config.txt` and add the required [dtoverlay](https://www.raspberrypi.com/documentation/computers/configuration.html#part3.1) configuration for PWM as showed in the examples below.
28
28
 
29
29
  ```shell
30
30
  # Examples of PWM configuration to add to/boot/firmware/config.txt
@@ -273,7 +273,7 @@ console.log("servo position = 0°");
273
273
 
274
274
  ##### Parameters
275
275
 
276
- All time parameters are defined in nano-seconds (ns).
276
+ All time parameters are defined in nanoseconds (ns).
277
277
 
278
278
  - **period** *{Number}* Time period in which [duty cycle](https://en.wikipedia.org/wiki/Pulse-width_modulation) varies.
279
279
  - **duty** *{Number}* Initial duty cycle.
@@ -331,6 +331,16 @@ servo.pwmDuty(1500000)
331
331
 
332
332
 
333
333
  ### Utility functions
334
+ #### Rio.stopMonitoring()
335
+
336
+ To stop monitoring subprocess when leaving your app script or in case of failure. This prevents having a runaway subprocess that could block a new call to the `monitor()` method.
337
+
338
+ ##### Example
339
+
340
+ ```javascript
341
+ Rio.stopMonitoring()
342
+ ```
343
+
334
344
  #### Rio.config(gpio)
335
345
 
336
346
  To return configuration of some GPIO
@@ -379,7 +389,7 @@ console.log(Rio.version())
379
389
 
380
390
  #### Rio.os()
381
391
 
382
- To retrieve Rapsberry Pi OS info.
392
+ To retrieve Raspberry Pi OS info.
383
393
 
384
394
  ##### Example
385
395
 
@@ -418,10 +428,10 @@ Rio.isSystemSupported() // See console below
418
428
 
419
429
  ## Benchmark
420
430
 
421
- The following table summarizes GPIO *set* average times with rpi-io v1.1.0 and various hardwares and OS.
431
+ The following table summarizes GPIO *set* average times with rpi-io v1.1.0 and various hardware and OS.
422
432
 
423
433
  | | RPi 5B | RPi 4B | RPi Zero2 |
424
- | -------- | ------- | ---------- | ---------- |
434
+ |----------|---------|------------|------------|
425
435
  | Bookworm | 1.37 ms | 4.56 ms | 9.07 ms |
426
436
  | Trixie | 3.82 ms | not tested | not tested |
427
437
  ---
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "rpi-io",
3
- "version": "1.1.3",
4
- "description": "Nodejs module to control Raspbbery Pi GPIO",
3
+ "version": "1.1.5",
4
+ "description": "Nodejs module to control Raspberry Pi GPIO",
5
5
  "keywords": [
6
6
  "raspberry",
7
7
  "gpio",
8
+ "libgpiod",
8
9
  "nodejs",
9
10
  "esm",
10
- "pwm"
11
+ "pwm",
12
+ "bookworm",
13
+ "trixie"
11
14
  ],
12
15
  "homepage": "https://github.com/gdorbes/rpi-io#readme",
13
16
  "bugs": {