
EM358x
Rev. 0.4
57
When configured in input mode:
The output drivers are disabled.
An internal pull-up or pull-down resistor may be activated depending on GPIO_PxCFGH/L and GPIO_PxOUT.
The Schmitt trigger input is connected to the pin.
Reading GPIO_PxIN returns the input at the pin.
The input is also available to on-chip peripherals.
7.6.3
SWDIO Mode
The SWDIO mode is only used with PC4 when the GPIO_DEBUGDIS bit in the GPIO_DBGCFG register is set.
Normally, the SWJ interface is a forced function of PC0, PC2, PC3, and PC4 so that the SWJ interface is always
available. While the SWJ interface is being forced, the GPIO configurations of these four pins are ignored by the
chip. The SWJ interface can be disabled in its entirety to reclaim these four pins as normal GPIO by setting the
GPIO_DEBUGDIS bit. If the Serial Wire interface is desired but the JTAG interface is not, then PC4 can be
configured in the SWDIO mode while GPIO_DEBUGDIS is set and therefore the Serial Wire interface will remain
active.
7.6.4
Output Mode
Output mode provides a general purpose output under direct software control. Regardless of whether an output is
configured as push-pull or open-drain, the GPIO’s bit in the GPIO_PxOUT register controls the output. The
GPIO_PxSET and GPIO_PxCLR registers can atomically set and clear bits within GPIO_PxOUT register. These
set and clear registers simplify software using the output port because they eliminate the need to disable
interrupts to perform an atomic read-modify-write operation of GPIO_PxOUT.
When configured in output mode:
The output drivers are enabled and are controlled by the value written to GPIO_PxOUT:
In open-drain mode: 0 activates the N-MOS current sink; 1 tri-states the pin.
In push-pull mode: 0 activates the N-MOS current sink; 1 activates the P-MOS current source.
The internal pull-up and pull-down resistors are disabled.
The Schmitt trigger input is connected to the pin.
Reading GPIO_PxIN returns the input at the pin.
Reading GPIO_PxOUT returns the last value written to the register.
Note:
Depending on configuration and usage, GPIO_PxOUT and GPIO_PxIN may not have the same value.
7.6.5
Alternate Output Mode
In this mode, the output is controlled by an on-chip peripheral instead of GPIO_PxOUT and may be configured as
either push-pull or open-drain. Most peripherals require a particular output type – TWI requires an open-drain
driver, for example – but since using a peripheral does not by itself configure a pin, the GPIO_PxCFGH/L
registers must be configured properly for a peripheral’s particular needs. As described in the Configuration
section, when more than one peripheral can be the source of output data, registers in addition to
GPIO_PxCFGH/L determine which to use.
When configured in alternate output mode:
The output drivers are enabled and are controlled by the output of an on-chip peripheral:
In open-drain mode: 0 activates the N-MOS current sink; 1 tri-states the pin.
In push-pull mode: 0 activates the N-MOS current sink; 1 activates the P-MOS current source.
The internal pull-up and pull-down resistors are disabled.
The Schmitt trigger input is connected to the pin.
Reading GPIO_PxIN returns the input to the pin.
Note:
Depending on configuration and usage, GPIO_PxOUT and GPIO_PxIN may not have the same value.
7.6.6
Alternate Output SPI Slave MISO Mode
This configuration mode is reserved for pins PB1 (SC1MISO) or PA1 (SC2MISO) when the associated serial
controller is configured as an SPI slave. This configuration cannot be used with any other pins. This mode tri-
Содержание EMBER EM358 series
Страница 2: ...EM358x 2 Rev 0 4 ...
Страница 7: ...EM358x Rev 0 4 7 ...