First my Assignment:
I'm a beginner with BSD and low level peripherals like GPIO etc., and I need to toggle Raspberry GPIO Pins from a C programme on BSD.
I am Using this BSD Image i took from here: FreeBSD - easiest way to install on my RPi? and try toggling the GPIO Pins, respectively trying to set a Pin to high by calling MMAP to access the Registers directly form C code.
I took the addresses from the BCM2835 Datasheet, Chapter 1.2.3, page 6 "physical Addresses".
Is my assumption right that it does not matter if I use Raspbian or any other OS - these physical addresses will stay the same, as they are given by the Chip?
I tested my Code as root with Raspbian and it worked fine, I also compiled the code with gcc in BSD, no errors. The programme is running as root, the system does not crash or freeze but there is nothing happening in the pins.
I also discovered there is a gpioc0 device under /dev, but i cant find how to use it. anyone any links or hints? :/
(This is part of an assignment, vital to my grade. I might have overestimated myself by choosing this.)
/dev/mem
, which presumably serves the same purpose on linux and BSD. – goldilocks Jan 23 '14 at 20:24