| 332 | |
| 333 | // write a single bit out, which bit from the passed in byte is determined by template parameter |
| 334 | template <u8 BIT> inline void writeBit(u8 b) FL_NOEXCEPT { |
| 335 | // For bit-banging, we need to temporarily disable SPI and use GPIO |
| 336 | ::SPI.endTransaction(); |
| 337 | |
| 338 | pinMode(_DATA_PIN, PinMode::Output); |
| 339 | pinMode(_CLOCK_PIN, PinMode::Output); |
| 340 | |
| 341 | if(b & (1 << BIT)) { |
| 342 | digitalWrite(_DATA_PIN, PinValue::High); |
| 343 | } else { |
| 344 | digitalWrite(_DATA_PIN, PinValue::Low); |
| 345 | } |
| 346 | |
| 347 | digitalWrite(_CLOCK_PIN, PinValue::High); |
| 348 | digitalWrite(_CLOCK_PIN, PinValue::Low); |
| 349 | |
| 350 | // Re-initialize pins for SPI |
| 351 | ::SPI.begin(); |
| 352 | } |
| 353 | |
| 354 | // write a block of uint8_ts out in groups of three. len is the total number of uint8_ts to write out. |
| 355 | template <u8 FLAGS, class D, EOrder RGB_ORDER> void writePixels(PixelController<RGB_ORDER> pixels, void* context = nullptr) FL_NOEXCEPT { |
nothing calls this directly
no test coverage detected