dvk_boardcontrol.h 3.5 KB

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