P2020 GPIO Model
This section describes the P2020 GPIO device.
GPIO model simulates a 16 pin GPIO device by providing input and output via the SignalIface. Each signal can be set individually to act as input or output, according to application needs. All input ports can optionally generate an interrupt upon changing their state.
Configuration
Any device that implements SignalIface can be connected to GPIO and send signals via this interface to GPIO or receive them. GPIO implements 16 usable signals (signal 0 through 15). You can connect the signal interface as follows:
# Connect GPIO device signal 0 to device model
connect a=gpio.outSignals[0] b=mydevice:SignalIface
# Connect a device signal interface ref to GPIO device
connect a=mydevice.signal b=gpio:SignalIface[1]
// Connect GPIO device signal 0 to device model
temu_connect(gpio, "outSignals[0]", mydevice, "SignalIface");
// Connect a device signal interface ref to GPIO device
temu_connect(mydevice, "signal", gpio, "SignalIface[1]");
The GPIO programmable registers that occupy memory-mapped space are named according to P2020 QorIQ integrated processor reference manual. You can set resgisters value as follows:
# Set signal_0 as an output
gpio.GPDIR = 0x80000000;
// Set signal_0 as an output
temu_writeValueU32(gpio, "GPDIR", 0x80000000, 0);
@GPIO Reference
GPIO Reference
Properties
Name | Type | Description |
---|---|---|
Class |
*void |
Class object |
Component |
*void |
Pointer to component object if part of component |
GPDAT |
uint32_t |
|
GPDIR |
uint32_t |
|
GPICR |
uint32_t |
|
GPIER |
uint32_t |
|
GPIMR |
uint32_t |
|
GPODR |
uint32_t |
|
LoggingFlags |
uint64_t |
Flags for logging info |
Name |
*char |
Object name |
TimeSource |
*void |
Time source object |
inputData |
uint16_t |
Input data register. |
irqCtrl |
temu_IfaceRef/ <unknown> |
|
outSignals |
[temu_IfaceRef; 16]/ <unknown> |
|
outputData |
uint16_t |
Output data register. |
Interfaces
Name | Type | Description |
---|---|---|
DeviceIface |
DeviceIface |
|
MemAccessIface |
MemAccessIface |
|
ResetIface |
ResetIface |
|
SignalIface |
SignalIface |
Incomming signals |
Registers
Register support is currently experimental! |
Register Bank default
Register GPDAT
- Description
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
Field | Mask | Reset | Description |
---|---|---|---|
- |
- |
- |
- |
Register GPDIR
- Description
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
Field | Mask | Reset | Description |
---|---|---|---|
- |
- |
- |
- |
Register GPICR
- Description
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
Field | Mask | Reset | Description |
---|---|---|---|
- |
- |
- |
- |
Register GPIER
- Description
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
Field | Mask | Reset | Description |
---|---|---|---|
- |
- |
- |
- |