1
0

stm32f1_i2c.h 845 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2017-07-04 aubrcool@qq.com 1st version
  9. */
  10. #include "stm32f10x.h"
  11. #include <rtdevice.h>
  12. #ifndef __STM32F10X_I2C_H__
  13. #define __STM32F10X_I2C_H__
  14. #include "stm32f10x.h"
  15. #include "stm32f10x_i2c.h"
  16. #include "board.h"
  17. struct stm32_i2c_bus
  18. {
  19. struct rt_i2c_bus_device parent;
  20. struct rt_event ev;
  21. I2C_TypeDef *I2C;
  22. struct rt_i2c_msg *msg;
  23. rt_uint32_t msg_cnt;
  24. volatile rt_uint32_t msg_ptr;
  25. volatile rt_uint32_t dptr;
  26. rt_uint32_t wait_stop;
  27. };
  28. /* public function list */
  29. rt_err_t stm32_i2c_register(I2C_TypeDef *I2C, rt_uint32_t bitrate,
  30. const char * i2c_bus_name);
  31. #endif /*__STM32F10X_I2C_H__*/