Landfall

Changeset

311:27bc75290541
5 months ago Paul Boddie raw files shortlog changelog graph Added an example featuring the X1600 and ST7789-based display. cpm-library-improvements
conf/landfall-examples/mips-lx16-common.io (file) conf/landfall-examples/mips-lx16-spi-spectrum.cfg (file) conf/landfall-examples/mips-lx16-spi-spectrum.list (file)
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/conf/landfall-examples/mips-lx16-common.io	Fri Jun 07 16:17:22 2024 +0200
     1.3 @@ -0,0 +1,20 @@
     1.4 +-- vim: ft=lua ts=2 et sw=2
     1.5 +
     1.6 +-- Configuration file for Io.
     1.7 +
     1.8 +local hw = Io.system_bus()
     1.9 +
    1.10 +local bus = Io.Vi.System_bus
    1.11 +{
    1.12 +  AIC = wrap(hw:match("x1600-aic"));
    1.13 +  CPM = wrap(hw:match("x1600-cpm"));
    1.14 +  DMA = wrap(hw:match("x1600-dma"));
    1.15 +  GPIO = wrap(hw:match("x1600-gpio"));
    1.16 +  I2C = wrap(hw:match("x1600-i2c"));
    1.17 +  MSC = wrap(hw:match("x1600-msc"));
    1.18 +  RTC = wrap(hw:match("x1600-rtc"));
    1.19 +  SSI = wrap(hw:match("x1600-ssi"));
    1.20 +  TCU = wrap(hw:match("x1600-tcu"));
    1.21 +}
    1.22 +
    1.23 +Io.add_vbus("common", bus)
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/conf/landfall-examples/mips-lx16-spi-spectrum.cfg	Fri Jun 07 16:17:22 2024 +0200
     2.3 @@ -0,0 +1,62 @@
     2.4 +-- vim: ft=lua ts=2 et sw=2
     2.5 +
     2.6 +-- Start Mag to multiplex the framebuffer showing only a single program.
     2.7 +-- This example shows an animation showing off a spectrum of colours.
     2.8 +-- The target platform is the Letux X16.
     2.9 +
    2.10 +local L4 = require("L4");
    2.11 +
    2.12 +local l = L4.default_loader;
    2.13 +
    2.14 +-- Define general access to peripherals.
    2.15 +
    2.16 +local io_buses = {
    2.17 +    common   = l:new_channel();
    2.18 +  };
    2.19 +
    2.20 +l:start({
    2.21 +  caps = {
    2.22 +      common  = io_buses.common:svr(),
    2.23 +      icu     = L4.Env.icu,
    2.24 +      sigma0  = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0),
    2.25 +    },
    2.26 +  },
    2.27 +  "rom/io rom/hw_devices.io rom/mips-lx16-common.io");
    2.28 +
    2.29 +-- Expose a framebuffer device.
    2.30 +
    2.31 +local fbdrv_fb = l:new_channel();
    2.32 +
    2.33 +l:start({
    2.34 +    caps = {
    2.35 +      vbus    = io_buses.common,
    2.36 +      fb      = fbdrv_fb:svr(),
    2.37 +    },
    2.38 +  },
    2.39 +  "rom/fb-drv");
    2.40 +
    2.41 +-- Multiplex the framebuffer.
    2.42 +
    2.43 +local mag_caps = {
    2.44 +    mag = l:new_channel(),
    2.45 +    svc = l:new_channel(),
    2.46 +  };
    2.47 +
    2.48 +l:start({
    2.49 +    caps = {
    2.50 +      vbus = io_buses.common, -- needed by input driver
    2.51 +      fb   = fbdrv_fb,
    2.52 +      mag  = mag_caps.mag:svr(),
    2.53 +      svc  = mag_caps.svc:svr(),
    2.54 +    },
    2.55 +  },
    2.56 +  "rom/mag");
    2.57 +
    2.58 +-- Show the spectrum example.
    2.59 +
    2.60 +l:start({
    2.61 +    caps = {
    2.62 +      fb = mag_caps.svc:create(L4.Proto.Goos, "g=240x240+0+0", "barheight=10"),
    2.63 +    },
    2.64 +  },
    2.65 +  "rom/ex_fb_spectrum_cc");
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/conf/landfall-examples/mips-lx16-spi-spectrum.list	Fri Jun 07 16:17:22 2024 +0200
     3.3 @@ -0,0 +1,16 @@
     3.4 +
     3.5 +modaddr 0x1100000
     3.6 +
     3.7 +entry mips-lx16-spi-spectrum-example
     3.8 +bootstrap bootstrap -serial
     3.9 +kernel fiasco -serial_esc
    3.10 +roottask moe rom/mips-lx16-spi-spectrum.cfg
    3.11 +module mips-lx16-spi-spectrum.cfg
    3.12 +module mips-lx16-common.io
    3.13 +module plat-ingenic-x1600/hw_devices.io
    3.14 +module l4re
    3.15 +module io
    3.16 +module ned
    3.17 +module fb-drv
    3.18 +module mag
    3.19 +module ex_fb_spectrum_cc