Exemplo n.º 1
0
uint16_t mcp23s17::readAddress(byte addr){
	startSend(1);
	SPI.transfer(addr);
	byte low_byte  = SPI.transfer(0x0);
	byte high_byte = SPI.transfer(0x0);
	endSend();
	return byte2word(high_byte,low_byte);
}
Exemplo n.º 2
0
uint16_t max7318::readAddress(byte addr){
	byte low_byte = 0;
	byte high_byte = 0;
	if (!_error){
		Wire.beginTransmission(_adrs);
		Wire.write(addr);//witch register?
		Wire.endTransmission();
		Wire.requestFrom((uint8_t)_adrs,(uint8_t)2);
		low_byte = Wire.read();
		high_byte = Wire.read();
	}	
	return byte2word(high_byte,low_byte);
}
Exemplo n.º 3
0
void max7318::gpioPort(byte lowByte, byte highByte){
	_gpioState = byte2word(highByte,lowByte);
	writeWord(GPIO,_gpioState);
}
Exemplo n.º 4
0
void pca9555::gpioPort(byte lowByte, byte highByte) {
    _gpioState = byte2word(highByte,lowByte);
    writeWord(GPIO,_gpioState);
}