Driving Beaglebone GPIO through /dev/mem

前端 未结 7 1687
温柔的废话
温柔的废话 2020-12-04 08:34

I\'m trying to write a C program for blinking a LED on the Beaglebone. I know I can use the sysfs way...but I\'d like to see if it is possible to get the same result mapping

7条回答
  •  萌比男神i
    2020-12-04 09:09

    Be careful. This works at first blush, but it directly writes to a register that the GPIO controller driver believes it owns. It will cause odd and hard to track down side effects, either on this GPIO line or on a GPIO that is in the same bank. For this to work reliably you need to disable the entire bank from the kernel GPIO driver.

提交回复
热议问题