1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef __drv_iic_05_h__
- #define __drv_iic_05_h__
- #include <stdbool.h>
- #include <stdint.h>
- #include <string.h>
- #include "sdk_common.h"
- #include "SEGGER_RTT.h"
- #include "usr_config.h"
- #include "nrf_gpio.h"
- #if SHAREPIN_CONFIG == 1 || SHAREPIN_CONFIG == 2
- #define IIC_05_SCL_SET nrf_gpio_pin_write(PIN_SCL_1,1)
- #define IIC_05_SCL_CLR nrf_gpio_pin_write(PIN_SCL_1,0)
- #define IIC_05_SDA_SET nrf_gpio_pin_write(PIN_SDA_1,1)
- #define IIC_05_SDA_CLR nrf_gpio_pin_write(PIN_SDA_1,0)
- #define IIC_05_SDA_READ nrf_gpio_pin_read(PIN_SDA_1)
- #elif SHAREPIN_CONFIG == 3
- #define IIC_05_SCL_SET nrf_gpio_pin_write(PIN_SCL_MAG,1)
- #define IIC_05_SCL_CLR nrf_gpio_pin_write(PIN_SCL_MAG,0)
- #define IIC_05_SDA_SET nrf_gpio_pin_write(PIN_SDA_FRONT,1)
- #define IIC_05_SDA_CLR nrf_gpio_pin_write(PIN_SDA_FRONT,0)
- #define IIC_05_SDA_READ nrf_gpio_pin_read(PIN_SDA_FRONT)
- #endif
- void IIC_05_Init(void);
- bool IIC_05_WriteBytes(uint8_t add,uint8_t reg,uint8_t* p,uint8_t len);
- bool IIC_05_ReadBytes(uint8_t add,uint8_t reg,uint8_t* p,uint8_t len);
- #endif
|