1 /**************************************************************************//**
\r
3 * @brief DVK Board Support, master header file
\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
33 #include "dvk_boardcontrol.h"
\r
34 #include "dvk_bcregisters.h"
\r
36 /* IF not user overrides default, try to decide DVK access interface based on
\r
38 #ifndef DVK_SPI_CONTROL
\r
39 #ifndef DVK_EBI_CONTROL
\r
41 #if defined(EFM32G200F16)
\r
42 #define DVK_SPI_CONTROL
\r
43 #elif defined(EFM32G200F32)
\r
44 #define DVK_SPI_CONTROL
\r
45 #elif defined(EFM32G200F64)
\r
46 #define DVK_SPI_CONTROL
\r
47 #elif defined(EFM32G210F128)
\r
48 #define DVK_SPI_CONTROL
\r
49 #elif defined(EFM32G230F128)
\r
50 #define DVK_SPI_CONTROL
\r
51 #elif defined(EFM32G230F32)
\r
52 #define DVK_SPI_CONTROL
\r
53 #elif defined(EFM32G230F64)
\r
54 #define DVK_SPI_CONTROL
\r
55 #elif defined(EFM32G280F128)
\r
56 #define DVK_EBI_CONTROL
\r
57 #elif defined(EFM32G280F32)
\r
58 #define DVK_EBI_CONTROL
\r
59 #elif defined(EFM32G280F64)
\r
60 #define DVK_EBI_CONTROL
\r
61 #elif defined(EFM32G290F128)
\r
62 #define DVK_EBI_CONTROL
\r
63 #elif defined(EFM32G290F32)
\r
64 #define DVK_EBI_CONTROL
\r
65 #elif defined(EFM32G290F64)
\r
66 #define DVK_EBI_CONTROL
\r
67 #elif defined(EFM32G840F128)
\r
68 #define DVK_SPI_CONTROL
\r
69 #elif defined(EFM32G840F32)
\r
70 #define DVK_SPI_CONTROL
\r
71 #elif defined(EFM32G840F64)
\r
72 #define DVK_SPI_CONTROL
\r
73 #elif defined(EFM32G880F128)
\r
74 #define DVK_SPI_CONTROL
\r
75 #elif defined(EFM32G880F32)
\r
76 #define DVK_SPI_CONTROL
\r
77 #elif defined(EFM32G880F64)
\r
78 #define DVK_SPI_CONTROL
\r
79 #elif defined(EFM32G890F128)
\r
80 #define DVK_SPI_CONTROL
\r
81 #elif defined(EFM32G890F32)
\r
82 #define DVK_SPI_CONTROL
\r
83 #elif defined(EFM32G890F64)
\r
84 #define DVK_SPI_CONTROL
\r
86 #define DVK_SPI_CONTROL
\r
93 void DVK_EBI_init(void);
\r
94 void DVK_EBI_disable(void);
\r
96 void DVK_EBI_writeRegister(volatile uint16_t *addr, uint16_t data);
\r
97 uint16_t DVK_EBI_readRegister(volatile uint16_t *addr);
\r
100 void DVK_SPI_init(void);
\r
101 void DVK_SPI_disable(void);
\r
103 void DVK_SPI_writeRegister(volatile uint16_t *addr, uint16_t data);
\r
104 uint16_t DVK_SPI_readRegister(volatile uint16_t *addr);
\r
107 /* Accodring to configuration, use either SPI or EBI */
\r
108 #ifdef DVK_EBI_CONTROL
\r
109 #define DVK_writeRegister(A, B) DVK_EBI_writeRegister(A, B)
\r
110 #define DVK_readRegister(A) DVK_EBI_readRegister(A)
\r
113 #ifdef DVK_SPI_CONTROL
\r
114 #define DVK_writeRegister(A, B) DVK_SPI_writeRegister(A, B)
\r
115 #define DVK_readRegister(A) DVK_SPI_readRegister(A)
\r
118 /* General initialization routines */
\r
119 void DVK_init(void);
\r
120 void DVK_disable(void);
\r