Gpio led

Hello,
We want to connect an LED to the GPIO of Xavier NX to make the LED blink at a fixed frequency when the system starts up. How do I configure it?

hello chao.zhang,

you may toggle GPIO high/low to blink the LED.
please refer to Topic 144550, for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.
thanks

hello,JerryChang,
I used the kernel driver to control the LED flicker, not the application.
For example, configure the DTS or defconfig file to control the alternating flashing of LED indicators through pin126 GPIO

微信截图_20220630155112

hello chao.zhang,

you may refer to GPIO Changes session to check the gpio number, then you’re able to enable the gpio APIs to toggle the pin from kernel driver side.
for example,

static inline int gpio_get_value(unsigned int gpio)
{
        return __gpio_get_value(gpio);
}

static inline void gpio_set_value(unsigned int gpio, int value)
{
        __gpio_set_value(gpio, value);
}

Ok, thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.