paul@0 | 1 | -- vim: ft=lua ts=2 et sw=2 |
paul@0 | 2 | |
paul@0 | 3 | -- Test the keyboard LEDs via the GPIO peripheral. |
paul@0 | 4 | -- The target platform is the Letux 400 notebook computer. |
paul@0 | 5 | |
paul@0 | 6 | local L4 = require("L4"); |
paul@0 | 7 | |
paul@0 | 8 | local l = L4.default_loader; |
paul@0 | 9 | |
paul@0 | 10 | -- Define general access to peripherals. |
paul@0 | 11 | |
paul@0 | 12 | local io_buses = { |
paul@0 | 13 | devices = l:new_channel(); -- exposes GPIO, PWM |
paul@0 | 14 | }; |
paul@0 | 15 | |
paul@0 | 16 | l:start({ |
paul@0 | 17 | caps = { |
paul@0 | 18 | devices = io_buses.devices:svr(), |
paul@0 | 19 | icu = L4.Env.icu, |
paul@0 | 20 | sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0), |
paul@0 | 21 | }, |
paul@0 | 22 | }, |
paul@0 | 23 | "rom/io rom/hw_devices.io rom/mips-letux400-led.io"); |
paul@0 | 24 | |
paul@0 | 25 | l:start({ |
paul@0 | 26 | caps = { |
paul@0 | 27 | vbus = io_buses.devices, |
paul@0 | 28 | }, |
paul@0 | 29 | }, |
paul@0 | 30 | "rom/ex_letux400_leds"); |