Lines Matching +full:current +full:- +full:source +full:- +full:pin
1 .. zephyr:code-sample:: blinky
3 :relevant-api: gpio_interface
12 The source code shows how to:
14 #. Get a pin specification from the :ref:`devicetree <dt-guide>` as a
16 #. Configure the GPIO pin as an output
17 #. Toggle the pin forever
19 See :zephyr:code-sample:`pwm-blinky` for a similar sample that uses the PWM API instead.
21 .. _blinky-sample-requirements:
28 #. Have an LED connected via a GPIO pin (these are called "User LEDs" on many of
37 .. zephyr-app-commands::
38 :zephyr-app: samples/basic/blinky
43 After flashing, the LED starts to blink and messages with the current LED state
50 You will see a build error at the source code line defining the ``struct
54 On GCC-based toolchains, the error looks like this:
56 .. code-block:: none
65 .. code-block:: DTS
73 compatible = "gpio-leds";
80 The above sets your board's ``led0`` alias to use pin 13 on GPIO controller
81 ``gpio0``. The pin flags :c:macro:`GPIO_ACTIVE_HIGH` mean the LED is on when
82 the pin is set to its high state, and off when the pin is in its low state.
86 - See :dtcompatible:`gpio-leds` for more information on defining GPIO-based LEDs
89 - If you're not sure what to do, check the devicetrees for supported boards which
90 use the same SoC as your target. See :ref:`get-devicetree-outputs` for details.
92 - See :zephyr_file:`include/zephyr/dt-bindings/gpio/gpio.h` for the flags you can use
95 - If the LED is built in to your board hardware, the alias should be defined in
96 your :ref:`BOARD.dts file <devicetree-in-out-files>`. Otherwise, you can
97 define one in a :ref:`devicetree overlay <set-devicetree-overlays>`.