Home
last modified time | relevance | path

Searched refs:led (Results 1 – 25 of 274) sorted by relevance

1234567891011

/Zephyr-latest/include/zephyr/drivers/led/
Dlp50xx.h28 #define LP50XX_BANK_COL1_CHAN(led) (LP50XX_BANK_CHAN_BASE + 1) argument
29 #define LP50XX_BANK_COL2_CHAN(led) (LP50XX_BANK_CHAN_BASE + 2) argument
30 #define LP50XX_BANK_COL3_CHAN(led) (LP50XX_BANK_CHAN_BASE + 3) argument
34 #define LP50XX_LED_BRIGHT_CHAN(led) (LP50XX_LED_BRIGHT_CHAN_BASE + led) argument
45 #define LP5012_LED_COL1_CHAN(led) \ argument
46 (LP5012_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED)
47 #define LP5012_LED_COL2_CHAN(led) \ argument
48 (LP5012_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED + 1)
49 #define LP5012_LED_COL3_CHAN(led) \ argument
50 (LP5012_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED + 2)
[all …]
/Zephyr-latest/tests/drivers/led/led_api/src/
Dtest_led_api.c70 uint8_t led; in ZTEST_USER() local
77 for (led = 0; led < num_leds; led++) { in ZTEST_USER()
81 ret = led_get_info(led_ctrl, led, &info); in ZTEST_USER()
89 led, ret); in ZTEST_USER()
91 zassert_true(!strcmp(info->label, test_led_info[led].label), in ZTEST_USER()
93 led, info->label, test_led_info[led].label); in ZTEST_USER()
95 zassert_equal(info->index, test_led_info[led].index, in ZTEST_USER()
96 "LED %d - index: %d instead of %d", led, in ZTEST_USER()
97 info->index, test_led_info[led].index); in ZTEST_USER()
99 zassert_equal(info->num_colors, test_led_info[led].num_colors, in ZTEST_USER()
[all …]
/Zephyr-latest/drivers/led/
Dled_pwm.c26 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()
[all …]
Dled_gpio.c24 const struct gpio_dt_spec *led; member
27 static int led_gpio_set_brightness(const struct device *dev, uint32_t led, uint8_t value) in led_gpio_set_brightness() argument
33 if ((led >= config->num_leds) || (value > 100)) { in led_gpio_set_brightness()
37 led_gpio = &config->led[led]; in led_gpio_set_brightness()
42 static int led_gpio_on(const struct device *dev, uint32_t led) in led_gpio_on() argument
44 return led_gpio_set_brightness(dev, led, 100); in led_gpio_on()
47 static int led_gpio_off(const struct device *dev, uint32_t led) in led_gpio_off() argument
49 return led_gpio_set_brightness(dev, led, 0); in led_gpio_off()
63 const struct gpio_dt_spec *led = &config->led[i]; in led_gpio_init() local
65 if (device_is_ready(led->port)) { in led_gpio_init()
[all …]
DKconfig14 module-str = led
29 source "drivers/led/Kconfig.gpio"
30 source "drivers/led/Kconfig.ht16k33"
31 source "drivers/led/Kconfig.is31fl3216a"
32 source "drivers/led/Kconfig.lp3943"
33 source "drivers/led/Kconfig.lp50xx"
34 source "drivers/led/Kconfig.lp5562"
35 source "drivers/led/Kconfig.lp5569"
36 source "drivers/led/Kconfig.ncp5623"
37 source "drivers/led/Kconfig.npm1300"
[all …]
Dled_npm1300.c33 static int led_npm1300_on(const struct device *dev, uint32_t led) in led_npm1300_on() argument
37 if (led >= NPM1300_LED_PINS) { in led_npm1300_on()
41 if (config->mode[led] != NPM_LED_HOST) { in led_npm1300_on()
45 return mfd_npm1300_reg_write(config->mfd, NPM_LED_BASE, NPM_LED_OFFSET_SET + (led * 2U), in led_npm1300_on()
49 static int led_npm1300_off(const struct device *dev, uint32_t led) in led_npm1300_off() argument
53 if (led >= NPM1300_LED_PINS) { in led_npm1300_off()
57 if (config->mode[led] != NPM_LED_HOST) { in led_npm1300_off()
61 return mfd_npm1300_reg_write(config->mfd, NPM_LED_BASE, NPM_LED_OFFSET_CLR + (led * 2U), in led_npm1300_off()
65 static DEVICE_API(led, led_npm1300_api) = {
78 for (uint8_t led = 0U; led < NPM1300_LED_PINS; led++) { in led_npm1300_init() local
[all …]
Dlp3943.c62 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()
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()
125 static int lp3943_led_blink(const struct device *dev, uint32_t led, in lp3943_led_blink() argument
[all …]
Dtlc59108.c60 static int tlc59108_set_ledout(const struct device *dev, uint32_t led, in tlc59108_set_ledout() argument
65 if (led < 4) { in tlc59108_set_ledout()
67 TLC59108_MASK << (led << 1), val << (led << 1))) { in tlc59108_set_ledout()
73 TLC59108_MASK << ((led - 4) << 1), in tlc59108_set_ledout()
74 val << ((led - 4) << 1))) { in tlc59108_set_ledout()
83 static int tlc59108_led_blink(const struct device *dev, uint32_t led, in tlc59108_led_blink() argument
94 if (led > TLC59108_MAX_LED) { in tlc59108_led_blink()
134 return tlc59108_set_ledout(dev, led, TLC59108_LED_GRP_PWM); in tlc59108_led_blink()
137 static int tlc59108_led_set_brightness(const struct device *dev, uint32_t led, in tlc59108_led_set_brightness() argument
145 if (led > TLC59108_MAX_LED) { in tlc59108_led_set_brightness()
[all …]
Dled_handlers.c10 static inline int z_vrfy_led_blink(const struct device *dev, uint32_t led, in z_vrfy_led_blink() argument
14 return z_impl_led_blink((const struct device *)dev, led, delay_on, in z_vrfy_led_blink()
19 static inline int z_vrfy_led_get_info(const struct device *dev, uint32_t led, in z_vrfy_led_get_info() argument
24 return z_impl_led_get_info(dev, led, info); in z_vrfy_led_get_info()
29 uint32_t led, in z_vrfy_led_set_brightness() argument
33 return z_impl_led_set_brightness((const struct device *)dev, led, in z_vrfy_led_set_brightness()
56 static inline int z_vrfy_led_set_color(const struct device *dev, uint32_t led, in z_vrfy_led_set_color() argument
61 return z_impl_led_set_color(dev, led, num_colors, color); in z_vrfy_led_set_color()
65 static inline int z_vrfy_led_on(const struct device *dev, uint32_t led) in z_vrfy_led_on() argument
68 return z_impl_led_on((const struct device *)dev, led); in z_vrfy_led_on()
[all …]
Dncp5623.c44 static const struct led_info *ncp5623_led_to_info(const struct ncp5623_config *config, uint32_t led) in ncp5623_led_to_info() argument
46 if (led < config->num_leds) { in ncp5623_led_to_info()
47 return &config->leds_info[led]; in ncp5623_led_to_info()
53 static int ncp5623_get_info(const struct device *dev, uint32_t led, const struct led_info **info) in ncp5623_get_info() argument
56 const struct led_info *led_info = ncp5623_led_to_info(config, led); in ncp5623_get_info()
67 static int ncp5623_set_color(const struct device *dev, uint32_t led, uint8_t num_colors, in ncp5623_set_color() argument
71 const struct led_info *led_info = ncp5623_led_to_info(config, led); in ncp5623_set_color()
93 static int ncp5623_set_brightness(const struct device *dev, uint32_t led, uint8_t value) in ncp5623_set_brightness() argument
96 const struct led_info *led_info = ncp5623_led_to_info(config, led); in ncp5623_set_brightness()
114 ret = i2c_reg_write_byte_dt(&config->bus, led_channels[led] | value, 0x70); in ncp5623_set_brightness()
[all …]
Dled_shell.c25 const struct device * *dev, uint32_t *led) in parse_common_args() argument
36 *led = strtoul(argv[arg_idx_led], &end_ptr, 0); in parse_common_args()
49 uint32_t led; in cmd_off() local
52 err = parse_common_args(sh, argv, &dev, &led); in cmd_off()
57 shell_print(sh, "%s: turning off LED %d", dev->name, led); in cmd_off()
59 err = led_off(dev, led); in cmd_off()
70 uint32_t led; in cmd_on() local
73 err = parse_common_args(sh, argv, &dev, &led); in cmd_on()
78 shell_print(sh, "%s: turning on LED %d", dev->name, led); in cmd_on()
80 err = led_on(dev, led); in cmd_on()
[all …]
Dpca9633.c56 static int pca9633_led_blink(const struct device *dev, uint32_t led, in pca9633_led_blink() argument
111 PCA9633_MASK << (led << 1), in pca9633_led_blink()
112 PCA9633_LED_GRP_PWM << (led << 1))) { in pca9633_led_blink()
120 static int pca9633_led_set_brightness(const struct device *dev, uint32_t led, in pca9633_led_set_brightness() argument
136 PCA9633_PWM_BASE + led, in pca9633_led_set_brightness()
145 PCA9633_MASK << (led << 1), in pca9633_led_set_brightness()
146 PCA9633_LED_PWM << (led << 1))) { in pca9633_led_set_brightness()
154 static inline int pca9633_led_on(const struct device *dev, uint32_t led) in pca9633_led_on() argument
161 PCA9633_MASK << (led << 1), in pca9633_led_on()
162 PCA9633_LED_ON << (led << 1))) { in pca9633_led_on()
[all …]
/Zephyr-latest/samples/drivers/led/lp50xx/src/
Dmain.c79 static int run_led_test(const struct device *lp50xx_dev, uint8_t led) in run_led_test() argument
85 LOG_INF("Testing LED %d (LED API)", led); in run_led_test()
87 err = led_get_info(lp50xx_dev, led, &info); in run_led_test()
89 LOG_ERR("Failed to get LED %d info", led); in run_led_test()
104 err = led_set_color(lp50xx_dev, led, 3, buf); in run_led_test()
107 "%02x:%02x:%02x, err=%d", led, in run_led_test()
114 err = led_on(lp50xx_dev, led); in run_led_test()
116 LOG_ERR("Failed to turn LED %d on, err=%d", led, err); in run_led_test()
122 err = led_off(lp50xx_dev, led); in run_led_test()
124 LOG_ERR("Failed to turn LED %d off, err=%d", led, err); in run_led_test()
[all …]
/Zephyr-latest/samples/boards/st/power_mgmt/stop3/src/
Dmain.c17 static const struct gpio_dt_spec led = variable
25 const struct gpio_stm32_config *cfg = led.port->config; in main()
28 __ASSERT_NO_MSG(gpio_is_ready_dt(&led)); in main()
31 gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); in main()
42 gpio_pin_set(led.port, led.pin, (int)led_is_on); in main()
47 LL_PWR_DisableGPIOPullDown(pwr_port, (1 << led.pin)); in main()
48 LL_PWR_EnableGPIOPullUp(pwr_port, (1 << led.pin)); in main()
50 LL_PWR_DisableGPIOPullUp(pwr_port, (1 << led.pin)); in main()
51 LL_PWR_EnableGPIOPullDown(pwr_port, (1 << led.pin)); in main()
/Zephyr-latest/samples/boards/google/twinkie_v2/pda/src/
Dview.c19 static void set_led(const struct device *const led, enum led_color_t led_color) in set_led() argument
22 led_off(led, LED_RED); in set_led()
25 led_off(led, LED_GREEN); in set_led()
28 led_off(led, LED_BLUE); in set_led()
30 led_on(led, led_color); in set_led()
40 const struct device *const led = DEVICE_DT_GET_ONE(gpio_leds); in main() local
44 if (!device_is_ready(led)) { in main()
54 set_led(led, LED_GREEN); in main()
56 set_led(led, LED_BLUE); in main()
59 set_led(led, LED_RED); in main()
/Zephyr-latest/boards/shields/adafruit_pca9685/
Dadafruit_pca9685.overlay23 s_led0: s-led-0 {
26 s_led1: s-led-1 {
29 s_led2: s-led-2 {
32 s_led3: s-led-3 {
35 s_led4: s-led-4 {
38 s_led5: s-led-5 {
41 s_led6: s-led-6 {
44 s_led7: s-led-7 {
47 s_led8: s-led-8 {
50 s_led9: s-led-9 {
[all …]
/Zephyr-latest/samples/basic/button/src/
Dmain.c36 static struct gpio_dt_spec led = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led0), gpios, variable
74 if (led.port && !gpio_is_ready_dt(&led)) { in main()
76 ret, led.port->name); in main()
77 led.port = NULL; in main()
79 if (led.port) { in main()
80 ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT); in main()
83 ret, led.port->name, led.pin); in main()
84 led.port = NULL; in main()
86 printk("Set up LED at %s pin %d\n", led.port->name, led.pin); in main()
91 if (led.port) { in main()
[all …]
/Zephyr-latest/samples/boards/st/power_mgmt/blinky/src/
Dmain.c20 static const struct gpio_dt_spec led = variable
27 __ASSERT_NO_MSG(gpio_is_ready_dt(&led)); in main()
32 gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); in main()
33 gpio_pin_set(led.port, led.pin, (int)led_is_on); in main()
36 gpio_pin_configure(led.port, led.pin, GPIO_DISCONNECTED); in main()
41 gpio_pin_configure(led.port, led.pin, GPIO_DISCONNECTED); in main()
/Zephyr-latest/samples/bluetooth/st_ble_sensor/src/
Dled_svc.c19 static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); variable
31 gpio_pin_set(led.port, led.pin, led_state); in led_update()
38 led_ok = gpio_is_ready_dt(&led); in led_init()
41 led.port->name, led.pin); in led_init()
45 ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_INACTIVE); in led_init()
48 ret, led.port->name, led.pin); in led_init()
/Zephyr-latest/samples/drivers/led/pwm/src/
Dmain.c33 static void run_led_test(const struct device *led_pwm, uint8_t led) in run_led_test() argument
38 LOG_INF("Testing LED %d - %s", led, led_label[led] ? : "no label"); in run_led_test()
41 err = led_on(led_pwm, led); in run_led_test()
50 err = led_off(led_pwm, led); in run_led_test()
61 err = led_set_brightness(led_pwm, led, level); in run_led_test()
73 err = led_set_brightness(led_pwm, led, level); in run_led_test()
84 err = led_blink(led_pwm, led, CONFIG_BLINK_DELAY_SHORT, CONFIG_BLINK_DELAY_SHORT); in run_led_test()
97 err = led_blink(led_pwm, led, CONFIG_BLINK_DELAY_LONG, CONFIG_BLINK_DELAY_LONG); in run_led_test()
112 err = led_off(led_pwm, led); in run_led_test()
123 uint8_t led; in main() local
[all …]
/Zephyr-latest/include/zephyr/drivers/
Dled.h55 typedef int (*led_api_blink)(const struct device *dev, uint32_t led,
64 typedef int (*led_api_get_info)(const struct device *dev, uint32_t led,
73 typedef int (*led_api_set_brightness)(const struct device *dev, uint32_t led,
81 typedef int (*led_api_set_color)(const struct device *dev, uint32_t led,
90 typedef int (*led_api_on)(const struct device *dev, uint32_t led);
98 typedef int (*led_api_off)(const struct device *dev, uint32_t led);
138 __syscall int led_blink(const struct device *dev, uint32_t led,
141 static inline int z_impl_led_blink(const struct device *dev, uint32_t led, in z_impl_led_blink() argument
150 return api->blink(dev, led, delay_on, delay_off); in z_impl_led_blink()
163 __syscall int led_get_info(const struct device *dev, uint32_t led,
[all …]
/Zephyr-latest/samples/drivers/ht16k33/src/
Dmain.c27 const struct device *const led = DEVICE_DT_GET(LED_NODE); in main() local
32 if (!device_is_ready(led)) { in main()
51 led_on(led, i); in main()
57 led_blink(led, 0, i / 2, i / 2); in main()
60 led_blink(led, 0, 0, 0); in main()
64 led_set_brightness(led, 0, i); in main()
70 led_off(led, i); in main()
72 led_set_brightness(led, 0, 100); in main()
/Zephyr-latest/samples/basic/threads/src/
Dmain.c33 uint32_t led; member
39 struct led { struct
44 static const struct led led0 = { argument
49 static const struct led led1 = {
54 void blink(const struct led *led, uint32_t sleep_ms, uint32_t id) in blink() argument
56 const struct gpio_dt_spec *spec = &led->spec; in blink()
68 ret, spec->pin, led->num); in blink()
75 struct printk_data_t tx_data = { .led = id, .cnt = cnt }; in blink()
106 rx_data->led, rx_data->cnt); in uart_out()
/Zephyr-latest/samples/drivers/led/is31fl3216a/src/
Dmain.c23 static void pulse_led(int led, const struct device *const dev) in pulse_led() argument
29 status = led_set_brightness(dev, led, percent); in pulse_led()
39 status = led_set_brightness(dev, led, percent); in pulse_led()
82 int led; in main() local
97 for (led = 0 ; led <= LAST_LED ; led++) { in main()
98 pulse_led(led, is31fl3216a); in main()
/Zephyr-latest/samples/boards/st/power_mgmt/wkup_pins/src/
Dmain.c24 static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); variable
30 __ASSERT_NO_MSG(gpio_is_ready_dt(&led)); in main()
31 gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); in main()
32 gpio_pin_set(led.port, led.pin, 1); in main()

1234567891011