Lines Matching refs:led
26 const struct pwm_dt_spec *led; member
29 static int led_pwm_blink(const struct device *dev, uint32_t led, in led_pwm_blink() argument
36 if (led >= config->num_leds) { in led_pwm_blink()
50 dt_led = &config->led[led]; in led_pwm_blink()
56 uint32_t led, uint8_t value) in led_pwm_set_brightness() argument
61 if (led >= config->num_leds || value > 100) { in led_pwm_set_brightness()
65 dt_led = &config->led[led]; in led_pwm_set_brightness()
67 return pwm_set_pulse_dt(&config->led[led], in led_pwm_set_brightness()
71 static int led_pwm_on(const struct device *dev, uint32_t led) in led_pwm_on() argument
73 return led_pwm_set_brightness(dev, led, 100); in led_pwm_on()
76 static int led_pwm_off(const struct device *dev, uint32_t led) in led_pwm_off() argument
78 return led_pwm_set_brightness(dev, led, 0); in led_pwm_off()
93 const struct pwm_dt_spec *led = &config->led[i]; in led_pwm_init() local
95 if (!device_is_ready(led->dev)) { in led_pwm_init()
96 LOG_ERR("%s: pwm device not ready", led->dev->name); in led_pwm_init()
113 const struct pwm_dt_spec *led = &config->led[i]; in led_pwm_pm_action() local
115 LOG_DBG("PWM %p running pm action %" PRIu32, led->dev, action); in led_pwm_pm_action()
117 err = pm_device_action_run(led->dev, action); in led_pwm_pm_action()
119 LOG_DBG("Cannot switch PWM %p power state (err = %d)", led->dev, err); in led_pwm_pm_action()
127 static DEVICE_API(led, led_pwm_api) = {
142 .led = led_pwm_##id, \