...the world's most energy friendly microcontrollers
2012-05-31 - t0014_0.11
13
www.energymicro.com
8 Board Support Package
The Board Support Package (BSP) is a set of C source and header files that enables easy access to,
and control over some board specific features.
Compared to the Energy Micro development kit, the functionality is limited. Unless you need/want some
of the functions contained in the BSP, there is really no need to include or use it. The EFM32 in the Starter
Kit is fully usable without BSP support, and you can use all peripherals in the emlib without the BSP.
The BSP use EFM32 peripheral UART0, Location 1 (TX pin PE0, RX pin PE1) on baudrate 115200-8-
N-1 to communicate with the board controller.
Note
The BSP is only functional when the Starter Kit is USB-powered, using these function calls
with USB disconnected will give unpredictable results.
8.1 Installation location
When installing Simplicity Studio, the BSP will be installed in the user directory, typically in a location
such as
Win7: C:\Users\[username]\AppData\Roaming\energymicro\kits\EFM32GG_STK3700\
or something similar (depending on your OS/Windows version). All files in the board support package
are prefixed by stk.
8.2 Application Programming Interface
To use the BSP, include the Starter Kit header file, like this:
#include "stk.h"
All functions in the BSP are prefixed with STK_. The main initialization routine is defined as
void STK_Init(void);
and must be called before any access to the STK-functions. This function call will setup the UART
communication channel with a 115800 baud rate. This baud rate depends on the current core clock, so
correct clock configuration should be set before calling this function.
bool STK_Ready(void)
Returns true if the board controller is responding. A non-responding board will either return false, or
hang (i.e. if the EFM32 is powered by the CR2032 battery cell).
float STK_Current(void);
Returns instant current usage in milliamperes.
float STK_Voltage(void);
Returns instant voltage (VMCU) reading in volt.
bool STK_EnergyMode(uint8_t em);
Informs the board controller about the Energy Mode (sleep mode) we are going into. This information
can be used by the board controller to present a richer visual graph for illustrating what the EFM32 is
currently doing.
Содержание EFM32 Giant Gecko Starter Kit
Страница 31: ......