...the world's most energy friendly microcontrollers
2010-11-12 - t0008_1.01
10
www.energymicro.com
9 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 can be fully usable without BSP support, and you can use all peripherals in the
C:\Program Files\Energy Micro\EFM32 Gecko DK\boards\EFM32_Gxxx_STK\drivers
folder without the BSP.
The BSP use EFM32 peripheral UART0 (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
under battery power will give unpredictable results.
9.1 Installation location
When installing the complete software package for the kit, the BSP will be installed under the main
installation directory, typically in a location such as
C:\Program Files\Energy Micro\EFM32 Gecko DK\boards\EFM32_Gxxx_STK\bsp\
or something similar (depending on your OS/Windows version). All files in the board support package
is prefixed by stk.
9.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);