Thank you @JerryChang
I have followed the step in the link you mention above jetson-gpio
But when I run the sample_out.py I got this error Exception: Cannot find GPIO chip 3160000.i2c/i2c-0/0-0074
I need to mention that I am using the orbitty carrier board with the TX2.
please visit Jetson Linux | NVIDIA Developer to download L4T Driver Package (BSP) Sources.
you should also check Kernel Customization chapter for setting up build environment and compile your own kernel image.
you may refer to some standard APIs to access GPIOs from kernel side.
for example, $L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/kernel/kernel-4.9/include/linux/gpio.h
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);
}
dear @JerryChang
Thank you for your answer. This seems to be more complicated than I expected.
I just want to control RGB LED common anode with the TX2 Orbitty carrier board and I do not find any solution to control the RGB led using python.
Do you have any other advice? or Shall I build my own kernel as the only solution?