drv_iic.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /******************************************************************//**
  2. * @file drv_iic.h
  3. * @brief IIC 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-01-07 onelife Initial creation for EFM32
  15. *********************************************************************/
  16. #ifndef __DRV_IIC_H__
  17. #define __DRV_IIC_H__
  18. /* Includes -------------------------------------------------------------------*/
  19. /* Exported types -------------------------------------------------------------*/
  20. struct efm32_iic_device_t
  21. {
  22. I2C_TypeDef* iic_device;
  23. rt_bool_t is_master;
  24. rt_uint16_t master_address;
  25. rt_uint16_t slave_address;
  26. };
  27. struct efm32_iic_control_t
  28. {
  29. rt_bool_t is_master;
  30. rt_uint16_t master_address;
  31. rt_uint16_t slave_address;
  32. };
  33. /* Exported constants ---------------------------------------------------------*/
  34. /* Exported macro -------------------------------------------------------------*/
  35. /* Exported functions --------------------------------------------------------- */
  36. void rt_hw_iic_init(void);
  37. #endif /* __DRV_IIC_H__ */