To #2, Might be a bit late to the party, but the pin # is the GPIO port * 32 + bit, e.g. GPIO2_7 is pin 71 : 2 * 32 + 7 The datasheet shows GPIO2_7 being header P8 pin 46.
Reversing, the output tells you e.g. pin 60 (44e108f0): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 60, so... 60/32 = 1.875, so we know this is GPIO1, less the GPIO port from the pin: 60-(1*32) to get the GPIO bit of 28. GPIO1_28 on the datasheet says header P9, pin 12 On Tuesday, 21 May 2013 11:49:02 UTC-7, [email protected] wrote: > > Ok, the first project I'll be doing with the board will not require > changing the pin modes on the fly, so changing the modes on boot should be > sufficient. Presumably, then, if I edit the am335x-bone-common.dtsi file to > add in the pin configurations required, and compile it to a new > am335x-boneblack.dtb file, place that into /boot, and have the required > pins set up. > > The pinmux section in am335x-bone-common.dtsi is currently: > am33xx_pinmux: pinmux@44e10800 { > pinctrl-names = "default"; > pinctrl-0 = <&userled_pins>; > > userled_pins: pinmux_userled_pins { (1) > pinctrl-single,pins = < > 0x54 0x7 /* gpmc_a5.gpio1_21, OUTPUT | MODE7 */ > 0x58 0x17 /* gpmc_a6.gpio1_22, OUTPUT_PULLUP | MODE7 */ > 0x5c 0x7 /* gpmc_a7.gpio1_23, OUTPUT | MODE7 */ > 0x60 0x17 /* gpmc_a8.gpio1_24, OUTPUT_PULLUP | MODE7 */ > >; > }; > i2c0_pins: pinmux_i2c0_pins { > pinctrl-single,pins = < > 0x188 0x70 /* i2c0_sda, SLEWCTRL_SLOW | INPUT_PULLUP | > MODE0 */ > 0x18c 0x70 /* i2c0_scl, SLEWCTRL_SLOW | INPUT_PULLUP | > MODE0 */ > >; > }; > i2c2_pins: pinmux_i2c2_pins { > pinctrl-single,pins = < > 0x178 0x73 /* uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | > INPUT_PULLUP | MODE3 */ > 0x17c 0x73 /* uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | > INPUT_PULLUP | MODE3 */ > >; > }; > }; > > A few questions, assuming this is the correct approach: > 1. I've added a (1) as a marker. In the case of the line referenced by > (1), the LED pins are referenced. In every example I've seen, there's a > reference to a set of pins in this line. However, I'm not sure what to put > in this line if I want to set the mode of general GPIO pins. > 2. I know that the first hex address (eg 0x54) references the pin, by > adding this address to 44e10800 and finding the pin number from the > contents of /sys/kernel/debug/pinctrl/44e10800.pinmux. However, I'm not > sure how the pin number in /sys/kernel/debug/pinctrl/44e10800.pinmux maps > to the physical pins in the P8/P9 headers. I've not been able to find any > reference to this (though I may be searching in the wrong places). > > I think that's all. Any pointers? > > On Monday, 20 May 2013 21:06:56 UTC+1, [email protected] wrote: >> >> Hi everyone, >> I've just started investigating the GPIO pins on my Beaglebone Black. >> I've written a quick C++ program to flash the LEDs, but ran into a problem >> when trying to investigate the main P8 and P9 expansion headers. Watching >> Derek Molloy's excellent set of video >> tutorials<http://www.youtube.com/watch?v=SaIpz00lE84>on the BBW shows how to >> set the mode of the GPIO pins on that board, but >> the same method does not work on the BBB, due to not having the omap_mux >> directory. The GPIO pins still have different functions depending on what >> mode they're set to, so the functionality must still exist, but thus far I >> have been unable to find any reference to mode setting. >> >> Thanks, >> Chris. >> > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
