b15f/firmware/tlc5615.cpp

14 lines
261 B
C++
Raw Normal View History

2019-04-02 13:32:51 +00:00
#include "tlc5615.h"
2019-03-25 14:02:24 +00:00
2019-04-03 06:40:14 +00:00
TLC5615::TLC5615(volatile SPI& spi, uint8_t adr) : spi(spi), adr(adr)
2019-03-25 14:02:24 +00:00
{
}
2019-04-03 06:40:14 +00:00
void TLC5615::setValue(uint16_t val) const volatile
2019-03-25 14:02:24 +00:00
{
spi.setAdr(adr);
spi.pushByte(val >> 6);
spi.pushByte(val << 2);
spi.setAdr(SPIADR::NONE);
}