mike scott(deleted)
|
how to set Pinmux for GPIO pins with BeagleBone Black
|
mike scott(deleted)
02/22/2018 3:36 AM
post118609
|
how to set Pinmux for GPIO pins with BeagleBone Black
Hi QNX,
QNX Momentics IDE 6.5 SP1
beaglebone black BSP: bsp-nto650-ti-beaglebone-sp1-trunk-201209071340.zip
I am confused on the default GPIO setup of BBB. The output voltage of various GPIO pins are apparently different, for
example, P9_15 (GPIO1_16) is 1.65v, while P9_12 (GPIO1_28) is 3.10v and P8_12 (GPIO1_12) is grounded.
/bsp-ti-beaglebone-src/src/hardware/startup/boards/beaglebone/init_pinmux.c only setups LEDs with mode(7). no other GPIO
pins have been populated.
I saw other colleague was trying to setup more gpio properties, such as in
http://community.qnx.com/sf/discussion/do/listPosts/projects.core_os/discussion.newcode.topc24286
// The register that I want to use as gpio (conf_gpmc_ad12) is located at the address 0x0830,
// so I will map the memory from AM335X_CTRL_BASE addresss to AM335X_CTRL_BASE+0x0840
ptr = (uintptr_t)mmap_device_memory(0, AM335X_CTRL_BASE+0x0840, PROT_READ | PROT_WRITE | PROT_NOCACHE, 0,
AM335X_CTRL_BASE);
// I set conf_gpmc_ad12 in MODE 7 to enable the pin as GPIO1_12
out32(ptr + conf_gpmc_ad12, MODE(7) | PULLUDEN | PULLUP_EN | RXACTIVE | SLEWCTRL);
Below are questions I really do not understand:
1. why conf_gpmc_ad12 address 0x0830, but mmap_device_memory to AM335X_CTRL_BASE+0x0840?
2. is it necessary to indicate extra properties (such as PULLUDEN | PULLUP_EN | RXACTIVE | SLEWCTRL etc), since LEDs in
init_pinmux.c were only named MODE(7).
3. is it the right way to configure gpio pin properties in the application program? Though I am more prefer to modify
the init_pinmux.c in the BSP fold.
Please advise, thanks in advance.
Mike
|
|
|