1 /**************************************************************************//**
\r
3 * @brief Board Control register definitions
\r
4 * @author Energy Micro AS
\r
6 ******************************************************************************
\r
8 * <b>(C) Copyright 2009 Energy Micro AS, http://www.energymicro.com</b>
\r
9 ******************************************************************************
\r
11 * This source code is the property of Energy Micro AS. The source and compiled
\r
12 * code may only be used on Energy Micro "EFM32" microcontrollers.
\r
14 * This copyright notice may not be removed from the source code nor changed.
\r
16 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no
\r
17 * obligation to support this Software. Energy Micro AS is providing the
\r
18 * Software "AS IS", with no express or implied warranties of any kind,
\r
19 * including, but not limited to, any implied warranties of merchantability
\r
20 * or fitness for any particular purpose or warranties against infringement
\r
21 * of any proprietary rights of a third party.
\r
23 * Energy Micro AS will not be liable for any consequential, incidental, or
\r
24 * special damages, or any other relief, or for any claim by any third party,
\r
25 * arising from your use of this Software.
\r
27 *****************************************************************************/
\r
29 #ifndef __DVK_BCREGISTERS_H
\r
30 #define __DVK_BCREGISTERS_H
\r
34 /**************************************************************************//**
\r
35 * Defines FPGA register bank for Energy Micro Development Kit (DVK) board,
\r
36 * i.e. board control registers
\r
37 *****************************************************************************/
\r
38 #define BC_REGISTER_BASE 0x8c000000
\r
40 #define BC_CFG ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x00))
\r
41 #define BC_EM ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x01))
\r
42 #define BC_MAGIC ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x02))
\r
43 #define BC_LED ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x03))
\r
44 #define BC_PUSHBUTTON ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x04))
\r
45 #define BC_DIPSWITCH ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x05))
\r
46 #define BC_JOYSTICK ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x06))
\r
47 #define BC_AEM ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x07))
\r
48 #define BC_DISPLAY_CTRL ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x08))
\r
49 #define BC_EBI_CFG ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x09))
\r
50 #define BC_BUS_CFG ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0a))
\r
51 #define BC_PERCTRL ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0c))
\r
52 #define BC_AEMSTATE ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0d))
\r
53 #define BC_SPI_CFG ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0e))
\r
54 #define BC_RESET ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0f))
\r
55 #define BC_ADC_START ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x10))
\r
56 #define BC_ADC_STATUS ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x11))
\r
57 #define BC_ADC_DATA ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x12))
\r
58 #define BC_HW_VERSION ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x14))
\r
59 #define BC_FW_BUILDNO ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x15))
\r
60 #define BC_FW_VERSION ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x16))
\r
61 #define BC_SCRATCH_COMMON ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x17))
\r
62 #define BC_SCRATCH_EFM0 ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x18))
\r
63 #define BC_SCRATCH_EFM1 ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x19))
\r
64 #define BC_SCRATCH_EFM2 ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1A))
\r
65 #define BC_SCRATCH_EFM3 ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1B))
\r
66 #define BC_SCRATCH_BC0 ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1C))
\r
67 #define BC_SCRATCH_BC1 ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1D))
\r
68 #define BC_SCRATCH_BC2 ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1E))
\r
69 #define BC_SCRATCH_BC3 ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1f))
\r
70 #define BC_INTFLAG ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x20))
\r
71 #define BC_INTEN ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x21))
\r
73 /**************************************************************************//**
\r
74 * Defines bit fields for board control registers
\r
75 *****************************************************************************/
\r
76 #define BC_PERCTRL_ACCEL (1 << 0)
\r
77 #define BC_PERCTRL_AMBIENT (1 << 1)
\r
78 #define BC_PERCTRL_POTMETER (1 << 2)
\r
79 #define BC_PERCTRL_RS232A (1 << 3)
\r
80 #define BC_PERCTRL_RS232B (1 << 4)
\r
81 #define BC_PERCTRL_SPI (1 << 5)
\r
82 #define BC_PERCTRL_I2C (1 << 6)
\r
83 #define BC_PERCTRL_IRDA (1 << 7)
\r
84 #define BC_PERCTRL_ANALOG_SE (1 << 8)
\r
85 #define BC_PERCTRL_ANALOG_DIFF (1 << 9)
\r
86 #define BC_PERCTRL_AUDIO_OUT (1 << 10)
\r
87 #define BC_PERCTRL_AUDIO_IN (1 << 11)
\r
88 #define BC_PERCTRL_ACCEL_GSEL (1 << 12)
\r
89 #define BC_PERCTRL_ACCEL_SELFTEST (1 << 13)
\r
90 #define BC_PERCTRL_RS232_SHUTDOWN (1 << 14)
\r
91 #define BC_PERCTRL_IRDA_SHUTDOWN (1 << 15)
\r
93 #define BC_INTEN_PB (1 << 0)
\r
94 #define BC_INTEN_DIP (1 << 1)
\r
95 #define BC_INTEN_JOYSTICK (1 << 2)
\r
96 #define BC_INTEN_AEM (1 << 3)
\r
98 #define BC_CFG_SPI (0)
\r
99 #define BC_CFG_EBI (1)
\r
101 #define BC_MAGIC_VALUE (0xef32)
\r