Add ADDRBIT8_HIGH_TOWRITE to Adafruit_BusIO_SPIRegType
Add ADDRBIT8_HIGH_TOWRITE to Adafruit_BusIO_SPIRegType to enable writing for example MAX31865 and MAX31856
This commit is contained in:
parent
6660a0a2c8
commit
244650a027
|
|
@ -104,6 +104,9 @@ bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) {
|
|||
if (_spiregtype == ADDRBIT8_HIGH_TOREAD) {
|
||||
addrbuffer[0] &= ~0x80;
|
||||
}
|
||||
if (_spiregtype == ADDRBIT8_HIGH_TOWRITE) {
|
||||
addrbuffer[0] |= 0x80;
|
||||
}
|
||||
if (_spiregtype == AD8_HIGH_TOREAD_AD7_HIGH_TOINC) {
|
||||
addrbuffer[0] &= ~0x80;
|
||||
addrbuffer[0] |= 0x40;
|
||||
|
|
@ -181,6 +184,9 @@ bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) {
|
|||
if (_spiregtype == ADDRBIT8_HIGH_TOREAD) {
|
||||
addrbuffer[0] |= 0x80;
|
||||
}
|
||||
if (_spiregtype == ADDRBIT8_HIGH_TOWRITE) {
|
||||
addrbuffer[0] &= ~0x80;
|
||||
}
|
||||
if (_spiregtype == AD8_HIGH_TOREAD_AD7_HIGH_TOINC) {
|
||||
addrbuffer[0] |= 0x80 | 0x40;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
typedef enum _Adafruit_BusIO_SPIRegType {
|
||||
ADDRBIT8_HIGH_TOREAD = 0,
|
||||
AD8_HIGH_TOREAD_AD7_HIGH_TOINC = 1,
|
||||
ADDRBIT8_HIGH_TOWRITE = 2,
|
||||
} Adafruit_BusIO_SPIRegType;
|
||||
|
||||
/*!
|
||||
|
|
|
|||
Loading…
Reference in New Issue