b15f/firmware/tlc5615.cpp

13 lines
278 B
C++
Raw Normal View History

2019-04-02 15:32:51 +02:00
#include "tlc5615.h"
2019-03-25 15:02:24 +01:00
2019-04-03 08:40:14 +02:00
TLC5615::TLC5615(volatile SPI& spi, uint8_t adr) : spi(spi), adr(adr)
2019-03-25 15:02:24 +01:00
{
}
2019-04-03 08:40:14 +02:00
void TLC5615::setValue(uint16_t val) const volatile
2019-03-25 15:02:24 +01:00
{
2019-04-03 11:38:15 +02:00
spi.addByte(static_cast<uint8_t>(val >> 6));
spi.addByte(static_cast<uint8_t>(val << 2));
spi.transfer(adr);
2019-03-25 15:02:24 +01:00
}