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 Peripherals
4.3 Firmware Library (FWLib)
b
gpioFwLib
F
GPIO usage by register access.
STMicroelectronics offers a firmware library which allows you to access to peripherals and regis-
ters easily and with a clean interface. The installation is shown in Chapter
. The principle of
using the FWLib is easy and straight forward since the policy is equal for all peripherals. This
principle is shown here with the GPIO.
1. Include the FWLib to the project by adding ether the precompiled library or the uncompiled
c files like
stm32f10x PERIPHERAL.c
. The c library files are located at
C:/Keil/ARM/RV31/LIB/ST/STM32F10x
and should be added by the Keil project in the
folder
lib
.
2. Add
#include <stm32f10x_PERIPHERAL.h>
at the begin of your main file (where
PE-
RIPHERAL
stands for the peripheral you want to use, e.g. SPI or GPIO). The header files are
located at
C:/Keil/ARM/INC/ST/STM32F10x
and automaticly included by
µ
Vision.
3. Use the functions from the FWLib (like
GPIO Init()
). The functions are described in the file
stm32f10x stdperiph lib um.chm
that comes with the FWLib.
The FWLib offers structures for the peripherals. This structure is created and initialized with:
Listing 4.1:
Structure creation and initialization
15
GPIO InitTypeDef G P I O I n i t S t r u c t u r e ;
G P I O S t r u c t I n i t (& G P I O I n i t S t r u c t u r e ) ;
The properties then are set with:
Listing 4.2:
Setting the Properties
G P I O I n i t S t r u c t u r e . GPIO Pin
= GPIO Pin 5
|
GPIO Pin 7 ;
G P I O I n i t S t r u c t u r e . GPIO Speed = GPIO Speed 50MHz ;
G P I O I n i t S t r u c t u r e . GPIO Mode
= GPIO Mode AF PP ;
20
G P I O I n i t (GPIOA, &G P I O I n i t S t r u c t u r e ) ;
The FWLib is used in this document for the examples ADC, CAN, I
2
C and SPI.
24
STM32 Cortex-M3 Tutorial