Loading...
Searching...
No Matches
lp5562.h
1#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5#include <furi_hal_i2c.h>
6
8typedef enum {
9 LP5562ChannelRed = (1 << 0),
10 LP5562ChannelGreen = (1 << 1),
11 LP5562ChannelBlue = (1 << 2),
12 LP5562ChannelWhite = (1 << 3),
13} LP5562Channel;
14
15typedef enum {
16 LP5562Direct = 0,
17 LP5562Engine1 = 1,
18 LP5562Engine2 = 2,
19 LP5562Engine3 = 3,
20} LP5562Engine;
21
23void lp5562_reset(const FuriHalI2cBusHandle* handle);
24
26void lp5562_configure(const FuriHalI2cBusHandle* handle);
27
29void lp5562_enable(const FuriHalI2cBusHandle* handle);
30
32void lp5562_set_channel_current(
33 const FuriHalI2cBusHandle* handle,
34 LP5562Channel channel,
35 uint8_t value);
36
38void lp5562_set_channel_value(
39 const FuriHalI2cBusHandle* handle,
40 LP5562Channel channel,
41 uint8_t value);
42
44uint8_t lp5562_get_channel_value(const FuriHalI2cBusHandle* handle, LP5562Channel channel);
45
47void lp5562_set_channel_src(
48 const FuriHalI2cBusHandle* handle,
49 LP5562Channel channel,
50 LP5562Engine src);
51
53void lp5562_execute_program(
54 const FuriHalI2cBusHandle* handle,
55 LP5562Engine eng,
56 LP5562Channel ch,
57 uint16_t* program);
58
60void lp5562_stop_program(const FuriHalI2cBusHandle* handle, LP5562Engine eng);
61
63void lp5562_execute_ramp(
64 const FuriHalI2cBusHandle* handle,
65 LP5562Engine eng,
66 LP5562Channel ch,
67 uint8_t val_start,
68 uint8_t val_end,
69 uint16_t time);
70
72void lp5562_execute_blink(
73 const FuriHalI2cBusHandle* handle,
74 LP5562Engine eng,
75 LP5562Channel ch,
76 uint16_t on_time,
77 uint16_t period,
78 uint8_t brightness);
I2C HAL API.
FuriHal i2c handle.
Definition furi_hal_i2c_types.h:44