From 039847a29868d335c08fe0a587260dffc71ca5c4 Mon Sep 17 00:00:00 2001 From: Ludvig Gunne Lindström Date: Fri, 17 Jul 2026 11:43:24 +0200 Subject: init --- doc/classes/serial.html | 161 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 doc/classes/serial.html (limited to 'doc/classes/serial.html') diff --git a/doc/classes/serial.html b/doc/classes/serial.html new file mode 100644 index 0000000..ca72d57 --- /dev/null +++ b/doc/classes/serial.html @@ -0,0 +1,161 @@ + + + + + Melisma modules + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Class serial

+

Read data on serial ports.

+

+ + + +

+local mserial = require 'melisma.serial'
+
+mserial.open {
+    path = '/dev/ttyACM0',
+    callback = print,
+}
+
+ +

+ + +

Functions

+ + + + + +
serial.open(conf)Open a serial port.
+ +
+
+ + +

Functions

+ Methods +
+
+ + serial.open(conf) +
+
+ +

Open a serial port.

+ +

conf is a table containing the following keys:

+ +
    +
  • path (string, required): Path to serial port (e.g. /dev/ttyACM0).
  • +
  • callback (function, required): Callback function for handling messages.
  • +
  • baud (integer); baud rate (default 9600).
  • +
  • format (string): frame format (default '8N1').
  • +
  • encoding (string): method for encoding messages (default 'cstring'). May be one of: +
      +
    • 'cstring': NULL-terminated strings.
    • +
  • +
+ + + + +

Parameters:

+
    +
  • conf + table + + + +
  • +
+ +

Returns:

+
    + + serial + + + +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.5.0 +Last updated 1980-01-01 00:00:00 +
+
+ + -- cgit v1.3.1