Esp8266/Core/twi_arch.h
Go to the documentation of this file.
1 /*
2  * twi_arch.h - Platform-specific code
3  *
4  * See Sming/Core/si2c.cpp
5  *
6  */
7 
8 #pragma once
9 
10 //Enable SDA (becomes output and since GPO is 0 for the pin, it will pull the line low)
11 #define SDA_LOW() (GPES = (1 << twi_sda))
12 //Disable SDA (becomes input and since it has pullup it will go high)
13 #define SDA_HIGH() (GPEC = (1 << twi_sda))
14 #define SDA_READ() ((GPI & (1 << twi_sda)) != 0)
15 #define SCL_LOW() (GPES = (1 << twi_scl))
16 #define SCL_HIGH() (GPEC = (1 << twi_scl))
17 #define SCL_READ() ((GPI & (1 << twi_scl)) != 0)