RasPi GPIO driver

Andrei Chichak groups at chichak.ca
Sun Oct 20 23:34:43 UTC 2013

On 2013-October-20, at 4:43 PM, Alan Cudmore <alan.cudmore at gmail.com> wrote:

> We can certainly read and write GPIO pins without POSIX support. I think Pierre was trying to create a standard driver for GPIO that might be expanded into a generic GPIO interface for all BSPs.

Gosh, how topical. I am setting up to use the STM32F407 discovery board and seem to be inventing the same stuff again. A typical BSP will get the processor running, handle ticks, and serial communication. Surely the next thing that embedded systems do is twiddle bits on the GPIO ports.

When I worked with the MC68332 I had to develop a GPIO structure, then reinvent it again for the MCF5282, and now again for the ST ARM processors. I took a look at the GPIO code for the STM32F4 in the BSP and found it opaque and without documentation, but the price was right. 

I am currently working on a register name/address definition file along the lines of that from libcpu … mcf5282.h, I found that system to be quite useful, but always wondered if it was the best way to do things.

I can see that there would be, at least, two methods of doing GPIO; memory mapped and IO port based, so perhaps a driver is called for.
> The code in Pierre's driver has the basic macros and defines to do the GPIO reads and writes. It could be used without the driver.
> But this is a good time to bring this up:
> What should the Raspberry Pi GPIO support look like in the BSP?
> 1. Simple direct reads and writes through macros or functions?
> 2. A driver such as Pierre's
> 3. Or a combination of both: Supply the driver and defines/macros and allow the user to decide what to use?
> Alan

Andrei Chichak

Systems Developer
CBF Systems Inc.
T6G 2M9

Phone: 780-628-2072
Skype: andrei.chichak

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20131020/5e94af9b/attachment-0001.html>

More information about the users mailing list