dvk_boardcontrol.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**************************************************************************//**
  2. * @file
  3. * @brief DVK Peripheral Board Control, prototypes and definitions
  4. * @author Energy Micro AS
  5. * @version 1.7.3
  6. ******************************************************************************
  7. * @section License
  8. * <b>(C) Copyright 2010 Energy Micro AS, http://www.energymicro.com</b>
  9. ******************************************************************************
  10. *
  11. * This source code is the property of Energy Micro AS. The source and compiled
  12. * code may only be used on Energy Micro "EFM32" microcontrollers.
  13. *
  14. * This copyright notice may not be removed from the source code nor changed.
  15. *
  16. * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no
  17. * obligation to support this Software. Energy Micro AS is providing the
  18. * Software "AS IS", with no express or implied warranties of any kind,
  19. * including, but not limited to, any implied warranties of merchantability
  20. * or fitness for any particular purpose or warranties against infringement
  21. * of any proprietary rights of a third party.
  22. *
  23. * Energy Micro AS will not be liable for any consequential, incidental, or
  24. * special damages, or any other relief, or for any claim by any third party,
  25. * arising from your use of this Software.
  26. *
  27. *****************************************************************************/
  28. #ifndef __DVK_BOARDCONTROL_H
  29. #define __DVK_BOARDCONTROL_H
  30. /***************************************************************************//**
  31. * @addtogroup BSP
  32. * @{
  33. ******************************************************************************/
  34. #include <stdint.h>
  35. #include "dvk_bcregisters.h"
  36. /** Periperhal access switches */
  37. typedef enum
  38. {
  39. DVK_ACCEL = BC_PERCTRL_ACCEL,
  40. DVK_AMBIENT = BC_PERCTRL_AMBIENT,
  41. DVK_POTMETER = BC_PERCTRL_POTMETER,
  42. DVK_RS232A = BC_PERCTRL_RS232A,
  43. DVK_RS232B = BC_PERCTRL_RS232B,
  44. DVK_SPI = BC_PERCTRL_SPI,
  45. DVK_I2C = BC_PERCTRL_I2C,
  46. DVK_IRDA = BC_PERCTRL_IRDA,
  47. DVK_ANALOG_SE = BC_PERCTRL_ANALOG_SE,
  48. DVK_ANALOG_DIFF = BC_PERCTRL_ANALOG_DIFF,
  49. DVK_AUDIO_OUT = BC_PERCTRL_AUDIO_OUT,
  50. DVK_AUDIO_IN = BC_PERCTRL_AUDIO_IN,
  51. DVK_ACCEL_GSEL = BC_PERCTRL_ACCEL_GSEL,
  52. DVK_ACCEL_SELFTEST = BC_PERCTRL_ACCEL_SELFTEST,
  53. DVK_RS232_SHUTDOWN = BC_PERCTRL_RS232_SHUTDOWN,
  54. DVK_IRDA_SHUTDOWN = BC_PERCTRL_IRDA_SHUTDOWN
  55. } DVKPeripheral;
  56. /* Peripheral Control */
  57. void DVK_enablePeripheral(DVKPeripheral peri);
  58. void DVK_disablePeripheral(DVKPeripheral peri);
  59. void DVK_enableBus(void);
  60. void DVK_disableBus(void);
  61. /* Read board controllers */
  62. uint16_t DVK_getPushButtons(void);
  63. uint16_t DVK_getJoystick(void);
  64. uint16_t DVK_getDipSwitch(void);
  65. /* Report AEM status */
  66. void DVK_setEnergyMode(uint16_t energyMode);
  67. /* User LEDs */
  68. void DVK_setLEDs(uint16_t leds);
  69. uint16_t DVK_getLEDs(void);
  70. /* Interrupt callback */
  71. void DVK_enableInterrupt(uint16_t flags);
  72. void DVK_disableInterrupt(uint16_t flags);
  73. uint16_t DVK_getInterruptFlags(void);
  74. void DVK_clearInterruptFlags(uint16_t flags);
  75. /** @} (end group BSP) */
  76. #endif