summaryrefslogtreecommitdiff
path: root/include/lp5562.h
blob: 8bb8d71188a9da69b3f787c73ee11506b3c84133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 * TI LP5562 LED driver.
 */

#ifndef LP5562_H
#define LP5562_H

#define LP5562_REG_ENABLE	0x00
#define LP5562_REG_OP_MODE	0x01
#define LP5562_REG_B_PWM	0x02
#define LP5562_REG_G_PWM	0x03
#define LP5562_REG_R_PWM	0x04
#define LP5562_REG_B_CURRENT	0x05
#define LP5562_REG_G_CURRENT	0x06
#define LP5562_REG_R_CURRENT	0x07
#define LP5562_REG_CONFIG	0x08
#define LP5562_REG_ENG1_PC	0x09
#define LP5562_REG_ENG2_PC	0x0a
#define LP5562_REG_ENG3_PC	0x0b
#define LP5562_REG_STATUS	0x0c
#define LP5562_REG_RESET	0x0d
#define LP5562_REG_W_PWM	0x0e
#define LP5562_REG_W_CURRENT	0x0f
#define LP5562_REG_LED_MAP	0x70

#define LP5562_COLOR_RED	0x800000
#define LP5562_COLOR_GREEN	0x008000
#define LP5562_COLOR_BLUE	0x000080

/* Power on and initialize LP5562. */
int lp5562_poweron(void);

/* Power off LP5562. */
int lp5562_poweroff(void);

/*
 * Set LED color.
 * The parameter 'rgb' is in the format 0x00RRGGBB.
 */
int lp5562_set_color(uint32_t rgb);

#endif /* LP5562_H */