Ejemplo n.º 1
0
static void Wire1_Init(void)
{
	if ((adapter_nr = i2c_getadapter(I2C1)) < 0) {
		return;	
	}
	if ((i2c_fd = i2c_openadapter(adapter_nr)) < 0) {
		return;	
	}
}
Ejemplo n.º 2
0
void DFTwoWire::begin(void)
{
	muxSelectI2c(0);
	if (onBeginCallback)
		onBeginCallback();
	if(adapter_nr < 0){
		if ((adapter_nr = i2c_getadapter(I2C2)) < 0) {
			return;	
		}
	}
	if(i2c_fd < 0){
		if ((i2c_fd = i2c_openadapter(1)) < 0) {
			return;	
		}
	}
}