mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
lpd8806: added bus parameter to constructor
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
3aef2ea70e
commit
d004aa68b7
@ -151,6 +151,10 @@ compatibility between releases:
|
|||||||
and Python, the examples have been modified to use these methods
|
and Python, the examples have been modified to use these methods
|
||||||
rather than the methods that return data in argument pointers or
|
rather than the methods that return data in argument pointers or
|
||||||
arrays.
|
arrays.
|
||||||
|
|
||||||
|
* **lpd8806** The constructor for this driver was updated to allow specifying
|
||||||
|
a SPI bus number. This is now the first parameter, the number of LEDs on the
|
||||||
|
strip is now the last (3rd) parameter instead.
|
||||||
|
|
||||||
# v1.1.0
|
# v1.1.0
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
sensor = new upm::LPD8806(10, 7);
|
sensor = new upm::LPD8806(0, 7, 10);
|
||||||
usleep (1000000);
|
usleep (1000000);
|
||||||
|
|
||||||
sensor->show ();
|
sensor->show ();
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
||||||
LPD8806::LPD8806 (uint16_t pixelCount, int csn) :m_spi(0), m_csnPinCtx(csn) {
|
LPD8806::LPD8806 (int bus, int csn, uint16_t pixelCount) :m_spi(bus), m_csnPinCtx(csn) {
|
||||||
mraa::Result error = mraa::SUCCESS;
|
mraa::Result error = mraa::SUCCESS;
|
||||||
m_name = "LPD8806";
|
m_name = "LPD8806";
|
||||||
|
|
||||||
|
@ -63,10 +63,11 @@ class LPD8806 {
|
|||||||
/**
|
/**
|
||||||
* Instantiates an LPD8806 object
|
* Instantiates an LPD8806 object
|
||||||
*
|
*
|
||||||
* @param pixelCount Number of pixels in the strip
|
* @param bus SPI bus to use
|
||||||
* @param csn Chip select pin
|
* @param csn Chip select pin
|
||||||
|
* @param pixelCount Number of pixels in the strip
|
||||||
*/
|
*/
|
||||||
LPD8806 (uint16_t pixelCount, int csn);
|
LPD8806 (int bus, int csn, uint16_t pixelCount);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LPD8806 object destructor; basically, it frees the allocated
|
* LPD8806 object destructor; basically, it frees the allocated
|
||||||
|
Loading…
x
Reference in New Issue
Block a user