1 /**************************************************************************//**
\r
3 * @brief Board Control register definitions
\r
5 ******************************************************************************
\r
7 * <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
\r
8 *******************************************************************************
\r
10 * This file is licensed under the Silabs License Agreement. See the file
\r
11 * "Silabs_License_Agreement.txt" for details. Before using this software for
\r
12 * any purpose, you must agree to the terms of that agreement.
\r
14 ******************************************************************************/
\r
18 #ifndef __BSP_DK_BCREG_3201_H
\r
19 #define __BSP_DK_BCREG_3201_H
\r
23 /***************************************************************************//**
\r
26 ******************************************************************************/
\r
28 /***************************************************************************//**
\r
29 * @addtogroup BSP_DK API for DK's
\r
31 ******************************************************************************/
\r
37 /**************************************************************************//**
\r
38 * Defines FPGA register bank for Energy Micro Development Kit board,
\r
39 * i.e. board control registers
\r
40 *****************************************************************************/
\r
41 #define BC_REGISTER_BASE 0x80000000 /**< Board Controller registers base address */
\r
42 #define BC_SSD2119_BASE 0x84000000 /**< TFT-LCD controller */
\r
43 #define BC_PSRAM_BASE 0x88000000 /**< PSRAM base address */
\r
44 #define BC_FLASH_BASE 0x8C000000 /**< External Flash base address */
\r
47 /**************************************************************************//**
\r
48 * Defines bit fields for board control registers
\r
49 *****************************************************************************/
\r
51 /* Define registers in a similar manner to CMSIS standards */
\r
52 /** Read/Write board controller register */
\r
53 #define __IO volatile
\r
55 /** Board Controller Register definiton */
\r
58 __IO uint16_t RESERVERD0; /**< 0x00 - Reserved */
\r
59 __IO uint16_t EM; /**< 0x02 - Energy Mode indicator */
\r
60 __IO uint16_t MAGIC; /**< 0x04 - Should always read 0xEF32 */
\r
62 __IO uint16_t UIF_LEDS; /**< 0x06 - On board LEDs */
\r
63 __IO uint16_t UIF_PB; /**< 0x08 - Push button PB0-PB4 status */
\r
64 __IO uint16_t UIF_DIP; /**< 0x0A - DIP switch status */
\r
65 __IO uint16_t UIF_JOYSTICK; /**< 0x0C - Joystick presses */
\r
66 __IO uint16_t UIF_AEM; /**< 0x0E - AEM button */
\r
67 __IO uint16_t UIF_CTRL; /**< 0x10 - CPLD control register */
\r
68 __IO uint16_t DISPLAY_CTRL; /**< 0x12 - SSD2119 TFT display control */
\r
69 __IO uint16_t EBI_CTRL; /**< 0x14 - Extended Address Mode control */
\r
70 __IO uint16_t ARB_CTRL; /**< 0x16 - Arbiter control, board control or EFM32GG access to display */
\r
71 __IO uint16_t PERICON; /**< 0x18 - Peripheral Control, on board switches */
\r
72 __IO uint16_t SPI_DEMUX; /**< 0x1A - SPI DEMUX */
\r
73 __IO uint16_t RESERVERD1[0x02]; /**< 0x1C - Reserved */
\r
75 __IO uint16_t ADC_WRITE; /**< 0x20 - AEM ADC SPI interface */
\r
76 __IO uint16_t ADC_STATUS; /**< 0x22 - AEM ADC SPI interface */
\r
77 __IO uint16_t ADC_READ; /**< 0x24 - AEM ADC SPI interface */
\r
79 __IO uint16_t CLKRST; /**< 0x26 - Clock and reset control */
\r
81 __IO uint16_t HW_VERSION; /**< 0x28 - Hardware version */
\r
82 __IO uint16_t FW_BUILDNO; /**< 0x2A - Firmware build number */
\r
83 __IO uint16_t FW_VERSION; /**< 0x2C - Firmware version */
\r
85 __IO uint16_t SCRATCH_COMMON; /**< 0x2E - Shared register between board controller and EFM32 */
\r
87 __IO uint16_t SCRATCH_EFM0; /**< 0x30 - EFM32 accessible registers */
\r
88 __IO uint16_t SCRATCH_EFM1; /**< 0x32 */
\r
89 __IO uint16_t SCRATCH_EFM2; /**< 0x34 */
\r
90 __IO uint16_t SCRATCH_EFM3; /**< 0x36 */
\r
92 __IO uint16_t SCRATCH_BC0; /**< 0x38 - Board Control registers */
\r
93 __IO uint16_t SCRATCH_BC1; /**< 0x3A */
\r
94 __IO uint16_t SCRATCH_BC2; /**< 0x3C */
\r
95 __IO uint16_t SCRATCH_BC3; /**< 0x3E */
\r
97 __IO uint16_t INTFLAG; /**< 0x40 - Interrupt Status flags */
\r
98 __IO uint16_t INTEN; /**< 0x42 - Interrupt Enable flags */
\r
99 __IO uint16_t INTCLEAR; /**< 0x44 - Interrupt clear */
\r
100 __IO uint16_t INTSET; /**< 0x46 - Interrupt set */
\r
101 __IO uint16_t INTPCTRL; /**< 0x48 - Interrupt pulse control */
\r
102 __IO uint16_t INTPLOW; /**< 0x4A - Interrupt puls low period */
\r
103 __IO uint16_t INTPHIGH; /**< 0x4C - Interrupt puls high period */
\r
105 __IO uint16_t RESERVERD3[0x19]; /**< 0x50 - Reserved */
\r
107 __IO uint16_t BC_MBOX_TXCTRL; /**< 0x80 - BC <-> EFM32 communication channel */
\r
108 __IO uint16_t BC_MBOX_TXDATA; /**< 0x82 */
\r
109 __IO uint16_t BC_MBOX_TXSTATUS0; /**< 0x84 */
\r
110 __IO uint16_t BC_MBOX_TXSTATUS1; /**< 0x86 */
\r
112 __IO uint16_t RESERVED4[0x0d]; /**< 0xa0 - Reserved */
\r
114 __IO uint16_t MBOX_TXCTRL; /**< 0xa2 - BC <-> EFM32 communication channel */
\r
115 __IO uint16_t MBOX_TXDATA; /**< 0xa4 */
\r
116 __IO uint16_t MBOX_TXSTATUS0; /**< 0xa6 */
\r
117 __IO uint16_t MBOX_TXSTATUS1; /**< 0xa8 */
\r
119 __IO uint16_t RESERVED5[0x0b]; /**< 0xaa - Reserved */
\r
121 __IO uint16_t BUF_CTRL; /**< 0xc0 - Buffer Controller Control */
\r
124 /* Cast into register structure */
\r
125 #define BC_REGISTER ((BC_TypeDef *) BC_REGISTER_BASE) /**< Register block base */
\r
127 /* Energy Mode indicator */
\r
128 #define BC_EM_EM0 (0) /**< Indicate EM0 */
\r
129 #define BC_EM_EM1 (1) /**< Indicate EM1 */
\r
130 #define BC_EM_EM2 (2) /**< Indicate EM2 */
\r
131 #define BC_EM_EM3 (3) /**< Indicate EM3 */
\r
132 #define BC_EM_EM4 (4) /**< Indicate EM4 */
\r
135 #define BC_MAGIC_VALUE (0xef32) /**< Magic */
\r
137 /* Push buttons, PB1-PB4 */
\r
138 #define BC_UIF_PB_MASK (0x000f) /**< Push button mask */
\r
139 #define BC_UIF_PB1 (1 << 0) /**< Push button PB1 */
\r
140 #define BC_UIF_PB2 (1 << 1) /**< Push button PB2 */
\r
141 #define BC_UIF_PB3 (1 << 2) /**< Push button PB3 */
\r
142 #define BC_UIF_PB4 (1 << 3) /**< Push button PB4 */
\r
145 #define BC_DIPSWITCH_MASK (0x000f) /**< Dip switch mask */
\r
147 /* Joystick directions */
\r
148 #define BC_UIF_JOYSTICK_MASK (0x001f) /**< Joystick mask */
\r
149 #define BC_UIF_JOYSTICK_DOWN (1 << 0) /**< Joystick down */
\r
150 #define BC_UIF_JOYSTICK_RIGHT (1 << 1) /**< Joystick right */
\r
151 #define BC_UIF_JOYSTICK_UP (1 << 2) /**< Joystick up */
\r
152 #define BC_UIF_JOYSTICK_LEFT (1 << 3) /**< Joystick left */
\r
153 #define BC_UIF_JOYSTICK_CENTER (1 << 4) /**< Joystick center button */
\r
156 #define BC_UIF_AEM_BC (0) /**< AEM button state, BC controls buttons */
\r
157 #define BC_UIF_AEM_EFM (1) /**< AEM button state, EFM32 controls buttons */
\r
159 /* Display control */
\r
160 #define BC_DISPLAY_CTRL_RESET (1 << 1) /**< Reset */
\r
161 #define BC_DISPLAY_CTRL_POWER_ENABLE (1 << 0) /**< Display Control Power and Backlight Enable */
\r
162 #define BC_DISPLAY_CTRL_MODE_SHIFT 2 /**< Bit offset value for Display_Mode setting */
\r
163 #define BC_DISPLAY_CTRL_MODE_8080 (0 << BC_DISPLAY_CTRL_MODE_SHIFT) /**< Address mapped mode */
\r
164 #define BC_DISPLAY_CTRL_MODE_GENERIC (1 << BC_DISPLAY_CTRL_MODE_SHIFT) /**< Direct Drive + SPI mode */
\r
166 /* EBI control - extended address range enable bit */
\r
167 #define BC_EBI_CTRL_EXTADDR_MASK (0x0001) /**< Enable extended addressing support */
\r
169 /* Arbiter control - directs access to display controller */
\r
170 #define BC_ARB_CTRL_SHIFT 0 /**< Bit offset value for ARB_CTRL setting */
\r
171 #define BC_ARB_CTRL_BC (0 << BC_ARB_CTRL_SHIFT) /**< BC drives display */
\r
172 #define BC_ARB_CTRL_EBI (1 << BC_ARB_CTRL_SHIFT) /**< EFM32GG EBI drives display, memory mapped or direct drive */
\r
173 #define BC_ARB_CTRL_SPI (2 << BC_ARB_CTRL_SHIFT) /**< EFM32GG SPI drives display */
\r
175 /* Interrupt flag registers, INTEN and INTFLAG */
\r
176 #define BC_INTEN_MASK (0x001f) /**< Interrupt enable mask */
\r
177 #define BC_INTEN_PB (1 << 0) /**< Push Button Interrupt enable */
\r
178 #define BC_INTEN_DIP (1 << 1) /**< DIP Switch Interrupt enable */
\r
179 #define BC_INTEN_JOYSTICK (1 << 2) /**< Joystick Interrupt enable */
\r
180 #define BC_INTEN_AEM (1 << 3) /**< AEM Interrupt enable */
\r
181 #define BC_INTEN_ETH (1 << 4) /**< Ethernet Interrupt enable */
\r
183 #define BC_INTFLAG_MASK (0x001f) /**< Interrupt flag mask */
\r
184 #define BC_INTFLAG_PB (1 << 0) /**< Push Button interrupt triggered */
\r
185 #define BC_INTFLAG_DIP (1 << 1) /**< DIP interrupt triggered */
\r
186 #define BC_INTFLAG_JOYSTICK (1 << 2) /**< Joystick interrupt triggered */
\r
187 #define BC_INTFLAG_AEM (1 << 3) /**< AEM Interrupt triggered */
\r
188 #define BC_INTFLAG_ETH (1 << 4) /**< Ethernet Interrupt triggered */
\r
190 /* Peripheral control registers */
\r
191 #define BC_PERICON_RS232_SHUTDOWN_SHIFT 13 /**< RS232 enable MUX bit */
\r
192 #define BC_PERICON_RS232_UART_SHIFT 12 /**< UART enable */
\r
193 #define BC_PERICON_RS232_LEUART_SHIFT 11 /**< LEUART enable */
\r
194 #define BC_PERICON_I2C_SHIFT 10 /**< I2C enable */
\r
195 #define BC_PERICON_I2S_ETH_SEL_SHIFT 9 /**< I2S/ETH/TFT SPI enable */
\r
196 #define BC_PERICON_I2S_ETH_SHIFT 8 /**< I2S/ETH mux select */
\r
197 #define BC_PERICON_TRACE_SHIFT 7 /**< ETM Trace enable */
\r
198 #define BC_PERICON_TOUCH_SHIFT 6 /**< Touch enable */
\r
199 #define BC_PERICON_AUDIO_IN_SHIFT 5 /**< Audio In enable */
\r
200 #define BC_PERICON_AUDIO_OUT_SEL_SHIFT 4 /**< Audio Out I2S/DAC select */
\r
201 #define BC_PERICON_AUDIO_OUT_SHIFT 3 /**< Audio Out enable */
\r
202 #define BC_PERICON_ANALOG_DIFF_SHIFT 2 /**< Analog Diff enable */
\r
203 #define BC_PERICON_ANALOG_SE_SHIFT 1 /**< Anallog SE enable */
\r
204 #define BC_PERICON_SPI_SHIFT 0 /**< Micro-SD SPI enable */
\r
206 /* SPI DEMUX control */
\r
207 #define BC_SPI_DEMUX_SLAVE_MASK (0x0003) /**< Mask for SPI MUX bits */
\r
208 #define BC_SPI_DEMUX_SLAVE_AUDIO (0) /**< SPI interface to I2S Audio */
\r
209 #define BC_SPI_DEMUX_SLAVE_ETHERNET (1) /**< SPI interface to Ethernet controller */
\r
210 #define BC_SPI_DEMUX_SLAVE_DISPLAY (2) /**< SPI interface to TFT-LCD-SSD2119 controller */
\r
213 #define BC_ADC_STATUS_DONE (0) /**< ADC Status Done */
\r
214 #define BC_ADC_STATUS_BUSY (1) /**< ADC Status Busy */
\r
216 /* Clock and Reset Control */
\r
217 #define BC_CLKRST_FLASH_SHIFT (1 << 1) /**< Flash Reset Control */
\r
218 #define BC_CLKRST_ETH_SHIFT (1 << 2) /**< Ethernet Reset Control */
\r
220 /* Hardware version information */
\r
221 #define BC_HW_VERSION_PCB_MASK (0x07f0) /**< PCB Version mask */
\r
222 #define BC_HW_VERSION_PCB_SHIFT (4) /**< PCB Version shift */
\r
223 #define BC_HW_VERSION_BOARD_MASK (0x000f) /**< Board version mask */
\r
224 #define BC_HW_VERSION_BOARD_SHIFT (0) /**< Board version shift */
\r
226 /* Firmware version information */
\r
227 #define BC_FW_VERSION_MAJOR_MASK (0xf000) /**< FW Version major mask */
\r
228 #define BC_FW_VERSION_MAJOR_SHIFT (12) /**< FW version major shift */
\r
229 #define BC_FW_VERSION_MINOR_MASK (0x0f00) /**< FW version minor mask */
\r
230 #define BC_FW_VERSION_MINOR_SHIFT (8) /**< FW version minor shift */
\r
231 #define BC_FW_VERSION_PATCHLEVEL_MASK (0x00ff) /**< FW Patchlevel mask */
\r
232 #define BC_FW_VERSION_PATCHLEVEL_SHIFT (0) /**< FW Patchlevel shift */
\r
234 /* MBOX - BC <-> EFM32 communication */
\r
235 #define BC_MBOX_TXSTATUS0_FIFOEMPTY (1 << 0) /**< BC/EFM32 communication register */
\r
236 #define BC_MBOX_TXSTATUS0_FIFOFULL (1 << 1) /**< BC/EFM32 communication register */
\r
237 #define BC_MBOX_TXSTATUS0_FIFOUNDERFLOW (1 << 4) /**< BC/EFM32 communication register */
\r
238 #define BC_MBOX_TXSTATUS0_FIFOOVERFLOW (1 << 5) /**< BC/EFM32 communication register */
\r
240 #define BC_MBOX_TXSTATUS1_WORDCOUNT_MASK (0x07FF) /**< BC/EFM32 communication register */
\r
242 /* Buffer Controller */
\r
243 #define BC_BUF_CTRL_CS_ENABLE (1 << 0) /**< BC/EFM32 communication register */
\r
249 /** @} (end group BSP_DK) */
\r
250 /** @} (end group BSP) */
\r
252 #endif /* __BSP_DK_BCREG_3201_H */
\r