General Purpose Input/Output (GPIO)
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
85
8.3.3.30
gpio_config_reg2
Name:
GPIO
Configuration Register 1
Size:
32 bits
Address offset
: 0x70
Read/write access
: read
This register is a read-only register that is present when the configuration parameter GPIO_ADD_ENCODED_PARAMS is set to True. If this
configuration is set to False, then this register reads back 0.
Bit
Name
Access
Description
31:20
Reserved
Read as zero
Reserved
19:15
ENCODED_ID_PWIDTH_D
R
The value of this register is equal to GPIO_PWIDTH_D-1.
14:10
ENCODED_ID_PWIDTH_C
R
The value of this register is equal to GPIO_PWIDTH_C-1.
9:5
ENCODED_ID_PWIDTH_B
R
The value of this register is equal to GPIO_PWIDTH_B-1.
4:0
ENCODED_ID_PWIDTH_A
R
The value of this register is equal to GPIO_PWIDTH_A-1.
8.4
Programming the GPIO
GPIO can be programmed via software registers or the GPIO low-level software driver.
8.4.1
Software Registers
The software registers are described in more details in “Registers”.
8.4.2
Programming Considerations
Reading from an unused location or unused bit sin a particular register always returns zeros. There is no error mechanism in the APB.
Programming the GPIO registers for interrupt capability, edge-sensitive or level-sensitive interrupts, and interrupt polarity should be
completed prior to enabling the interrupts on Port A/B in order to prevent spurious glitches on the interrupt lines to the interrupt
controller.
Writing to the interrupt clear register clears an edge-detected interrupt and has no effect on a level-sensitive interrupt. If, for example,
the GPIO_PORTA_INTR configuration parameter is equal to 0, then the following all read back 0:
gpio_inten
gpio_intmask
gpio_int_level
gpio_int_polarity
gpio_int_status
gpio_raw_intstatus
gpio_debounce
gpio_ls_sync
gpio_porta_eoi
When reading back registers that are no longer present due to configuration parameters settings, then 0 is read back. For example, if
APB_DATA_WITDH = 32 bits and GPIO_PWIDTH_A = 8, then the top 24 bits read back 0.
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03