drv_iic_middle.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #ifndef __drv_iic_middle_h__
  2. #define __drv_iic_middle_h__
  3. #include <stdbool.h>
  4. #include <stdint.h>
  5. #include <string.h>
  6. #include "sdk_common.h"
  7. #include "SEGGER_RTT.h"
  8. #include "usr_config.h"
  9. #include "nrf_gpio.h"
  10. #define IIC_MIDDLE_SCL_SET nrf_gpio_pin_write(PIN_QMA7981_SCLK,1)
  11. #define IIC_MIDDLE_SCL_CLR nrf_gpio_pin_write(PIN_QMA7981_SCLK,0)
  12. #define IIC_MIDDLE_SDA_SET nrf_gpio_pin_write(PIN_QMA7981_SDA,1)
  13. #define IIC_MIDDLE_SDA_CLR nrf_gpio_pin_write(PIN_QMA7981_SDA,0)
  14. #define IIC_MIDDLE_SDA_READ nrf_gpio_pin_read(PIN_QMA7981_SDA)
  15. //#define IIC_MIDDLE_SCL_SET nrf_gpio_pin_write(PIN_QMC_LSM_FRONT_SCL,1)
  16. //#define IIC_MIDDLE_SCL_CLR nrf_gpio_pin_write(PIN_QMC_LSM_FRONT_SCL,0)
  17. //#define IIC_MIDDLE_SDA_SET nrf_gpio_pin_write(PIN_QMC_LSM_FRONT_SDA,1)
  18. //#define IIC_MIDDLE_SDA_CLR nrf_gpio_pin_write(PIN_QMC_LSM_FRONT_SDA,0)
  19. //#define IIC_MIDDLE_SDA_READ nrf_gpio_pin_read(PIN_QMC_LSM_FRONT_SDA)
  20. void IIC_MIDDLE_Init(void);
  21. bool IIC_MIDDLE_WriteBytes(uint8_t add,uint8_t reg,uint8_t* p,uint8_t len);
  22. bool IIC_MIDDLE_ReadBytes(uint8_t add,uint8_t reg,uint8_t* p,uint8_t len);
  23. #endif