mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-04 23:06:52 +00:00
This patch adds support for the Texas Instruments LP5030 and LP5036 I2C LED controllers. They are respectively providing up to 30 and 36 channels (i.e. 10 or 12 RGB LEDs). In addition to the channel/color registers this LED controller provides a per-LED brigthness register. This driver implements both LED-based and channel-based API methods: - led_on - led_off - led_get_info - led_set_brightness - led_set_color - led_set_channel - led_write_channels Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
/*
|
|
* Copyright (c) 2020 Seagate Technology LLC
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
|
|
#ifndef ZEPHYR_INCLUDE_DRIVERS_LED_LP503X_H_
|
|
#define ZEPHYR_INCLUDE_DRIVERS_LED_LP503X_H_
|
|
|
|
#define LP503X_MAX_LEDS 12
|
|
#define LP503X_COLORS_PER_LED 3
|
|
|
|
/*
|
|
* LED channels mapping.
|
|
*/
|
|
|
|
#define LP503X_NUM_CHANNELS 52
|
|
|
|
/* Bank channels. */
|
|
#define LP503X_BANK_CHAN_BASE 0
|
|
#define LP503X_BANK_BRIGHT_CHAN LP503X_BANK_CHAN_BASE
|
|
#define LP503X_BANK_COL1_CHAN(led) (LP503X_BANK_CHAN_BASE + 1)
|
|
#define LP503X_BANK_COL2_CHAN(led) (LP503X_BANK_CHAN_BASE + 2)
|
|
#define LP503X_BANK_COL3_CHAN(led) (LP503X_BANK_CHAN_BASE + 3)
|
|
|
|
/* LED brightness channels. */
|
|
#define LP503X_LED_BRIGHT_CHAN_BASE 4
|
|
#define LP503X_LED_BRIGHT_CHAN(led) (LP503X_LED_BRIGHT_CHAN_BASE + led)
|
|
|
|
/* LED color channels. */
|
|
#define LP503X_LED_COL_CHAN_BASE 16
|
|
#define LP503X_LED_COL1_CHAN(led) (LP503X_LED_COL_CHAN_BASE + \
|
|
led * LP503X_COLORS_PER_LED)
|
|
#define LP503X_LED_COL2_CHAN(led) (LP503X_LED_COL_CHAN_BASE + \
|
|
led * LP503X_COLORS_PER_LED + 1)
|
|
#define LP503X_LED_COL3_CHAN(led) (LP503X_LED_COL_CHAN_BASE + \
|
|
led * LP503X_COLORS_PER_LED + 2)
|
|
|
|
#endif /* ZEPHYR_INCLUDE_DRIVERS_LED_LP503X_H_ */
|