2013-01-28 12:54:44 +01:00
|
|
|
General Purpose Input and Output
|
|
|
|
|
2013-09-03 13:47:59 +02:00
|
|
|
To make MINIX more usable on embedded hardware, we need some way to access the
|
|
|
|
GPIO features of the system on a chip. Generally System on Chips (SoC) designs
|
|
|
|
provide some way to configure pads to perform basic Input/Output operations on
|
|
|
|
selected ports. These ports are also usually grouped into banks. The end
|
2013-01-28 12:54:44 +01:00
|
|
|
result is that you have a functional general input output block where you need
|
|
|
|
to configure some the following functions.
|
|
|
|
|
2013-09-03 13:47:59 +02:00
|
|
|
Functional Requirements
|
2013-01-28 12:54:44 +01:00
|
|
|
|
2013-09-03 13:47:59 +02:00
|
|
|
We envision that the short term usage of the GPIO library will be both input
|
2013-01-28 12:54:44 +01:00
|
|
|
and output handling. Input handling as we want to be able to listen to button
|
2013-09-03 13:47:59 +02:00
|
|
|
presses and generate key events, and output handling because we want to be able
|
|
|
|
to control LEDs.
|
2013-01-28 12:54:44 +01:00
|
|
|
|
|
|
|
GPIO required functionality
|
|
|
|
-Configure pins as input or output.
|
|
|
|
-Configure the impedance of the pins.
|
2013-09-03 13:47:59 +02:00
|
|
|
-Get or set the values of the pins (possibly in a single call).
|
2013-01-28 12:54:44 +01:00
|
|
|
-Configure interrupt levels for input pins.
|
2013-09-03 13:47:59 +02:00
|
|
|
-Configure debouncing of pins.
|
2013-01-28 12:54:44 +01:00
|
|
|
|
2013-09-03 13:47:59 +02:00
|
|
|
Additional kernel requirements:
|
2013-01-28 12:54:44 +01:00
|
|
|
-Manage the GPIO resources (who may access what)
|
|
|
|
-Access the GPIO pins from within driver (for the keyboard)
|
2013-09-03 13:47:59 +02:00
|
|
|
-Access the GPIO pins from within userland (for toggling LEDs)
|
2013-01-28 12:54:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
Usage:
|
2013-09-03 13:47:59 +02:00
|
|
|
You have to manually mount the gpio fs using the following command
|
2013-01-28 12:54:44 +01:00
|
|
|
|
2013-09-03 13:47:59 +02:00
|
|
|
# mkdir -p /gpio
|
2013-01-28 12:54:44 +01:00
|
|
|
# mount -t gpio none /gpio
|
|
|
|
|