Hardware Reference
In-Depth Information
The values shown in the table's Code column are used in the configuration register
itself. The alternate function numbers are listed in the ALT column. Keeping these two
straight can be confusing when programming. Once the function has been selected, the
configuration is then fine-tuned according to its peripheral type.
Output Pins
When a pin is configured for output, the remaining elements of configuration consist of
the following:
Logic sense
Output state
The output state of the GPIO pins can either be set by the kernel as a 32-bit word
(affects 32 GPIOs at a time) or individually set or cleared. Having individual set/clear
operations allows the host to change individual bits without disturbing the state of others
(or having to know their state).
Input Pins
Input pins are more complex because of the additional hardware functionality offered.
This requires that the input GPIO pin be configured for the following:
Detect rising input signals (synchronous/asynchronous)
Detect falling input signals (synchronous/asynchronous)
Detect high-level signals
Detect low-level signals
Logic sense
Interrupt handling (handled by driver)
Choose no pull-up; use a pull-up or pull-down resistor
Once these choices have been made, it is possible to receive data related to input
signal changes, or simply query the pin's current state.
Alternate Function
When an alternate function such as the UART is chosen, many aspects of the pin's
configuration are predetermined. Despite this, each pin used by the peripheral should
be preconfigured for input or output according to its function. These details are normally
provided by the supporting driver.
 
Search WWH ::




Custom Search