From 8fe151cac3c1ac900c8cf98eaf10ac15c6c02351 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Wed, 19 Apr 2017 22:50:47 +1000 Subject: [PATCH] Added module documentation to the readme --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index ae59894..9cb104d 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,25 @@ Returns the last event. Doesn't actually work right now. #### h(...) Pushes an event to the queue, with whatever data you specify. Generally used for IPC. +### Module APIs +#### library/print.lua +These functions should be display device indepentent. +##### print(...) +Displays its arguments on the display device as a string, with a newline. +##### write(...) +Displays its arguments on the display device as a string, without a newline +#### drivers/keyboard.lua +This is a device-specific driver. +##### readln() +Reads a line of input from the keyboard. +#### library/net.lua +Note: Settings have to be set in the kernel module, at the line +``` +tM,nP,nID = {}, 4096, 1 +``` +Where 4096 is the port and 1 is the device ID. Device ID can be any data type, port must be a number. + +Network messages can be read from `_G.ev`, they have the type `net_msg` +##### ns(id,po,msg) +Sends network message `msg` to device `id` on port `po` +