Spi: Constructor with chip select added in cpp header
Signed-off-by: Steven Müllener <steven.muellener@sius.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
1ce28ee082
commit
3e1c528571
@@ -70,6 +70,15 @@ class Spi
|
||||
}
|
||||
}
|
||||
|
||||
Spi(int bus, int cs)
|
||||
{
|
||||
m_spi = mraa_spi_init_raw(bus, cs);
|
||||
|
||||
if (m_spi == NULL) {
|
||||
throw std::invalid_argument("Error initialising SPI bus");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes spi bus
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user