Topics

LED API extension


Johannes Hutter
 

Hi everyone,

I just saw that a LED subsystem was added for 1.12. Unfortunately we built our own API a while ago but were not able to contribute it. We have in addition to the upstream API support for fading the power of the LED up or down over a given time period. Do you think it would make sense to add this functionality to the API and if yes, would we be able to get this merged before the 1.12 window closes?

Best regards,
Joe
--

Johannes Hutter | Software Developer
Mail: johannes@... 


         Workaround GmbH (ProGlove)  
         Friedenstr. 4 | 81671 München

         Managing Director: Thomas Kirchner 
         HRB: 216605 | AG München 
         USt.-IdNr.: DE298859320



Carles Cufi
 

Hi Johannes,

 

The merge windows closes on Friday. You can of course try to post a PR as soon as possible and it might get merged before then depending on how the review goes.

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of Johannes Hutter
Sent: 15 May 2018 16:27
To: devel@...
Subject: [Zephyr-devel] LED API extension

 

Hi everyone,

I just saw that a LED subsystem was added for 1.12. Unfortunately we built our own API a while ago but were not able to contribute it. We have in addition to the upstream API support for fading the power of the LED up or down over a given time period. Do you think it would make sense to add this functionality to the API and if yes, would we be able to get this merged before the 1.12 window closes?

Best regards,

Joe

--

Johannes Hutter | Software Developer
Mail: johannes@... 

         Workaround GmbH (ProGlove)  
         Friedenstr. 4 | 81671 München

         Managing Director: Thomas Kirchner 
         HRB: 216605 | AG München 
         USt.-IdNr.: DE298859320


Justin
 

Hi Johannes,

I'd be interested in this as well.  I'm implementing something similar already using PWM API and a k_timer.  So I'm curious about what functionality you are proposing?
Would it be something like this
typedef int (*led_api_fade)(struct device *dev, u32_t led, u8_t value, u32_t msecs);
Where the led fades to value over msecs of time?

Thanks,
Justin



Johannes Hutter
 

Hi Justin,

my proposal is:

typedef int (*led_api_brightness_fade(struct device *dev, u32_t led, u8_t start, u8_t stop, u32_t fade_time);

So it is similar to your approach, but the starting brightness would be part of it. With that additional parameter we don't have to track the current brightness to know whether to fade up or down for example.
I will post a PR today. Would be great, if you had a look at it. I doubt we will get it merged until friday, but it would be nice to work on it nonetheless.

Best Regards,
Joe


On Wed, May 16, 2018 at 8:36 PM Justin <jdemarti@...> wrote:

Hi Johannes,

I'd be interested in this as well.  I'm implementing something similar already using PWM API and a k_timer.  So I'm curious about what functionality you are proposing?
Would it be something like this
typedef int (*led_api_fade)(struct device *dev, u32_t led, u8_t value, u32_t msecs);
Where the led fades to value over msecs of time?

Thanks,
Justin


--

Johannes Hutter | Software Developer
Mail: johannes@... 


         Workaround GmbH (ProGlove)  
         Friedenstr. 4 | 81671 München

         Managing Director: Thomas Kirchner 
         HRB: 216605 | AG München 
         USt.-IdNr.: DE298859320