Driving Beaglebone GPIO through /dev/mem

前端 未结 7 1702
温柔的废话
温柔的废话 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条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 09:18

    REF: madscientist159

    // OE: 0 is output, 1 is input
    #define GPIO_OE 0x14d
    #define GPIO_IN 0x14e
    #define GPIO_OUT 0x14f
    should be
    // OE: 0 is output, 1 is input
    #define GPIO_OE 0x4d
    #define GPIO_IN 0x4e
    #define GPIO_OUT 0x4f
    

    unsigned int offset address derived from the unsigned char address

提交回复
热议问题