Lines Matching full:led

11  * @brief LP3943 LED driver
19 * values for a LED will affect other LEDs also.
23 #include <zephyr/drivers/led.h>
62 static int lp3943_get_led_reg(uint32_t *led, uint8_t *reg) in lp3943_get_led_reg() argument
64 switch (*led) { in lp3943_get_led_reg()
78 *led -= 4U; in lp3943_get_led_reg()
86 *led -= 8U; in lp3943_get_led_reg()
94 *led -= 12U; in lp3943_get_led_reg()
97 LOG_ERR("Invalid LED specified"); in lp3943_get_led_reg()
105 uint32_t led, uint8_t mode) in lp3943_set_dim_states() argument
110 ret = lp3943_get_led_reg(&led, &reg); in lp3943_set_dim_states()
116 if (i2c_reg_update_byte_dt(&config->bus, reg, LP3943_MASK << (led << 1), in lp3943_set_dim_states()
117 mode << (led << 1))) { in lp3943_set_dim_states()
118 LOG_ERR("LED reg update failed"); in lp3943_set_dim_states()
125 static int lp3943_led_blink(const struct device *dev, uint32_t led, in lp3943_led_blink() argument
142 if (led < 8) { in lp3943_led_blink()
156 LOG_ERR("LED write failed"); in lp3943_led_blink()
160 ret = lp3943_set_dim_states(config, led, mode); in lp3943_led_blink()
168 static int lp3943_led_set_brightness(const struct device *dev, uint32_t led, in lp3943_led_set_brightness() argument
183 if (led < 8) { in lp3943_led_set_brightness()
197 LOG_ERR("LED write failed"); in lp3943_led_set_brightness()
201 ret = lp3943_set_dim_states(config, led, mode); in lp3943_led_set_brightness()
209 static inline int lp3943_led_on(const struct device *dev, uint32_t led) in lp3943_led_on() argument
215 ret = lp3943_get_led_reg(&led, &reg); in lp3943_led_on()
220 /* Set LED state to ON */ in lp3943_led_on()
222 if (i2c_reg_update_byte_dt(&config->bus, reg, LP3943_MASK << (led << 1), in lp3943_led_on()
223 mode << (led << 1))) { in lp3943_led_on()
224 LOG_ERR("LED reg update failed"); in lp3943_led_on()
231 static inline int lp3943_led_off(const struct device *dev, uint32_t led) in lp3943_led_off() argument
237 ret = lp3943_get_led_reg(&led, &reg); in lp3943_led_off()
242 /* Set LED state to OFF */ in lp3943_led_off()
243 if (i2c_reg_update_byte_dt(&config->bus, reg, LP3943_MASK << (led << 1), in lp3943_led_off()
245 LOG_ERR("LED reg update failed"); in lp3943_led_off()
278 static DEVICE_API(led, lp3943_led_api) = {