2

I have a Model B Revision 1.0 + ECN0001 that I am making a program in C to read and control a HCTL-2022 Quadrature Decoder using the GPIOs by way of sysfs. It's working great, but now I would like to provide the a clock using one of the GPIOs alt functions, specifically GPIO4 (GPCLK0).

Is it possible to configure the pin in this way using sysfs?

I see that I can use the mmap() SET_GPIO_ALT(g,a) Macro, but I recently moved away from this in favor of sysfs in hopes of making the code a little more portable, but perhaps that was a mistake.

hoss
  • 123
  • 5

1 Answers1

3

Is it possible to configure the pin in this way using sysfs?

No. There isn't much of a kernel driver for the pi's GPIO pins. I'm surprised someone hasn't gotten around to writing one, but there you go.

making the code a little more portable

Even if there were a kernel driver to implement the functionality, this isn't, as far as I know, something that is standardized or standardizable -- the point at which you begin setting various specialized functions for the pins is the point at which the pi-as-device becomes something somewhat unique.

goldilocks
  • 60,325
  • 17
  • 117
  • 234