/Zephyr-Core-3.5.0/drivers/led/ |
D | Kconfig | 4 # Top-level configuration file for LED drivers. 6 menuconfig LED config 7 bool "Light-Emitting Diode (LED) drivers" 9 Include LED drivers in the system configuration. 11 if LED 13 module = LED 14 module-str = led 18 int "LED initialization priority" 21 System initialization priority for LED drivers. 24 bool "LED shell" [all …]
|
D | tlc59108.c | 12 * @brief LED driver for the TLC59108 I2C LED driver 16 #include <zephyr/drivers/led.h> 25 /* TLC59108 max supported LED id */ 28 /* TLC59108 select registers determine the source that drives LED outputs */ 29 #define TLC59108_LED_OFF 0x0 /* LED driver off */ 30 #define TLC59108_LED_ON 0x1 /* LED driver on */ 60 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() 68 LOG_ERR("LED reg 0x%x update failed", TLC59108_LEDOUT0); in tlc59108_set_ledout() [all …]
|
D | led_pwm.c | 14 #include <zephyr/drivers/led.h> 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 [all …]
|
D | led_npm1300.c | 11 #include <zephyr/drivers/led.h> 14 /* nPM1300 LED base address */ 17 /* nPM1300 LED register offsets */ 25 /* nPM1300 LED modes */ 33 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() [all …]
|
D | lp3943.c | 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 [all …]
|
D | pca9633.c | 11 * @brief LED driver for the PCA9633 I2C LED driver (7-bit slave address 0x62) 15 #include <zephyr/drivers/led.h> 25 /* PCA9633 select registers determine the source that drives LED outputs */ 26 #define PCA9633_LED_OFF 0x0 /* LED driver off */ 27 #define PCA9633_LED_ON 0x1 /* LED driver on */ 56 static int pca9633_led_blink(const struct device *dev, uint32_t led, in pca9633_led_blink() argument 81 LOG_ERR("LED reg write failed"); in pca9633_led_blink() 95 LOG_ERR("LED reg write failed"); in pca9633_led_blink() 104 LOG_ERR("LED reg update failed"); in pca9633_led_blink() 108 /* Select the GRPPWM source to drive the LED output */ in pca9633_led_blink() [all …]
|
D | led_gpio.c | 14 #include <zephyr/drivers/led.h> 24 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 [all …]
|
D | led_shell.c | 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 [all …]
|
D | led_handlers.c | 8 #include <zephyr/drivers/led.h> 10 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 [all …]
|
/Zephyr-Core-3.5.0/include/zephyr/drivers/led/ |
D | lp50xx.h | 22 * LED channels mapping. 28 #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 32 /* LED brightness channels. */ 34 #define LP50XX_LED_BRIGHT_CHAN(led) (LP50XX_LED_BRIGHT_CHAN_BASE + led) argument 37 * LED color channels. 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 [all …]
|
/Zephyr-Core-3.5.0/include/zephyr/drivers/ |
D | led.h | 9 * @brief Public LED driver APIs 16 * @brief LED Interface 17 * @defgroup led_interface LED Interface 32 * @brief LED information structure 34 * This structure gathers useful information about LED controller. 36 * @param label LED label. 37 * @param num_colors Number of colors per LED. 38 * @param index Index of the LED on the controller. 39 * @param color_mapping Mapping of the LED colors. 50 * @brief Callback API for blinking an LED [all …]
|
/Zephyr-Core-3.5.0/tests/drivers/led/led_api/src/ |
D | test_led_api.c | 9 #include <zephyr/drivers/led.h> 61 zassert_true(device_is_ready(led_ctrl), "LED controller is not ready"); in test_led_setup() 70 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() 88 zassert_equal(ret, 0, "LED %d - led_get_info() error (ret=%d)", in ZTEST_USER() 89 led, ret); in ZTEST_USER() 91 zassert_true(!strcmp(info->label, test_led_info[led].label), in ZTEST_USER() 92 "LED %d - label: %s instead of %s", in ZTEST_USER() 93 led, info->label, test_led_info[led].label); in ZTEST_USER() [all …]
|
/Zephyr-Core-3.5.0/samples/drivers/led_lp50xx/src/ |
D | main.c | 10 #include <zephyr/drivers/led.h> 11 #include <zephyr/drivers/led/lp50xx.h> 12 #include <zephyr/dt-bindings/led/led.h> 44 * Prepare a color buffer for a single LED using its color mapping and the 74 * @brief Run tests on a single LED using the LED-based API syscalls. 76 * @param lp50xx_dev LP50XX LED controller device. 77 * @param led Number of the LED to test. 79 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() [all …]
|
/Zephyr-Core-3.5.0/samples/drivers/led_pwm/src/ |
D | main.c | 10 #include <zephyr/drivers/led.h> 31 * @brief Run tests on a single LED using the LED API syscalls. 33 * @param led_pwm LED PWM device. 34 * @param led Number of the LED to test. 36 static void run_led_test(const struct device *led_pwm, uint8_t led) in run_led_test() argument 41 LOG_INF("Testing LED %d - %s", led, led_label[led] ? : "no label"); in run_led_test() 43 /* Turn LED on. */ in run_led_test() 44 err = led_on(led_pwm, led); in run_led_test() 52 /* Turn LED off. */ in run_led_test() 53 err = led_off(led_pwm, led); in run_led_test() [all …]
|
/Zephyr-Core-3.5.0/samples/basic/rgb_led/ |
D | README.rst | 1 .. zephyr:code-sample:: rgb-led 2 :name: PWM RGB LED 5 Drive an RGB LED using the PWM API. 10 This is a sample app which drives an RGB LED using the :ref:`PWM API <pwm_api>`. 12 There are three single-color component LEDs in an RGB LED. Each component LED 15 flicker fusion threshold (the minimum flicker rate where the LED is perceived as 16 being steady). The sample causes each LED component to step from dark to max 17 brightness. Three **for** loops (one for each component LED) generate a gradual 18 range of color changes from the RGB LED, and the sample repeats forever. 25 The LED PWM channels must be configured using the following :ref:`devicetree [all …]
|
/Zephyr-Core-3.5.0/boards/shields/adafruit_pca9685/ |
D | adafruit_pca9685.overlay | 23 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-Core-3.5.0/samples/boards/google_twinkie_v2_pda/src/ |
D | view.c | 8 #include <zephyr/drivers/led.h> 19 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() [all …]
|
/Zephyr-Core-3.5.0/samples/basic/blinky_pwm/ |
D | README.rst | 5 Blink an LED using the PWM API. 10 This application blinks an LED using the :ref:`PWM API <pwm_api>`. See 13 The LED starts blinking at a 1 Hz frequency. The frequency doubles every 4 26 The board must have an LED connected to a PWM output channel. The PWM 27 controlling this LED must be configured using the ``pwm_led0`` :ref:`devicetree 35 already connected to an LED on the board. 45 - connect PWM2 (PA0) to an LED 47 - connect PWM2 (PA0) to an LED 49 - connect PWM2 (PA0) to an LED 51 - connect PWM2 (PA0) to an LED [all …]
|
/Zephyr-Core-3.5.0/samples/basic/button/src/ |
D | main.c | 30 * to turn on the LED whenever the button is pressed. 32 static struct gpio_dt_spec led = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led0), gpios, variable 70 if (led.port && !gpio_is_ready_dt(&led)) { in main() 71 printk("Error %d: LED device %s is not ready; ignoring it\n", in main() 72 ret, led.port->name); in main() 73 led.port = NULL; in main() 75 if (led.port) { in main() 76 ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT); in main() 78 printk("Error %d: failed to configure LED device %s pin %d\n", in main() 79 ret, led.port->name, led.pin); in main() [all …]
|
/Zephyr-Core-3.5.0/samples/drivers/led_is31fl3733/src/ |
D | main.c | 8 #include <zephyr/drivers/led.h> 9 #include <zephyr/drivers/led/is31fl3733.h> 15 /* LED matrix is addressed using a row major format */ 20 static int led_channel_write(const struct device *led) in led_channel_write() argument 34 ret = led_write_channels(led, 0, sizeof(led_state), led_state); in led_channel_write() 36 printk("Error: could not write LED channels (%d)\n", ret); in led_channel_write() 40 /* Disable quadrant of LED display */ in led_channel_write() 41 printk("Disable LED quadrant\n"); in led_channel_write() 48 ret = led_write_channels(led, 0, in led_channel_write() 51 printk("Error: could not write LED channels (%d)\n", ret); in led_channel_write() [all …]
|
/Zephyr-Core-3.5.0/samples/bluetooth/st_ble_sensor/src/ |
D | led_svc.c | 19 static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); variable 30 LOG_INF("Turn %s LED", led_state ? "on" : "off"); in led_update() 31 gpio_pin_set(led.port, led.pin, led_state); in led_update() 38 led_ok = gpio_is_ready_dt(&led); in led_init() 40 LOG_ERR("Error: LED on GPIO %s pin %d is not ready", 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-Core-3.5.0/samples/drivers/led_lp50xx/boards/ |
D | lpcxpresso11u68.overlay | 8 #include <zephyr/dt-bindings/led/led.h> 11 /* TI LP5030 LED controller connected to I2C0. */ 17 label = "LED LP5030 0"; 25 label = "LED LP5030 1"; 33 label = "LED LP5030 2"; 41 label = "LED LP5030 3"; 49 label = "LED LP5030 4"; 57 label = "LED LP5030 5"; 65 label = "LED LP5030 6"; 73 label = "LED LP5030 7"; [all …]
|
/Zephyr-Core-3.5.0/samples/boards/stm32/power_mgmt/blinky/src/ |
D | main.c | 15 static const struct gpio_dt_spec led = variable 22 __ASSERT_NO_MSG(gpio_is_ready_dt(&led)); in main() 27 gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); in main() 28 gpio_pin_set(led.port, led.pin, (int)led_is_on); in main() 31 gpio_pin_configure(led.port, led.pin, GPIO_DISCONNECTED); in main() 36 gpio_pin_configure(led.port, led.pin, GPIO_DISCONNECTED); in main()
|
/Zephyr-Core-3.5.0/dts/bindings/led/ |
D | led-controller.yaml | 4 # Common fields for LED controllers and child LEDs 7 description: LED child node 11 description: Human readable string describing the LED 15 Index of the LED on a controller. It can be used by drivers or 16 applications to map a logical LED to its real position on the 18 LEDs in an array/strip are not wired following the LED order of 23 Channel to color mapping of a multicolor LED. If a LED supports
|
D | nordic,npm1300-led.yaml | 5 Nordic nPM1300 LED controller 7 The nPM1300 has three LED outputs. 8 Each LED can automatically display error or charging status, 11 compatible: "nordic,npm1300-led" 21 description: LED 0 mode 30 description: LED 1 mode 39 description: LED 2 mode
|