|
| 1 | +# GPIO HWIP Technical Specification |
| 2 | + |
| 3 | +[`gpio`](https://reports.opentitan.org/hw/ip/gpio/dv/latest/report.html): |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +# Overview |
| 10 | + |
| 11 | +This document specifies GPIO hardware IP functionality. This |
| 12 | +module conforms to the [Comportable guideline for peripheral device |
| 13 | +functionality](../../../../doc/contributing/hw/comportability/README.md) |
| 14 | +See that document for integration overview within the broader top |
| 15 | +level system. |
| 16 | + |
| 17 | +## Features |
| 18 | + |
| 19 | +- 32 GPIO ports |
| 20 | +- Configurable interrupt per GPIO for detecting rising edge, falling edge, |
| 21 | + or active low/high input |
| 22 | +- Two ways to update GPIO output: direct-write and masked (thread-safe) update |
| 23 | + |
| 24 | +## Description |
| 25 | + |
| 26 | +The GPIO block allows software to communicate through general purpose I/O |
| 27 | +pins in a flexible manner. Each of 32 independent bits can be written |
| 28 | +as peripheral outputs in two modes. Each of the 32 bits can be read |
| 29 | +by software as peripheral inputs. How these peripheral inputs and |
| 30 | +outputs are connected to the chip IO is not within the scope of this |
| 31 | +document. See the Comportability Specification for peripheral IO options |
| 32 | +at the top chip level. |
| 33 | + |
| 34 | +In the output direction, this module provides direct 32b access to each |
| 35 | +GPIO value using direct write. This mode allows software to control all |
| 36 | +GPIO bits simultaneously. Alternately, this module provides masked writes |
| 37 | +to half of the bits at a time, allowing software to affect the output |
| 38 | +value of a subset of the bits without requiring a read-modify-write. |
| 39 | +In this mode the user provides a mask of which of the 16 bits are to be |
| 40 | +modified, along with their new value. The details of this mode are given |
| 41 | +in the [Programmers Guide](#programmers-guide) below. |
| 42 | + |
| 43 | +In the input direction, software can read the contents of any of the GPIO |
| 44 | +peripheral inputs. In addition, software can request the detection of an |
| 45 | +interrupt event for any of the 32 bits in a configurable manner. The choices |
| 46 | +are positive edge, negative edge or level detection events. A noise |
| 47 | +filter is available through configuration for any of the 32 GPIO inputs. |
| 48 | +This requires the input to be stable for 16 cycles of the |
| 49 | +module clock before the input register reflects the change and interrupt |
| 50 | +generation is evaluated. Note that if the filter is enabled and the pin |
| 51 | +is set to output then there will be a corresponding delay in a change |
| 52 | +in output value being reflected in the input register. |
| 53 | + |
| 54 | +See the Design Details section for more details on output, input, and |
| 55 | +interrupt control. |
0 commit comments