Firmware Library (Fwlib) - STMicroelectronics STM32 Cortex-M3 Manual

Table of Contents

Advertisement

4.3 Firmware Library (FWLib)

2
Electrocardiogram (Ecg) Signals
GPIO usage by register access.
gpioFwLib
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 3.4. The principle of
using the FWLib is easy and straight forward since the policy is equal for all peripherals. This
The Electrocardiogram (Ecg)
principle is shown here with the GPIO.
• Ecg: electrical manifestation of heart activity recorded
1. Include the FWLib to the project by adding ether the precompiled library or the uncompiled
from the body surface
c files like
stm32f10x PERIPHERAL.c
C:/Keil/ARM/RV31/LIB/ST/STM32F10x
• monitoring of heart rate
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
The Ecg signal can be recorded fairly easily with surface
Vision.
electrodes placed on the limbs and/or the chest, see pages
below.
3. Use the functions from the FWLib (like
stm32f10x stdperiph lib um.chm
The FWLib offers structures for the peripherals. This structure is created and initialized with:
GPIO InitTypeDef G P I O I n i t S t r u c t u r e ;
15
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:
G P I O I n i t S t r u c t u r e . GPIO Pin
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
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 ) ;
20
The FWLib is used in this document for the examples ADC, CAN, I C and SPI.
Josef Goette
24
. The c library files are located at
and should be added by the Keil project in the
GPIO Init()
that comes with the FWLib.
Listing 4.1: Structure creation and initialization
Listing 4.2: Setting the Properties
= GPIO Pin 5
= GPIO Mode AF PP ;
2
1 Intro
and automaticly included by
6–16
). The functions are described in the file
GPIO Pin 7 ;
2009
STM32 Cortex-M3 Tutorial
4 Peripherals

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32 Cortex-M3 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents