Home > OS >  Driving leds - gpio doubts about the Linux system
Driving leds - gpio doubts about the Linux system

Time:09-26

Good god:
I just contact with Linux system, based on the device tree drive have some doubts, please help solve. I this several days in the Linux leds - gpio. C the driver file. But compared to the platform platform bus driver, I am the leds - gpio. Based on the device tree c drive the following don't understand:
1. Leds - gpio. C need to fill in file_operations? I didn't find complete file_operations.
2. How do the application layer through the read and write functions interact with the LED driver?
Don't echo 0 & gt;/sys/bus/platform/devices/leds - gpio/leds/green/brightness
Echo 0 & gt;/sys/bus/platform/devices/leds - gpio/leds/red/brightness
Echo 1 & gt;/sys/bus/platform/devices/leds - gpio/leds/green/brightness
Echo 1 & gt;/sys/bus/platform/devices/leds - gpio/leds/red/brightness of these methods.
3. Why do some peripheral access is to use device nodes such as/dev/ttySX, peripherals that need to access the/sys/class/leds/user - ledX, what's the difference?

CodePudding user response:

  • Related