Skip to content

Commit

Permalink
swap around args for mixed use register
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed May 18, 2019
1 parent 805c5f5 commit e2237ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Adafruit_BusIO_Register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice,
}

Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, Adafruit_SPIDevice *spidevice,
uint16_t reg_addr, Adafruit_BusIO_SPIRegType type,
Adafruit_BusIO_SPIRegType type, uint16_t reg_addr,
uint8_t width, uint8_t bitorder, uint8_t address_width) {
_spidevice = spidevice;
_i2cdevice = i2cdevice;
Expand Down
2 changes: 1 addition & 1 deletion Adafruit_BusIO_Register.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class Adafruit_BusIO_Register {

Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice,
Adafruit_SPIDevice *spidevice,
uint16_t reg_addr,
Adafruit_BusIO_SPIRegType type,
uint16_t reg_addr,
uint8_t width=1, uint8_t bitorder=LSBFIRST,
uint8_t address_width=1);

Expand Down
2 changes: 1 addition & 1 deletion examples/i2corspi_register/i2corspi_register.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void setup() {
}
}

Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(i2c_dev, spi_dev, 0x0F, ADDRBIT8_HIGH_TOREAD);
Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, 0x0F);
uint8_t id;
id_reg.read(&id);
Serial.print("ID register = 0x"); Serial.println(id, HEX);
Expand Down

0 comments on commit e2237ec

Please sign in to comment.