]> begriffs open source - freertos/blob - 20100923-V6.1.0-RC2/Demo/CORTEX_EFMG890F128_IAR/bsp/dvk_boardcontrol.h
(no commit message)
[freertos] / 20100923-V6.1.0-RC2 / Demo / CORTEX_EFMG890F128_IAR / bsp / dvk_boardcontrol.h
1 /**************************************************************************//**\r
2  * @file\r
3  * @brief DVK Peripheral Board Control, prototypes and definitions\r
4  * @author Energy Micro AS\r
5  * @version 1.0.1\r
6  ******************************************************************************\r
7  * @section License\r
8  * <b>(C) Copyright 2009 Energy Micro AS, http://www.energymicro.com</b>\r
9  ******************************************************************************\r
10  *\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
13  *\r
14  * This copyright notice may not be removed from the source code nor changed.\r
15  *\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
22  *\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
26  *\r
27  *****************************************************************************/\r
28 \r
29 #ifndef __DVK_BOARDCONTROL_H\r
30 #define __DVK_BOARDCONTROL_H\r
31 \r
32 #include <stdint.h>\r
33 #include "dvk_bcregisters.h"\r
34 \r
35 /** Periperhal access switches */\r
36 typedef enum\r
37 {\r
38   DVK_ACCEL          = BC_PERCTRL_ACCEL,\r
39   DVK_AMBIENT        = BC_PERCTRL_AMBIENT,\r
40   DVK_POTMETER       = BC_PERCTRL_POTMETER,\r
41   DVK_RS232A         = BC_PERCTRL_RS232A,\r
42   DVK_RS232B         = BC_PERCTRL_RS232B,\r
43   DVK_SPI            = BC_PERCTRL_SPI,\r
44   DVK_I2C            = BC_PERCTRL_I2C,\r
45   DVK_IRDA           = BC_PERCTRL_IRDA,\r
46   DVK_ANALOG_SE      = BC_PERCTRL_ANALOG_SE,\r
47   DVK_ANALOG_DIFF    = BC_PERCTRL_ANALOG_DIFF,\r
48   DVK_AUDIO_OUT      = BC_PERCTRL_AUDIO_OUT,\r
49   DVK_AUDIO_IN       = BC_PERCTRL_AUDIO_IN,\r
50   DVK_ACCEL_GSEL     = BC_PERCTRL_ACCEL_GSEL,\r
51   DVK_ACCEL_SELFTEST = BC_PERCTRL_ACCEL_SELFTEST,\r
52   DVK_RS232_SHUTDOWN = BC_PERCTRL_RS232_SHUTDOWN,\r
53   DVK_IRDA_SHUTDOWN  = BC_PERCTRL_IRDA_SHUTDOWN,\r
54 } DVKPeripheral;\r
55 \r
56 /* Peripheral Control */\r
57 void DVK_enablePeripheral(DVKPeripheral peri);\r
58 void DVK_disablePeripheral(DVKPeripheral peri);\r
59 void DVK_enableBus(void);\r
60 void DVK_disableBus(void);\r
61 \r
62 /* Read board controllers */\r
63 uint16_t DVK_getPushButtons(void);\r
64 uint16_t DVK_getJoystick(void);\r
65 uint16_t DVK_getDipSwitch(void);\r
66 \r
67 /* Report AEM status */\r
68 void DVK_setEnergyMode(uint16_t energyMode);\r
69 \r
70 /* User LEDs */\r
71 void DVK_setLEDs(uint16_t leds);\r
72 uint16_t DVK_getLEDs(void);\r
73 \r
74 /* Interrupt callback */\r
75 void DVK_enableInterrupt(uint16_t flags);\r
76 void DVK_disableInterrupt(uint16_t flags);\r
77 \r
78 uint16_t DVK_getInterruptFlags(void);\r
79 void DVK_clearInterruptFlags(uint16_t flags);\r
80 \r
81 #endif\r