Try using
#define GPIO *((volatile unsigned long *)0x44e...)

On Sunday, May 5, 2013 4:47:00 AM UTC+5:30, ky...@cranehome.info wrote:
>
> If been able to find a couple of libraries that deal with GPIO on the 
> BeagleBone.  I have tried to compile and execute them on the BeagleBone 
> Black but have had no success thus far. One library is a C library and 
> tries to set the MUX via the now missing omap_mux file and fails at that 
> point.  It's mimicking the Arduino style DigitalWrite syntax.  The other 
> one is a C++ library that appears to try to access the MUX settings through 
> memory as well. 
>
> Both Libraries seem to have a base address for the GPIO pins as*:*
>
> *#define GPIO0   (0x44E07000)#define GPIO1   (0x4804C000)#define GPIO2   
> (0x481AC000)#define GPIO3   (0x481AE000)* 
>
> The control register base seems to be set as this:
> const unsigned long Beagle_GPIO::GPIO_Control_Module_Registers = 
> 0x44E10000;
>
>
> This is the C++ library I found.
> https://github.com/majestik666/Beagle_GPIO/blob/master/Beagle_GPIO.cc
>
> and was able to compile it but had to add: 
> #include <unistd.h>
> to the Beagle_GPIO.hh to cover the use of usleep in several places before 
> it succeeds in building.  Running the test executable however results in:
>
> root@beaglebone:~/downloads/Beagle_GPIO-master# ./Beagle_GPIO_test 
> [GPIO] : Beagle_GPIO::Beagle_GPIO()
> [GPIO] : Opening /dev/mem
> [GPIO] : Beagle GPIO Initialized
> [GPIO] : ====================
> [GPIO] : BeagleBone GPIO Test
> [GPIO] : ====================
> [GPIO] : Configuring Pin P8_46 as Output
> Bus error
>
> So the error suggests that something about the addressing is not right. 
>  Has the BBB new processor changed the memory map locations around?
>
> I'm just searching for a way that allows me to use the GPIO pins in a 
> straight-forward way.  I have several C/C++ programs I have been using on 
> the RaspberryPi and wanted to port over to the BeagleBone Black but they 
> need to have access to the GPIO pins.  At present I have no option it seems 
> to move forward with this since file operations on exported pins is not 
> going to cut it for my needs.  
>

-- 
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 beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to