forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Milestone
Description
TM1814 LED strips use an overall strip brightness value that is transmitted as the first 64 bits of data.
To allow the brightness to be dynamically updated, these 8 bytes of the header need to be modifiable.
However, the "transmit buffer" is a read-only object and is only intended to be available inside the _transmit method, so there appears to be no way to update the header (or, for that matter, trailer) values.
Possible approaches:
- A new pair of methods "update_{header,trailer}" accept a buffer of equal length to the original header/trailer and update in place
- A pair of new properties
headerandtrailerare added, which are writable buffers - A new property
bufferis added, which is a writable buffer - (the above but as methods)
- A new constructor variant accepts a writable buffer object (this style of constructor would be incompatible with the one that takes header/trailer); the caller would construct a larger buffer with room for the header & trailer and pass in a sliced memoryview of it to the PixelBuf
For now, the brightness of TM1824 strips will just not be settable after construction time.