4.5 General Purpose Input/Output (GPIO)
1 Intro
2
Electrocardiogram (
Ecg
) Signals
The Electrocardiogram (
Ecg
)
•
Ecg
: electrical manifestation of heart activity recorded
from the body surface
•
monitoring of heart rate
The
Ecg
signal can be recorded fairly easily with surface
electrodes placed on the limbs and/or the chest, see pages
6
–
16
below.
Josef Goette
2
2009
4.5.2 Driver
General-purpose and alternate-function I/Os (GPIOs and AFIOs)
RM0008
96/682
Figure 9.
Basic structure of a standard I/O port bit
Figure 10.
Basic structure of a five-volt tolerant I/O port bit
1.
V
DD_FT
is a potential specific to five-volt tolerant I/Os and different from V
DD
.
Alternate Function Output
Alternate Function Input
Push-pull,
open-drain or
disabled
Inpu
t dat
a regi
st
er
Ou
tpu
t dat
a reg
ist
e
r
Read/write
From on-chip
peripheral
To on-chip
peripheral
Output
control
Analog Input
on/off
on/off
I/O pin
V
DD
V
DD
V
SS
V
SS
TTL Schmitt
trigger
V
SS
V
DD
Protection
diode
Protection
diode
on/off
Input driver
Output driver
P-MOS
N-MOS
Read
B
it s
e
t/
re
se
t reg
ist
e
rs
Write
ai14781
Alternate Function Output
Alternate Function Input
Push-pull,
open-drain or
disabled
Inpu
t dat
a regi
st
er
Ou
tpu
t dat
a reg
ist
e
r
Read/write
From on-chip
peripheral
To on-chip
peripheral
Output
control
Analog Input
on/off
on/off
I/O pin
V
DD
V
DD
V
SS
V
SS
TTL Schmitt
trigger
V
SS
V
DD_FT
(1)
Protection
diode
on/off
Input driver
Output driver
P-MOS
N-MOS
Read
B
it s
e
t/
re
se
t reg
ist
e
rs
Write
ai14782
Figure 4.2:
GPIO driver
4.5.3 Set Output
Listing 4.4:
Set Output
GPIOB
−
>
ODR = ( GPIOB
−
>
ODR & 0 xFFFF0000 )
|
yourValue ;
// puts yourValue on
GPIOB
4.5.4 Read Input
Listing 4.5:
Read Input
i np ut = (GPIOA
−
>
IDR & 0 x0000FFFF ) ;
// read i n p u t s on GPIOA
Lukas Kohler
27