Preliminary
...the world's most energy friendly microcontrollers
2010-04-09 - t0005_1.10
11
www.energymicro.com
#include "dvk.h"
Depending on the part number defined in your project as a build option, the DVK will default to the most
common access method for your MCU module according to part number. If you need to override the
default board control access method, you can define the access method by overriding the default with
DVK_SPI_CONTROL or DVK_EBI_CONTROL defines, such as
#define DVK_SPI_CONTROL
#include "dvk.h"
All functions in the BSP are prefixed with DVK_. The main initialization routine is defined as
void DVK_init(void);
and must be called before any access to the DVK-functions. To disable the BSP, call
void DVK_disable(void);
You can access all registers with the generic functions
void DVK_writeRegister(volatile uint16_t *addr, uint16_t data);
uint16_t DVK_readRegister(volatile uint16_t *addr);
Usable addresses for these functions, including bit fields are defined in the header file
dvk_bcregisters.h
The functions
void DVK_enablePeripheral( DVKPeripheral peri );
void DVK_disablePeripheral( DVKPeripheral peri );
can be used to toggle access/peripheral switches to all peripherals on the DVK. See the "peripheral"
example application for usage.
In addition to these main functions, full documentation of the complete API is included in the Doxygen/
HTML documentation of the installed package.
7.4 Example Applications
There are a number of example applications to illustrate the usage of the DVK API. You will find these
with their corresponding IAR Embedded Workbench and Keil MDK-ARM project files under
C:\Program Files\Energy Micro\boards\EFM32_Gxxx_DK\examples\
The examples include, among others
• blink - Simple application using the DVK and it's LED control API
• peripherals - Toggles peripherals on and off, indicated by LEDs on the board
• joystick - Use DVK LED, joystick and interrupt APIs for indicating DVK joystick movement
electronic components distributor