Hardware LED blinking (#1303)

* Hardware LED blinking notification messages
* Blink: fix crash on exit, reset blinking on exit
* Lib: remove unused UNUSED

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-06-09 10:33:46 +03:00
committed by GitHub
parent 41cf421234
commit cfb1a0d01c
10 changed files with 322 additions and 52 deletions

View File

@@ -6,10 +6,10 @@
/** Channel types */
typedef enum {
LP5562ChannelRed,
LP5562ChannelGreen,
LP5562ChannelBlue,
LP5562ChannelWhite,
LP5562ChannelRed = (1 << 0),
LP5562ChannelGreen = (1 << 1),
LP5562ChannelBlue = (1 << 2),
LP5562ChannelWhite = (1 << 3),
} LP5562Channel;
typedef enum {
@@ -37,6 +37,9 @@ void lp5562_set_channel_value(FuriHalI2cBusHandle* handle, LP5562Channel channel
/** Get channel PWM value */
uint8_t lp5562_get_channel_value(FuriHalI2cBusHandle* handle, LP5562Channel channel);
/** Set channel source */
void lp5562_set_channel_src(FuriHalI2cBusHandle* handle, LP5562Channel channel, LP5562Engine src);
/** Execute program sequence */
void lp5562_execute_program(
FuriHalI2cBusHandle* handle,
@@ -44,6 +47,9 @@ void lp5562_execute_program(
LP5562Channel ch,
uint16_t* program);
/** Stop program sequence */
void lp5562_stop_program(FuriHalI2cBusHandle* handle, LP5562Engine eng);
/** Execute ramp program sequence */
void lp5562_execute_ramp(
FuriHalI2cBusHandle* handle,
@@ -52,3 +58,12 @@ void lp5562_execute_ramp(
uint8_t val_start,
uint8_t val_end,
uint16_t time);
/** Start blink program sequence */
void lp5562_execute_blink(
FuriHalI2cBusHandle* handle,
LP5562Engine eng,
LP5562Channel ch,
uint16_t on_time,
uint16_t period,
uint8_t brightness);