Skip to content

Commit

Permalink
DUE compatibility fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sumotoy committed Nov 3, 2015
1 parent b5162c9 commit 873fb3e
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 22 deletions.
6 changes: 4 additions & 2 deletions max6957.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,10 @@ void max6957::writeWord(byte addr, uint16_t data){
#if !defined(__SAM3X8E__) && ((ARDUINO >= 160) || (TEENSYDUINO > 121))
SPI.transfer16(data);
#else
SPI.transfer(word2lowByte(data));
SPI.transfer(word2highByte(data));
//SPI.transfer(word2lowByte(data));
//SPI.transfer(word2highByte(data));
SPI.transfer(data >> 8);
SPI.transfer(data & 0xFF);
#endif
endSend();
}
Expand Down
6 changes: 4 additions & 2 deletions max7301.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ void max7301::writeWord(byte addr, uint16_t data){
#if !defined(__SAM3X8E__) && ((ARDUINO >= 160) || (TEENSYDUINO > 121))
SPI.transfer16(data);
#else
SPI.transfer(word2lowByte(data));
SPI.transfer(word2highByte(data));
//SPI.transfer(word2lowByte(data));
//SPI.transfer(word2highByte(data));
SPI.transfer(data >> 8);
SPI.transfer(data & 0xFF);
#endif
endSend();
}
Expand Down
6 changes: 4 additions & 2 deletions max7311.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ void max7311::writeWord(byte addr, uint16_t data){
if (!_error){
Wire.beginTransmission(_adrs);
Wire.write(addr);//witch register?
Wire.write(word2lowByte(data));
Wire.write(word2highByte(data));
//Wire.write(word2lowByte(data));
//Wire.write(word2highByte(data));
Wire.write(data >> 8);
Wire.write(data & 0xFF);
Wire.endTransmission();
}
}
6 changes: 4 additions & 2 deletions max7318.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ void max7318::writeWord(byte addr, uint16_t data){
if (!_error){
Wire.beginTransmission(_adrs);
Wire.write(addr);//witch register?
Wire.write(word2lowByte(data));
Wire.write(word2highByte(data));
//Wire.write(word2lowByte(data));
//Wire.write(word2highByte(data));
Wire.write(data >> 8);
Wire.write(data & 0xFF);
Wire.endTransmission();
}
}
6 changes: 4 additions & 2 deletions mcp23016.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ void mcp23016::writeWord(byte addr, uint16_t data){
if (!_error){
Wire.beginTransmission(_adrs);
Wire.write(addr);
Wire.write(word2lowByte(data));
Wire.write(word2highByte(data));
//Wire.write(word2lowByte(data));
//Wire.write(word2highByte(data));
Wire.write(data >> 8);
Wire.write(data & 0xFF);
Wire.endTransmission();
}
}
6 changes: 4 additions & 2 deletions mcp23017.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ void mcp23017::writeWord(byte addr, uint16_t data){
if (!_error){
Wire.beginTransmission(_adrs);
Wire.write(addr);//witch register?
Wire.write(word2lowByte(data));
Wire.write(word2highByte(data));
//Wire.write(word2lowByte(data));
//Wire.write(word2highByte(data));
Wire.write(data >> 8);
Wire.write(data & 0xFF);
Wire.endTransmission();
}
}
Expand Down
6 changes: 4 additions & 2 deletions mcp23018.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ void mcp23018::writeWord(byte addr, uint16_t data){
if (!_error){
Wire.beginTransmission(_adrs);
Wire.write(addr);
Wire.write(word2lowByte(data));
Wire.write(word2highByte(data));
//Wire.write(word2lowByte(data));
//Wire.write(word2highByte(data));
Wire.write(data >> 8);
Wire.write(data & 0xFF);
Wire.endTransmission();
}
}
6 changes: 4 additions & 2 deletions mcp23s17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,10 @@ void mcp23s17::writeWord(byte addr, uint16_t data){
#if !defined(__SAM3X8E__) && ((ARDUINO >= 160) || (TEENSYDUINO > 121))
SPI.transfer16(data);
#else
SPI.transfer(word2lowByte(data));
SPI.transfer(word2highByte(data));
//SPI.transfer(word2lowByte(data));
//SPI.transfer(word2highByte(data));
SPI.transfer(data >> 8);
SPI.transfer(data & 0xFF);
#endif
endSend();
}
Expand Down
6 changes: 4 additions & 2 deletions mcp23s18.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,10 @@ void mcp23s18::writeByte(byte addr, byte data){
void mcp23s18::writeWord(byte addr, uint16_t data){
startSend(0);
SPI.transfer(addr);
SPI.transfer(word2lowByte(data));
SPI.transfer(word2highByte(data));
//SPI.transfer(word2lowByte(data));
//SPI.transfer(word2highByte(data));
SPI.transfer(data >> 8);
SPI.transfer(data & 0xFF);
endSend();
}

Expand Down
6 changes: 4 additions & 2 deletions pca9555.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ void pca9555::writeWord(byte addr, uint16_t data){
if (!_error){
Wire.beginTransmission(_adrs);
Wire.write(addr);//witch register?
Wire.write(word2lowByte(data));
Wire.write(word2highByte(data));
//Wire.write(word2lowByte(data));
//Wire.write(word2highByte(data));
Wire.write(data >> 8);
Wire.write(data & 0xFF);
Wire.endTransmission();
}
}
6 changes: 4 additions & 2 deletions pca9655.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ void pca9655::writeWord(byte addr, uint16_t data){
if (!_error){
Wire.beginTransmission(_adrs);
Wire.write(addr);//witch register?
Wire.write(word2lowByte(data));
Wire.write(word2highByte(data));
//Wire.write(word2lowByte(data));
//Wire.write(word2highByte(data));
Wire.write(data >> 8);
Wire.write(data & 0xFF);
Wire.endTransmission();
}
}

0 comments on commit 873fb3e

Please sign in to comment.