drv_emu.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /***************************************************************************//**
  2. * @file drv_emu.h
  3. * @brief EMU driver of RT-Thread RTOS for EFM32
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. * @author onelife
  6. * @version 1.0
  7. *******************************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file
  10. * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
  11. *******************************************************************************
  12. * @section Change Logs
  13. * Date Author Notes
  14. * 2011-02-21 onelife Initial creation for EFM32
  15. * 2011-07-14 onelife Add multiple channels support for scan mode
  16. ******************************************************************************/
  17. #ifndef __DRV_EMU_H__
  18. #define __DRV_EMU_H__
  19. /* Includes ------------------------------------------------------------------*/
  20. /* Exported defines ----------------------------------------------------------*/
  21. #define EMU_TASK_STACK_SIZE (256)
  22. #define EMU_TASK_EM2_TOKEN_NUMBER (255)
  23. #define EMU_TASK_EM3_TOKEN_NUMBER (255)
  24. #define EMU_TASK_EM4_TOKEN_NUMBER (255)
  25. #define EMU_RX_MESSAGE_SIZE (4)
  26. #define EMU_RX_MESSAGE_QUEUE_SIZE (1)
  27. /* Exported types ------------------------------------------------------------*/
  28. struct efm32_emu_task
  29. {
  30. struct rt_thread thread;
  31. struct rt_semaphore em2;
  32. struct rt_semaphore em3;
  33. struct rt_semaphore em4;
  34. rt_uint8_t stack[EMU_TASK_STACK_SIZE];
  35. };
  36. /* Exported constants --------------------------------------------------------*/
  37. /* Exported macro ------------------------------------------------------------*/
  38. /* Exported functions ------------------------------------------------------- */
  39. void emu_all_disable(void);
  40. void emu_em2_disable(void);
  41. void emu_em2_enable(void);
  42. void emu_em3_disable(void);
  43. void emu_em3_enable(void);
  44. void emu_em4_disable(void);
  45. void emu_em4_enable(void);
  46. void efm32_emu_init(void);
  47. #endif /*__DRV_EMU_H__ */