RasPi GPIO driver
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?
CBF Systems Inc.
4-038 NINT INNOVATION CENTRE
11421 SASKATCHEWAN DRIVE
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users