drv_adc.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /******************************************************************//**
  2. * @file drv_adc.h
  3. * @brief ADC driver of RT-Thread RTOS for EFM32
  4. * COPYRIGHT (C) 2011, RT-Thread Development Team
  5. * @author onelife
  6. * @version 0.4 beta
  7. **********************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file LICENSE in this
  10. * 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. *********************************************************************/
  16. #ifndef __DRV_ADC_H__
  17. #define __DRV_ADC_H__
  18. /* Includes -------------------------------------------------------------------*/
  19. /* Exported types -------------------------------------------------------------*/
  20. struct efm32_adc_device_t
  21. {
  22. ADC_TypeDef *adc_device;
  23. rt_uint32_t mode;
  24. };
  25. struct efm32_adc_control_t
  26. {
  27. rt_uint32_t mode;
  28. ADC_InitSingle_TypeDef *singleInit;
  29. ADC_InitScan_TypeDef *scanInit;
  30. };
  31. /* Exported constants ---------------------------------------------------------*/
  32. /* Exported macro -------------------------------------------------------------*/
  33. #define ADC_MODE_SINGLE 0x00UL
  34. #define ADC_MODE_SCAN 0x01UL
  35. #define ADC_MODE_TAILGATE 0x02UL
  36. /* Exported functions --------------------------------------------------------- */
  37. void rt_hw_adc_init(void);
  38. #endif /*__DRV_ADC_H__ */