From 7e5f6e985654f04a6dcab7f60d0ac7712b4d5c9a Mon Sep 17 00:00:00 2001 From: Mihai Tudor Panu Date: Mon, 10 Apr 2017 18:37:08 -0700 Subject: [PATCH] max31723: added bus parameter to constructor Signed-off-by: Mihai Tudor Panu --- docs/apichanges.md | 3 +++ examples/c++/max31723.cxx | 2 +- src/max31723/max31723.cxx | 2 +- src/max31723/max31723.hpp | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/apichanges.md b/docs/apichanges.md index c7bb46e8..af4fbc36 100644 --- a/docs/apichanges.md +++ b/docs/apichanges.md @@ -156,6 +156,9 @@ compatibility between releases: a SPI bus number. This is now the first parameter, the number of LEDs on the strip is now the last (3rd) parameter instead. + * **max31723** The constructor for this driver was updated to allow specifying + a SPI bus number. This is now the first parameter, CS pin second. + # v1.1.0 * **i2clcd/jhd1313m1/lcm1602** LCD devices supported by the i2clcd module are diff --git a/examples/c++/max31723.cxx b/examples/c++/max31723.cxx index 4b983108..fe798c82 100644 --- a/examples/c++/max31723.cxx +++ b/examples/c++/max31723.cxx @@ -44,7 +44,7 @@ int main(int argc, char **argv) { //! [Interesting] - sensor = new upm::MAX31723(7); + sensor = new upm::MAX31723(0, 7); usleep (1000000); while (!doWork) { diff --git a/src/max31723/max31723.cxx b/src/max31723/max31723.cxx index f78caa96..042627ab 100644 --- a/src/max31723/max31723.cxx +++ b/src/max31723/max31723.cxx @@ -31,7 +31,7 @@ using namespace upm; -MAX31723::MAX31723 (int csn) : m_spi(0), m_csnPinCtx(csn) { +MAX31723::MAX31723 (int bus, int csn) : m_spi(bus), m_csnPinCtx(csn) { mraa::Result error = mraa::SUCCESS; m_name = "MAX31723"; diff --git a/src/max31723/max31723.hpp b/src/max31723/max31723.hpp index b942eed1..b6731677 100644 --- a/src/max31723/max31723.hpp +++ b/src/max31723/max31723.hpp @@ -72,10 +72,10 @@ class MAX31723 { /** * Instantiates an MAX31723 object * - * @param bus Number of the used bus + * @param bus Number of the SPI bus used * @param csn Chip select (slave select) pin to use */ - MAX31723 (int csn); + MAX31723 (int bus, int csn); /** * MAXDS3231M object destructor; basically, it closes the I2C connection.