A N 9 3
30
Rev. 1.4
2.5. Controlling GPIOs (38-Pin QFN Only)
The Si2494 and Si243939 have pins that are configurable as general-purpose I/Os. I/O pads are physically
assigned to the GPIO pins of 38-pin packages as shown in Table 25. Depending on the application, other pins may
be configured as GPIOs, but, to avoid conflicts with defined pin functions, in general, it is best to use the pins
described below. If other pins are needed as GPIOs, contact Silicon Laboratories for assistance.
Each I/O pad is controlled by a set of registers:
Port Select
—Determines that a pin is a GPIO; each Port Select register controls two adjacent I/Os. To use a
pin as a GPIO, the PSELn[5:0] bits of the corresponding register are written to zero.
Port Mode
—Configures a GPIO as open drain or push-pull output. The mode is controlled by registers 0x005C
bits 0-15 and 0x005D, bits 0-9. GPIO11 is configured by 0x005C bit 11; GPIO16 by 0x005D bit 0, and so on.
Port Latch
—Sets the output state high or low. For a GPIO input, the pin must be selected as Open Drain, and
then driven high, effectively putting it in high impedance mode. The pin status can be read even if it is in output
mode.
To configure a pin as an input, set the corresponding bit in the Port Mode register for an open drain output and the
corresponding bit in the Port Latch register for a logic 1. The same settings are used for an output in the high
impedance state.
The registers are read and written using the AT:Q and AT:W commands in conjunction with the AT*Y254 and the
AT*Y0 commands.
Example 1. Configure pin 31 as a GPIO output, Push-pull, output high:
AT*Y254
// Initiate the memory access mode
AT:W8C & C0FF
// Clear PSEL25[5:0] to make pin 31 (n=25) a GPIO
// This is the default state - may not need to clear it again
AT:W5D | 0200
// Select Push-Pull; by default it is Open Drain
AT:W5F | 0200
// Write 1 to GPIO25.
AT*Y0
// Close the memory access mode
Example 2. Configure pin 34 as a GPIO input:
AT*Y254
AT:W89 & FFC0
// Clear PSEL18[5:0], to make pin 34 (n=18) a GPIO
// This is the default state, so clearing it may not be necessary
AT:W5D & FFFB
// Select Open Drain - this is the default state
Table 25. GPIO Pin Assignments
Pin
GPIOn
n
PSELn Address
34
GPIO18
18
0x89
33
GPIO17
17
0x88
32
GPIO16
16
0x88
31
GPIO25
25
0x8C
30
GPIO24
24
0x8C
20
GPIO11
11
0x85
Содержание Si2404
Страница 2: ...AN93 2 Rev 1 4 ...
Страница 27: ...AN93 Rev 1 4 27 Figure 7 Parallel Interface Read Timing Figure 8 Parallel Interface Write Timing ...
Страница 200: ...AN93 200 Rev 1 4 Figure 31 TAM Handset and Speakerphone Voice Paths ...
Страница 201: ...AN93 Rev 1 4 201 Figure 32 Si3000 Codec Gain and Signal Selection Options ...
Страница 290: ...AN93 290 Rev 1 4 Figure 57 256 Band Spectral Display Figure 58 2048 Band Spectral Display ...
Страница 305: ...AN93 Rev 1 4 305 Figure 76 Parallel or SPI Port Interrupt Service Flowchart ...