1 -- vim: ft=lua ts=2 et sw=2 2 3 -- Start the framebuffer driver with supporting devices. 4 -- The target platform is the Ben NanoNote. 5 6 local L4 = require("L4"); 7 8 local l = L4.default_loader; 9 10 -- Define general access to peripherals. 11 12 local io_buses = { 13 cpm = l:new_channel(); 14 gpio = l:new_channel(); 15 lcd = l:new_channel(); 16 }; 17 18 l:start({ 19 caps = { 20 cpm = io_buses.cpm:svr(), 21 gpio = io_buses.gpio:svr(), 22 lcd = io_buses.lcd:svr(), 23 24 icu = L4.Env.icu, 25 sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0), 26 }, 27 }, 28 "rom/io rom/hw_devices.io rom/mips-qi_lb60-common.io"); 29 30 -- Expose a SPI peripheral as a device. 31 32 local spi = l:new_channel(); 33 34 l:startv({ 35 caps = { 36 vbus = io_buses.gpio, 37 spi = spi:svr(), 38 }, 39 }, 40 "rom/dev_spi_jz4740", "C23", "C22", "C21"); -- specifying clock, data, enable pin details 41 42 -- Expose a SPI backlight device for the Ben. 43 44 local backlight = l:new_channel(); -- exposes backlight device 45 46 l:start({ 47 caps = { 48 spi = spi, 49 backlight = backlight:svr(), 50 }, 51 }, 52 "rom/dev_backlight_spi_ili8960"); 53 54 -- Expose a display device for the Ben. 55 56 local display = l:new_channel(); -- exposes display device 57 58 l:start({ 59 caps = { 60 backlight = backlight, 61 display = display:svr(), 62 vbus = io_buses.gpio, 63 }, 64 }, 65 "rom/dev_display_qi_lb60"); 66 67 -- Expose the CPM peripheral. 68 69 local cpm = l:new_channel(); 70 71 l:start({ 72 caps = { 73 vbus = io_buses.cpm, 74 cpm = cpm:svr(), 75 }, 76 }, 77 "rom/dev_cpm_jz4740"); 78 79 -- Expose a framebuffer device. 80 81 local fbdrv_fb = l:new_channel(); 82 83 l:start({ 84 caps = { 85 vbus = io_buses.lcd, 86 fb = fbdrv_fb:svr(), 87 cpm = cpm, 88 display = display, -- needed by LCD driver 89 }, 90 }, 91 "rom/fb-drv");