lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I2C interfaces are also found on motherboards (e.g. it is used for plugging in a security device like a TPM module) with a pin connector, or for plugging in a LED indicator (that can display boot status, or control "decorative" RGB LEDs, showing the temperature, frequency and some other status, including a realtime clock, sometimes even a small LCD or LED graphic screen showing animations and variable messages).

That connector is managed frequently by a specific bus driver (controlled by a firmware management interface, such as Intel Management Engine, so that it wan even work when the PC is shutdown and no OS is loaded, as it has a specific powering; it may be used to wake up the PC, and this bus interface is also used by "WakeOnLan" Ethernet boards, or keyboard/mouse connectors for waking up on mouse click or some dedicated key on the keyboard, or some specific USB ports but not all; this is a very low power interface ; it may be found as well inside notebooks; this interface generally requires specific drivers for controlling what it will be allowed to do when the OS is not loaded, and it has various hardware security restrictions requiring a specific protocol even if it's implemented on a single small SoC chip).

Le dim. 13 sept. 2020 à 18:29, Martin <dyngeccetor8@disroot.org> a écrit :
Hello, list.

(This is update for project announced here 2019-12-14.)

In recent weeks I've reworked my project for GUI for DS3231 real-time
clock. DS3231 is just a piece of electronic about 2x4cm and less than
$2 cost. It has cell battery to keep tracking time off-line.

 From PC user view, since it's using I2C protocol you can't just plug it
to USB port and read/write time in JSON or something. But you can plug
DS3231 to Arduino, plug Arduino to USB, load in Arduino code snippet
called Firmata and then you can read and write I2C bytes. Possible but
not easy.

Here comes my project.

It parses and compiles raw I2C data and provides common GUI to it. So
you can just type needed values and press save. As a bonus you'll know
temperature (device has thermometer for clock speed compensation).

GUI is rendered by TekUI (ty Timm for consultations). Firmata client
is implemented by me in Lua. So as raw device data parsing/compiling.

Lua shines here as it allows to convert stream of bytes to structured
table. And convert that table back to stream of bytes for device.

Project page: https://github.com/martin-eden/tekui_ds3231

-- Martin