Lines Matching full:led
8 #include <zephyr/drivers/led.h>
24 const struct device * *dev, uint32_t *led) in parse_common_args() argument
31 "LED device %s not found", argv[arg_idx_dev]); in parse_common_args()
35 *led = strtoul(argv[arg_idx_led], &end_ptr, 0); in parse_common_args()
37 shell_error(sh, "Invalid LED number parameter %s", in parse_common_args()
48 uint32_t led; in cmd_off() local
51 err = parse_common_args(sh, argv, &dev, &led); in cmd_off()
56 shell_print(sh, "%s: turning off LED %d", dev->name, led); in cmd_off()
58 err = led_off(dev, led); in cmd_off()
69 uint32_t led; in cmd_on() local
72 err = parse_common_args(sh, argv, &dev, &led); in cmd_on()
77 shell_print(sh, "%s: turning on LED %d", dev->name, led); in cmd_on()
79 err = led_on(dev, led); in cmd_on()
90 uint32_t led; in cmd_get_info() local
95 err = parse_common_args(sh, argv, &dev, &led); in cmd_get_info()
100 shell_print(sh, "%s: getting LED %d information", dev->name, led); in cmd_get_info()
102 err = led_get_info(dev, led, &info); in cmd_get_info()
128 uint32_t led; in cmd_set_brightness() local
133 err = parse_common_args(sh, argv, &dev, &led); in cmd_set_brightness()
140 shell_error(sh, "Invalid LED brightness parameter %s", in cmd_set_brightness()
145 shell_error(sh, "Invalid LED brightness value %lu (max 100)", in cmd_set_brightness()
150 shell_print(sh, "%s: setting LED %d brightness to %lu", in cmd_set_brightness()
151 dev->name, led, value); in cmd_set_brightness()
153 err = led_set_brightness(dev, led, (uint8_t) value); in cmd_set_brightness()
164 uint32_t led; in cmd_set_color() local
170 err = parse_common_args(sh, argv, &dev, &led); in cmd_set_color()
189 shell_error(sh, "Invalid LED color parameter %s", in cmd_set_color()
195 "Invalid LED color value %lu (max 255)", in cmd_set_color()
202 shell_fprintf(sh, SHELL_NORMAL, "%s: setting LED %d color to %d", in cmd_set_color()
203 dev->name, led, color[0]); in cmd_set_color()
209 err = led_set_color(dev, led, num_colors, color); in cmd_set_color()
311 SHELL_CMD_ARG(off, NULL, "<device> <led>", cmd_off, 3, 0),
312 SHELL_CMD_ARG(on, NULL, "<device> <led>", cmd_on, 3, 0),
313 SHELL_CMD_ARG(get_info, NULL, "<device> <led>", cmd_get_info, 3, 0),
314 SHELL_CMD_ARG(set_brightness, NULL, "<device> <led> <value [0-100]>",
317 "<device> <led> <color 0 [0-255]> ... <color N>",
327 SHELL_CMD_REGISTER(led, &sub_led, "LED commands", NULL);