drv_iic_02.h 711 B

1234567891011121314151617181920212223
  1. #ifndef __drv_iic_02_h__
  2. #define __drv_iic_02_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_02_SCL_SET nrf_gpio_pin_write(PIN_QMC6310_02_SCL,1)
  11. #define IIC_02_SCL_CLR nrf_gpio_pin_write(PIN_QMC6310_02_SCL,0)
  12. #define IIC_02_SDA_SET nrf_gpio_pin_write(PIN_QMC6310_02_SDA,1)
  13. #define IIC_02_SDA_CLR nrf_gpio_pin_write(PIN_QMC6310_02_SDA,0)
  14. #define IIC_02_SDA_READ nrf_gpio_pin_read(PIN_QMC6310_02_SDA)
  15. void IIC_02_Init(void);
  16. bool IIC_02_WriteBytes(uint8_t add,uint8_t reg,uint8_t* p,uint8_t len);
  17. bool IIC_02_ReadBytes(uint8_t add,uint8_t reg,uint8_t* p,uint8_t len);
  18. #endif