* Implementing missing BlinkM LED features
@ 2022-08-20 23:03 Joseph Strauss
2022-08-21 11:56 ` Pavel Machek
0 siblings, 1 reply; 4+ messages in thread
From: Joseph Strauss @ 2022-08-20 23:03 UTC (permalink / raw)
To: linux-leds
The BlinkM LED is a programmable full-color RGB LED with use cases including industrial design, hobbyist projects, automotive lighting, and wearables. The device is programmable in that specific commands can be send over I2C, including scripts, for more complicated lighting effects. The datasheet can be found here: https://static1.squarespace.com/static/5c155684f407b4100552994c/t/5c2d20ca0e2e7292108eadf8/1546461407535/BlinkM_datasheet.pdf
After glancing through the source code for the existing driver, leds-blinkm.c, I noticed a TODO for implementing several of the device's key features, including setting the time adjust, fade speed, and writing and reading script lines. I would be happy to try implementing and contributing those features, but I wanted to hear some of your thoughts on it before I get started and if you think it would be worth everyone's time.
Best Regards,
Joe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Implementing missing BlinkM LED features
2022-08-20 23:03 Implementing missing BlinkM LED features Joseph Strauss
@ 2022-08-21 11:56 ` Pavel Machek
[not found] ` <20220821224442.dyip3dig3g2isqmi@libretux>
0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2022-08-21 11:56 UTC (permalink / raw)
To: Joseph Strauss; +Cc: linux-leds
[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]
Hi!
> The BlinkM LED is a programmable full-color RGB LED with use cases including industrial design, hobbyist projects, automotive lighting, and wearables. The device is programmable in that specific commands can be send over I2C, including scripts, for more complicated lighting effects. The datasheet can be found here: https://static1.squarespace.com/static/5c155684f407b4100552994c/t/5c2d20ca0e2e7292108eadf8/1546461407535/BlinkM_datasheet.pdf
>
> After glancing through the source code for the existing driver, leds-blinkm.c, I noticed a TODO for implementing several of the device's key features, including setting the time adjust, fade speed, and writing and reading script lines. I would be happy to try implementing and contributing those features, but I wanted to hear some of your thoughts on it before I get started and if you think it would be worth everyone's time.
>
Take a look at pattern trigger. If you can implement that with hw
acceleration...
Actually first step may be rgb-aware pattern trigger, then same
interface with hw acceleration.
Best regards,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Implementing missing BlinkM LED features
[not found] ` <20220821224442.dyip3dig3g2isqmi@libretux>
@ 2022-08-22 10:35 ` Pavel Machek
2022-09-10 18:44 ` Joseph Strauss
0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2022-08-22 10:35 UTC (permalink / raw)
To: Joseph Strauss; +Cc: linux-leds
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
Hi!
Please cc lists on communications.
> Thank you. This would be my first time contributing to the kernel, so there are just a few things I wanted to clarify :)
>
Hmm, good luck.
> I looked into the pattern trigger you mentioned, and from what I found in the sources and mailing list, it seems like an alternative to manually sending a stream of BlinkM script bytes. That is, the user instead sets a brightness and delay and then turns the LED on and off at whatever interval they choose. So it is preferable for the user to send their lighting sequence to the pattern trigger file, rather than with some other file/interface I create?
>
Yes, please. Use existing interface.
> You also mentioned an RGB-aware pattern trigger, which would be necessary for implementing this driver feature. Did you mean I should first patch the existing ledtrig-pattern.c to support changing RGB values, or is that something I would implement within the BlinkM driver?
>
You should patch ledtrig-pattern.c first.
Best regards,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Implementing missing BlinkM LED features
2022-08-22 10:35 ` Pavel Machek
@ 2022-09-10 18:44 ` Joseph Strauss
0 siblings, 0 replies; 4+ messages in thread
From: Joseph Strauss @ 2022-09-10 18:44 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-leds
Hello,
I have begun look at the source code for the BlinkM driver and the pattern trigger to get an idea of the best way to implement an RGB-aware pattern trigger. I was thinking that instead of sending patterns of brightness values and time intervals, the user of the trigger could send RGB hex values and time intervals. Let me know if there is some other way that would make more sense.
The main roadblock I ran into was the way RGB is done in the subsystem currently. From what I gather, each color has its own sysfs class and there is a seperate pattern trigger for each. For an RGB-aware pattern trigger, I assume there would need to be a more general sysfs class. But again, struct led_classdev doesn't have a property for colors.
Additionally, in the current pattern trigger source code, after performing all of the necessary computations, it hands the brightness value off to the LED core with the led_set_brightness() function. Even if the pattern trigger computed RGB values from its input, they would have no place to go, since the LED subsystem has no interface for setting colors, only brightness. Therefore, do you have any suggestions on what would be the best way for the trigger to read RGB values and send those values to the device? Or did you mean that I should work on adding RGB support to the subsystem as a whole? I see that there have been some attempts at it before, but I'm not sure why those were never merged.
Best Regards,
Joe
On 22/08/22 12:35PM, Pavel Machek wrote:
> Hi!
>
> Please cc lists on communications.
>
> > Thank you. This would be my first time contributing to the kernel, so there are just a few things I wanted to clarify :)
> >
>
> Hmm, good luck.
>
> > I looked into the pattern trigger you mentioned, and from what I found in the sources and mailing list, it seems like an alternative to manually sending a stream of BlinkM script bytes. That is, the user instead sets a brightness and delay and then turns the LED on and off at whatever interval they choose. So it is preferable for the user to send their lighting sequence to the pattern trigger file, rather than with some other file/interface I create?
> >
>
> Yes, please. Use existing interface.
>
> > You also mentioned an RGB-aware pattern trigger, which would be necessary for implementing this driver feature. Did you mean I should first patch the existing ledtrig-pattern.c to support changing RGB values, or is that something I would implement within the BlinkM driver?
> >
>
> You should patch ledtrig-pattern.c first.
>
> Best regards,
> Pavel
> --
> People of Russia, stop Putin before his war on Ukraine escalates.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-10 18:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-20 23:03 Implementing missing BlinkM LED features Joseph Strauss
2022-08-21 11:56 ` Pavel Machek
[not found] ` <20220821224442.dyip3dig3g2isqmi@libretux>
2022-08-22 10:35 ` Pavel Machek
2022-09-10 18:44 ` Joseph Strauss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).