GodMode9/data/preload.lua
Tage Mellemstrand 584b68b7b1
Add support for reading and writing to I2C devices from lua (#934)
* Add i2c read support to lua

* Add i2c write support to lua

With memory permissions before write

* Adjust i2c write

* Fix inverted id check, better permissions

* Change write to not return anything on success

* Add some documentation for lua i2c

* Change write length from 1024 to 64

* Add whitelist for i2c writing

* Move i2c module into preload

* Add registers and bitmasks for mcu

Add documentation to lua-doc

* Fix missing column divider in lua-doc

* Add ~= 0 then to lua example

* Add some more registers
2026-03-25 23:18:03 +01:00

10 lines
319 B
Lua

-- This file is executed when any Lua script is executed in GodMode9.
-- The purpose of this one is to initialize some variables and modules.
-- If you're looking for an auto-running script, you want "autorun.lua"!
fs = require('fs')
util = require('util')
io = require('io')
sys = require('sys')
i2c = require('i2c')