]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio/Source/SilLabs_Code/kits/bsp/bsp_dk_bcreg_3200.h
ff6622f2f0fa167a318151dfd0f5c2dec6196447
[freertos] / FreeRTOS / Demo / CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio / Source / SilLabs_Code / kits / bsp / bsp_dk_bcreg_3200.h
1 /**************************************************************************//**\r
2  * @file\r
3  * @brief Board Control register definitions\r
4  * @version 4.0.0\r
5  ******************************************************************************\r
6  * @section License\r
7  * <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>\r
8  *******************************************************************************\r
9  *\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
13  *\r
14  ******************************************************************************/\r
15 \r
16 \r
17 \r
18 #ifndef __BSP_DK_BCREG_3200_H\r
19 #define __BSP_DK_BCREG_3200_H\r
20 \r
21 #include <stdint.h>\r
22 \r
23 /***************************************************************************//**\r
24  * @addtogroup BSP\r
25  * @{\r
26  ******************************************************************************/\r
27 \r
28 /***************************************************************************//**\r
29  * @addtogroup BSP_DK API for DK's\r
30  * @{\r
31  ******************************************************************************/\r
32 \r
33 #ifdef __cplusplus\r
34 extern "C" {\r
35 #endif\r
36 \r
37 /**************************************************************************//**\r
38  * Defines FPGA register bank for Energy Micro Development Kit (DK) board,\r
39  * i.e. board control registers\r
40  *****************************************************************************/\r
41 #define BC_FLASH_BASE        0x80000000                                                          /**< FLASH memory base address */\r
42 #define BC_SRAM_BASE         0x84000000                                                          /**< SRAM base address */\r
43 #define BC_SSD2119_BASE      0x88000000                                                          /**< TFT Controller base address */\r
44 #define BC_REGISTER_BASE     0x8c000000                                                          /**< Board Controller registers base address */\r
45 \r
46 #define BC_CFG               ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x00)) /**< CFG */\r
47 #define BC_EM                ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x01)) /**< EM */\r
48 #define BC_MAGIC             ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x02)) /**< MAGIC */\r
49 #define BC_LED               ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x03)) /**< LEDs */\r
50 #define BC_PUSHBUTTON        ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x04)) /**< Push Buttons */\r
51 #define BC_DIPSWITCH         ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x05)) /**< Dip switches */\r
52 #define BC_JOYSTICK          ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x06)) /**< Joystick */\r
53 #define BC_AEM               ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x07)) /**< AEM push button status */\r
54 #define BC_DISPLAY_CTRL      ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x08)) /**< Display Control */\r
55 #define BC_EBI_CFG           ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x09)) /**< EBI config */\r
56 #define BC_BUS_CFG           ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0a)) /**< BUS config */\r
57 #define BC_PERCTRL           ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0c)) /**< Peripheral Control */\r
58 #define BC_AEMSTATE          ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0d)) /**< AEM state of push button switch */\r
59 #define BC_SPI_CFG           ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0e)) /**< SPI config */\r
60 #define BC_RESET             ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0f)) /**< Reset */\r
61 #define BC_ADC_START         ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x10)) /**< ADC start */\r
62 #define BC_ADC_STATUS        ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x11)) /**< ADC status */\r
63 #define BC_ADC_DATA          ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x12)) /**< ADC data */\r
64 #define BC_HW_VERSION        ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x14)) /**< HW version */\r
65 #define BC_FW_BUILDNO        ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x15)) /**< FW build number */\r
66 #define BC_FW_VERSION        ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x16)) /**< FW version */\r
67 #define BC_SCRATCH_COMMON    ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x17)) /**< Scratch common */\r
68 #define BC_SCRATCH_EFM0      ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x18)) /**< Scratch EFM0 */\r
69 #define BC_SCRATCH_EFM1      ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x19)) /**< Scratch EFM1 */\r
70 #define BC_SCRATCH_EFM2      ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1A)) /**< Scratch EFM2 */\r
71 #define BC_SCRATCH_EFM3      ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1B)) /**< Scratch EFM3 */\r
72 #define BC_SCRATCH_BC0       ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1C)) /**< Scratch BC0 */\r
73 #define BC_SCRATCH_BC1       ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1D)) /**< Scratch BC1 */\r
74 #define BC_SCRATCH_BC2       ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1E)) /**< Scratch BC2 */\r
75 #define BC_SCRATCH_BC3       ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1f)) /**< Scratch BC3 */\r
76 #define BC_INTFLAG           ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x20)) /**< Interrupt flag */\r
77 #define BC_INTEN             ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x21)) /**< Interrupt enable */\r
78 \r
79 /**************************************************************************//**\r
80  * Defines bit fields for board control registers\r
81  *****************************************************************************/\r
82 \r
83 #define BC_CFG_SPI                           (0)       /**< SPI mode */\r
84 #define BC_CFG_EBI                           (1)       /**< EBI mode */\r
85 \r
86 #define BC_EM_EM0                            (0)       /**< Indicate EM0 */\r
87 #define BC_EM_EM1                            (1)       /**< Indicate EM1 */\r
88 #define BC_EM_EM2                            (2)       /**< Indicate EM2 */\r
89 #define BC_EM_EM3                            (3)       /**< Indicate EM3 */\r
90 #define BC_EM_EM4                            (4)       /**< Indicate EM4 */\r
91 \r
92 #define BC_MAGIC_VALUE                       (0xef32)  /**< Magic */\r
93 \r
94 #define BC_PUSHBUTTON_MASK                   (0x000f)  /**< Push button mask */\r
95 #define BC_PUSHBUTTON_SW1                    (1 << 0)  /**< Push button SW1 */\r
96 #define BC_PUSHBUTTON_SW2                    (1 << 1)  /**< Push button SW2 */\r
97 #define BC_PUSHBUTTON_SW3                    (1 << 2)  /**< Push button SW3 */\r
98 #define BC_PUSHBUTTON_SW4                    (1 << 3)  /**< Push button SW4 */\r
99 \r
100 #define BC_DIPSWITCH_MASK                    (0x00ff)  /**< Dip switch mask */\r
101 \r
102 #define BC_JOYSTICK_MASK                     (0x001f)  /**< Joystick mask */\r
103 #define BC_JOYSTICK_DOWN                     (1 << 0)  /**< Joystick down */\r
104 #define BC_JOYSTICK_RIGHT                    (1 << 1)  /**< Joystick right */\r
105 #define BC_JOYSTICK_UP                       (1 << 2)  /**< Joystick up */\r
106 #define BC_JOYSTICK_LEFT                     (1 << 3)  /**< Joystick left */\r
107 #define BC_JOYSTICK_CENTER                   (1 << 4)  /**< Joystick center button */\r
108 \r
109 #define BC_DISPCTRL_RESET                    (1 << 0)  /**< Reset */\r
110 #define BC_DISPCTRL_POWER_ENABLE             (1 << 1)  /**< Display Control Power Enable */\r
111 \r
112 #define BC_EBI_CFG_MASK                      (0x0003)  /**< EBI Config */\r
113 #define BC_EBI_CFG_16X16                     (0)       /**< 16x16 address/data mode */\r
114 #define BC_EBI_CFG_8X8                       (1)       /**< 8x8 address/data mode */\r
115 #define BC_EBI_CFG_24X8                      (2)       /**< 24x8 address/data mode */\r
116 \r
117 #define BC_BUS_CFG_MASK                      (0x0003)  /**< Bus config */\r
118 #define BC_BUS_CFG_FSMC                      (0)       /**< Kit Board Controller owns bus */\r
119 #define BC_BUS_CFG_EBI                       (1)       /**< EBI drives bus */\r
120 #define BC_BUS_CFG_SPI                       (2)       /**< SPI drives bus */\r
121 \r
122 #define BC_PERCTRL_ACCEL                     (1 << 0)  /**< Accelerometer enable */\r
123 #define BC_PERCTRL_AMBIENT                   (1 << 1)  /**< Ambient light sensor enable */\r
124 #define BC_PERCTRL_POTMETER                  (1 << 2)  /**< Potentiometer enable */\r
125 #define BC_PERCTRL_RS232A                    (1 << 3)  /**< RS232A enable */\r
126 #define BC_PERCTRL_RS232B                    (1 << 4)  /**< RS232B enable */\r
127 #define BC_PERCTRL_SPI                       (1 << 5)  /**< SPI enable */\r
128 #define BC_PERCTRL_I2C                       (1 << 6)  /**< I2C enable */\r
129 #define BC_PERCTRL_IRDA                      (1 << 7)  /**< IRDA enable */\r
130 #define BC_PERCTRL_ANALOG_SE                 (1 << 8)  /**< Analog SE enable */\r
131 #define BC_PERCTRL_ANALOG_DIFF               (1 << 9)  /**< Analog Diff enable */\r
132 #define BC_PERCTRL_AUDIO_OUT                 (1 << 10) /**< Audio Out enable */\r
133 #define BC_PERCTRL_AUDIO_IN                  (1 << 11) /**< Audio In enable */\r
134 #define BC_PERCTRL_ACCEL_GSEL                (1 << 12) /**< Accel Gsel enable */\r
135 #define BC_PERCTRL_ACCEL_SELFTEST            (1 << 13) /**< Accel Self test enable */\r
136 #define BC_PERCTRL_RS232_SHUTDOWN            (1 << 14) /**< RS232 shutdown */\r
137 #define BC_PERCTRL_IRDA_SHUTDOWN             (1 << 15) /**< IRDA shutdown */\r
138 \r
139 #define BC_AEMSTATE_BC                       (0)       /**< AEM button state, BC controls buttons */\r
140 #define BC_AEMSTATE_EFM                      (1)       /**< AEM button state, EFM32 controls buttons */\r
141 \r
142 #define BC_SPI_CFG_FLASH                     (0)       /**< SPI Flash config */\r
143 #define BC_SPI_CFG_MICROSD                   (1)       /**< SPI MicroSD config */\r
144 \r
145 #define BC_RESET_FLASH                       (1 << 0)  /**< Reset Flash */\r
146 #define BC_RESET_EFM                         (1 << 1)  /**< Reset EFM */\r
147 \r
148 #define BC_ADC_START_MASK                    (0x00ff)  /**< ADC Start mask */\r
149 \r
150 #define BC_ADC_STATUS_DONE                   (0)       /**< ADC Status Done */\r
151 #define BC_ADC_STATUS_BUSY                   (1)       /**< ADC Status Busy */\r
152 \r
153 #define BC_HW_VERSION_PCB_MASK               (0x07f0)  /**< PCB Version mask */\r
154 #define BC_HW_VERSION_PCB_SHIFT              (4)       /**< PCB Version shift */\r
155 #define BC_HW_VERSION_BOARD_MASK             (0x000f)  /**< Board version mask */\r
156 #define BC_HW_VERSION_BOARD_SHIFT            (0)       /**< Board version shift  */\r
157 \r
158 #define BC_HW_FW_VERSION_MAJOR_MASK          (0xf000)  /**< FW Version major mask */\r
159 #define BC_HW_FW_VERSION_MAJOR_SHIFT         (12)      /**< FW version major shift */\r
160 #define BC_HW_FW_VERSION_MINOR_MASK          (0x0f00)  /**< FW version minor mask */\r
161 #define BC_HW_FW_VERSION_MINOR_SHIFT         (8)       /**< FW version minor shift */\r
162 #define BC_HW_FW_VERSION_PATCHLEVEL_MASK     (0x00ff)  /**< FW Patchlevel mask */\r
163 #define BC_HW_FW_VERSION_PATCHLEVEL_SHIFT    (0)       /**< FW Patchlevel shift */\r
164 \r
165 #define BC_INTEN_MASK                        (0x000f)  /**< Interrupt enable mask */\r
166 #define BC_INTEN_PB                          (1 << 0)  /**< Push Button Interrupt enable */\r
167 #define BC_INTEN_DIP                         (1 << 1)  /**< DIP Switch Interrupt enable */\r
168 #define BC_INTEN_JOYSTICK                    (1 << 2)  /**< Joystick Interrupt enable */\r
169 #define BC_INTEN_AEM                         (1 << 3)  /**< AEM Interrupt enable */\r
170 \r
171 #define BC_INTFLAG_MASK                      (0x000f)  /**< Interrupt flag mask */\r
172 #define BC_INTFLAG_PB                        (1 << 0)  /**< Push Button interrupt triggered */\r
173 #define BC_INTFLAG_DIP                       (1 << 1)  /**< DIP interrupt triggered */\r
174 #define BC_INTFLAG_JOYSTICK                  (1 << 2)  /**< Joystick interrupt triggered */\r
175 #define BC_INTFLAG_AEM                       (1 << 3)  /**< AEM interrupt triggered */\r
176 \r
177 #ifdef __cplusplus\r
178 }\r
179 #endif\r
180 \r
181 /** @} (end group BSP_DK) */\r
182 /** @} (end group BSP) */\r
183 \r
184 #endif  /* __BSP_DK_BCREG_3200_H */\r