Re: LED API extension


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


Join devel@lists.zephyrproject.org to automatically receive all group messages.