b15f/firmware/tlc5615.cpp

13 lines
277 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 11:30:57 +00:00
TLC5615::TLC5615(volatile SPI& spi, SPIADR 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
{
2019-04-03 09:38:15 +00:00
spi.addByte(static_cast<uint8_t>(val >> 6));
spi.addByte(static_cast<uint8_t>(val << 2));
spi.transfer(adr);
2019-03-25 14:02:24 +00:00
}