Skip to content

Commit 4f230ce

Browse files
committed
Merge branch 'dev'
2 parents 48aa961 + e42b21f commit 4f230ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+12899
-12795
lines changed

docs/develop/drivers.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
2+
## Overview
3+
4+
## Initless drivers
5+
6+
Initless means there is no addLeds (like in FastLed) or initLed (like in physical and virtual driver):
7+
8+
* a Context (see below) will be set
9+
* Driver.show (see below) will use this context to set the right data to the right output.
10+
* The context can dynamically change without needing to reboot or recompile! e.g. changes in pin allocations, leds per pin, RGB or RGBW, or DMX lights like moving heads.
11+
12+
The Art-Net driver is currently working like this, to be added to physical and virtual driver and parallel IO (P4).
13+
14+
The advantages of dynamic context change are:
15+
16+
* No need to recompile any changed configs (e.g. colorOrder is fully flexible, not a setting in platformio.ini)
17+
* No need to restart while setting up a specific installation. Just change layouts until it works as intended.
18+
* Allows for a flexible mix of different outputs e.g. send the first 1024 leds to physical driver, next to virtual driver, next to spi, next to one Art-Net device, next to another Art-Net device.
19+
20+
### Context
21+
22+
Make sure the following is available before calling driver.show. Note: setup only sets variables the loop will use.
23+
24+
* channels[]: pka leds array (CRGB leds) but we now support any light: not only 3 or 4 channels
25+
* channelsPerLed: a light in the channels array can be found by index * channelsPerLed.
26+
* offsets within the channels (RGBW and more like pan and tilt)
27+
* outputs[]: pins[] for leds drivers, outputs[] for Art-Net. Use generic name outputs[]
28+
* lengths[]: nr of lights per output
29+
* driver[]: shows for each output for which driver it is ... 🚧 as currenlty all drivers process all lights which sometimes is what you want (monitor on leds what is on moving heads) but not always
30+
31+
This is the current list of supported lights ranging from 3 channels per light (the classic rgb LEDs) to 32 channels per light. Currently pre defined: lights preset. In the future configurable
32+
33+
* RGB
34+
* RBG
35+
* GRB: default WS2812
36+
* GBR
37+
* BRG
38+
* BGR
39+
* RGBW: e.g. 4 channel par/dmx light
40+
* GRBW: rgbw LED eg. SK6812
41+
* GRB6: some LED curtains
42+
* RGBWYP: 6 channel par/dmx light with UV etc
43+
* MHBeeEyes150W-15 🐺: 15 channels moving head, see https://moonmodules.org/MoonLight/moonlight/drivers/#art-net
44+
* MHBeTopper19x15W-32 🐺: 32 channels moving head
45+
* MH19x15W-24: 24 channels moving heads
46+
47+
Based on the choosen value, the channels per light and the offsets will be set e.g. for GRB: header->channelsPerLight = 3; header->offsetRed = 1; header->offsetGreen = 0; header->offsetBlue = 2;. Drivers should not make this mapping, the code calling drivers should do.
48+
49+
The RGB and W offsets needs to be re-ordered and brightness corrected from the channel array. Not only Art-Net but also a LEDs driver need to accept channel arrays with more then 4 channels per light. Eg GRB6 is a type of led curtain some of us have, which a Chinese manufacturer screwed up: 6 channels per light but only rgb is used, 3 channels do nothing
50+
51+
### Driver.show
52+
53+
Called by loop function.
54+
55+
* loop over all outputs (or pins) which are meant for a specific driver (e.g. all outputs for artnet)
56+
* pre channel actions (...)
57+
* loop over all lights in the output
58+
* for each light
59+
* pre light actions (e.g. setup dma ...)
60+
* copy all channels to the buffer (for art-net) or to the memory area / dma / parallelIO ... so the driver can process it
61+
* find them in the channels array
62+
* correct RGBW offsets when present for brightness using LUT (__red_map etc in Yves his drivers)
63+
* send the buffer/memory (artnetudp.writeTo sends one universe, Yves drivers ..., Troy drivers ...)
64+
* post light actions (e.g. increase universe etc)
65+
* post channel actions (...)
66+
67+
For an example of the loop, see [Artnet loop](https://github.com/MoonModules/MoonLight/blob/fc6c4b6c52bf0a9e9a5de677c1ec5b6536fb7a16/src/MoonLight/Mods.cpp#L260-L293). Not splitten in output loop and lights loop yet (as now all drivers process all lights). Before and after the loop are pre /post output / light actions.
68+
69+
### MoonLight layout nodes
70+
71+
In MoonLight you can define one or more layout nodes telling which position lights have in the real world. E.g. a strip, or a panel (orientation, snake, ...) or a ring or any fantasy shape.
72+
Each layout nodes addLights and addPins (will be renamed to addOutPut). Layouts can be reordered. The pins and lights arrays will be filled with the Layout nodes in the order they are defined.
73+
74+
Note: Above concept can also be offered in a library and imported in other projects like WLED, FastLED scripts etc.
75+
76+
### Notes on the I2S clockless driver
77+
78+
* nb_components -> channelsPerLed
79+
* p_r, p_g, p_b, p_w -> offsetRed, Green, Blue, White
80+
* stripSize[] -> lenghts[]
81+
82+
#### initLed
83+
84+
* setBrightness / setGamma -> done by MoonLight if brightness (or gamma) changes, driver.show expects the LUT to be set right
85+
* setPins(Pinsq): called by MoonLight as soon as pins changes: add function driver.updatePins which also cleans up previous defined pins (I think there is no cleanup, so can be called repeatedly?)
86+
* i2sInit(): not using context...: so this (and i2sReset...) can be called once in the setup...
87+
* i2sReset(): not using context...
88+
* i2sReset_DMA(): not using context...
89+
* i2sReset_FIFO(): not using context...
90+
* initDMABuffers(): uses __NB_DMA_BUFFER, nb_components -> should be called by MoonLight as soon as dma buffer (would be very nice if this is a variable instead of a constant, so can be tweaked in MoonLight without recompiling) or lights preset (channelsPerLed) changes. Add function driver.updateLightsPreset(dma_buffer, channelsPerLight)...
91+
* putdefaultones: uses nb_components
92+
93+
#### showPixels
94+
95+
* loadAndTranspose(): uses this for all dma buffers. All Okay
96+
* loop over num_strips (outputs[].length)
97+
* loop over stripSize (lenghts[]), light by light: triggered by _I2SClocklessLedDriverinterruptHandler
98+
* fills secondPixel using LUT and RGB(W) offsets
99+
* transpose16x1_noinline2(secondpixel)
100+
* i2sStart: uses dma buffers: Okay

docs/develop/layers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
{
4848
"nodes": [
4949
{
50-
"name": "Lissajous 🔥🎨💡",
50+
"name": "Lissajous 🔥🎨🐙",
5151
"on": true,
5252
"controls": [
5353
{

docs/develop/modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
A module is a generic building block to create server and UI functionality which can be activated through the menu.
66

7-
See [Lights Control](module/lightsControl.md) or [Devices](module/devices.md) for examples
7+
See [Lights Control](https://moonmodules.org/MoonLight/moonlight/lightscontrol.md) or [Devices](https://moonmodules.org/MoonLight/moonbase/devices.md) for examples
88

99
Press the ? on any module to go to the documentation.
1010

@@ -121,7 +121,7 @@ submenu: [
121121
{
122122
title: 'Module Demo',
123123
icon: BulbIcon,
124-
href: '/moonbase/module?module=demo',
124+
href: '/moonbase/module?group=moon&module=demo',
125125
feature: page.data.features.moonlight,
126126
},
127127
]

docs/develop/nodes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ it takes a platform reboot, and changing the movinghead number of LEDs in my cas
174174
* Lights
175175
* Regular patterns (CRGB as default but also others like Moving Head ...)
176176

177-
* See [Modules](../modules.md)
177+
* See [Modules](../modules)
178178
* Upon changing a pin, driver.init will rerun (FastLED.addLeds, PD and VD driver.init)
179179
* Uses ESPLiveScripts, see compileAndRun. compileAndRun is started when in Nodes a file.sc is choosen
180180
* To do: kill running scripts, e.g. when changing effects

docs/develop/sveltekit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Below lists are ordered in terms of likelyhood to be accepted:
1717
* ⚠️ [EventSocket emitEvent: use String type](https://github.com/theelims/ESP32-sveltekit/commit/54c4a44eb95be2fe344bb78f022c8afcbbd8c731)
1818
* ⚠️ [no-emit-no-clients](https://github.com/MoonModules/MoonLight/commit/c024c2ff656511c67625b3dce3642d6560724482)
1919
* 💡 [system-status-metrics](https://github.com/theelims/ESP32-sveltekit/commit/352cfe3e376b25f7470ad4f764cdf54f7069c645): use max instead of first
20-
* 💡 [help-to-docs](https://github.com/theelims/ESP32-sveltekit/commit/2c2d2fae5c37b220bc61dfb1ba6655485de6547f): Help link to github.io docs e.g. [Lights control](https://moonmodules.org/MoonLight/moonbase/module/lightsControl)
20+
* 💡 [help-to-docs](https://github.com/theelims/ESP32-sveltekit/commit/2c2d2fae5c37b220bc61dfb1ba6655485de6547f): Help link to github.io docs e.g. [Lights control](https://moonmodules.org/MoonLight/moonlight/lightscontrol)
2121
* 💡 [System metrics](https://moonmodules.org/MoonLight/system/metrics/)
2222
* Loops per second (performance)
2323
* 💡 [System status](https://moonmodules.org/MoonLight/system/status/)
@@ -28,8 +28,8 @@ Below lists are ordered in terms of likelyhood to be accepted:
2828
## Pending - 🚧
2929

3030
* [File Manager](https://moonmodules.org/MoonLight/moonbase/files/)
31-
* [Devices](https://moonmodules.org/MoonLight/moonbase/module/devices/)
32-
* [MoonBase-Modules](https://moonmodules.org/MoonLight/moonbase/modules/)
31+
* [Devices](https://moonmodules.org/MoonLight/moonbase/devices/)
32+
* [MoonBase-Modules](https://moonmodules.org/MoonLight/develop/modules/)
3333

3434
## Submitted
3535

docs/gettingstarted/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* [Install MoonLight](https://moonmodules.org/MoonLight/gettingstarted/installation/)
44
* [Hardware](https://moonmodules.org/MoonLight/gettingstarted/hardware/)
55
* [Run MoonLight](https://moonmodules.org/MoonLight/moonlight/overview/)
6-
* [Lights control](https://moonmodules.org/MoonLight/moonbase/module/lightsControl/)
7-
* [Effects](https://moonmodules.org/MoonLight/moonbase/module/effects/)
8-
* [Drivers](https://moonmodules.org/MoonLight/moonbase/module/drivers/)
6+
* [Lights control](https://moonmodules.org/MoonLight/moonlight/lightscontrol/)
7+
* [Effects](https://moonmodules.org/MoonLight/moonlight/effects/)
8+
* [Drivers](https://moonmodules.org/MoonLight/moonlight/drivers/)
99

1010
## Sitemap
1111

File renamed without changes.
File renamed without changes.

docs/moonbase/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<img width="170" src="https://github.com/user-attachments/assets/87ed3c78-7a4e-4331-b453-47762cce64fa" />
44

55
* [File Manager](https://moonmodules.org/MoonLight/moonbase/filemanager/)
6-
* [Devices](https://moonmodules.org/MoonLight/moonbase/module/devices/)
7-
* [Tasks](https://moonmodules.org/MoonLight/moonbase/module/tasks/)
8-
* [IO](https://moonmodules.org/MoonLight/moonbase/module/input/output/)
6+
* [Devices](https://moonmodules.org/MoonLight/moonbase/devices/)
7+
* [Tasks](https://moonmodules.org/MoonLight/moonbase/tasks/)
8+
* [IO](https://moonmodules.org/MoonLight/moonbase/inputoutput/)
99

1010
## Status Bar
1111

File renamed without changes.

0 commit comments

Comments
 (0)