Offset
Name
Description
0x3C
iof_sel
I/O function select
0x40
out_xor
Output XOR (invert)
0x44
passthru_high_ie
Pass-through active-high interrupt enable
0x48
passthru_low_ie
Pass-through active-low interrupt enable
The GPIO can be configured on a bitwise fashion to represent inputs and/or outputs, as set by
the
input_en
and
output_en
registers. Writing to the
output_val
register updates the bits
regardless of the tristate value. Reading the
output_val
register returns the written value.
Reading the
input_val
register returns the actual value of the pin gated by
input_en
.
A single interrupt bit can be generated for each GPIO bit. The interrupt can be driven by rising
or falling edges, or by level values, and interrupts can be enabled for each GPIO bit individually.
Inputs are synchronized before being sampled by the interrupt logic, so the input pulse width
must be long enough to be detected by the synchronization logic.
To enable an interrupt, set the corresponding bit in the
rise_ie
and/or
fall_ie
to
1
. If the cor-
responding bit in
rise_ip
or
fall_ip
is set, an interrupt pin is raised.
Once the interrupt is pending, it will remain set until a
1
is written to the
*_ip
register at that bit.
The interrupt pins may be routed to the PLIC or directly to local interrupts.
When configured as inputs, each pin has an internal pull-up which can be enabled by software.
At reset, all pins are set as inputs, and pull-ups are disabled.
When configured as output, each pin has a software-controllable drive strength.
Table 51:
GPIO Peripheral Register Offsets. Only naturally aligned 32-bit memory accesses
are supported. Registers marked with an * are asynchronously reset to 0. All other registers are
synchronously reset to 0.
Chapter 16 General Purpose Input/Output Controller
FE310-G003 Manual
© SiFive, Inc.
Page 78
Содержание FE310-G003
Страница 1: ...SiFive FE310 G003 Manual v1p1 SiFive Inc ...