PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

65 行
2.4KB

  1. #ifndef __INC_FASTSPI_NOP_H
  2. #define __INC_FASTSPI_NOP_H
  3. #if 0 // Guard against the arduino ide idiotically including every header file
  4. #include "FastLED.h"
  5. FASTLED_NAMESPACE_BEGIN
  6. /// A nop/stub class, mostly to show the SPI methods that are needed/used by the various SPI chipset implementations. Should
  7. /// be used as a definition for the set of methods that the spi implementation classes should use (since C++ doesn't support the
  8. /// idea of interfaces - it's possible this could be done with virtual classes, need to decide if i want that overhead)
  9. template <uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
  10. class NOPSPIOutput {
  11. Selectable *m_pSelect;
  12. public:
  13. NOPSPIOutput() { m_pSelect = NULL; }
  14. NOPSPIOutput(Selectable *pSelect) { m_pSelect = pSelect; }
  15. /// set the object representing the selectable
  16. void setSelect(Selectable *pSelect) { m_pSelect = pSelect; }
  17. /// initialize the SPI subssytem
  18. void init() { /* TODO */ }
  19. /// latch the CS select
  20. void select() { /* TODO */ }
  21. /// release the CS select
  22. void release() { /* TODO */ }
  23. /// wait until all queued up data has been written
  24. void waitFully();
  25. /// not the most efficient mechanism in the world - but should be enough for sm16716 and friends
  26. template <uint8_t BIT> inline static void writeBit(uint8_t b) { /* TODO */ }
  27. /// write a byte out via SPI (returns immediately on writing register)
  28. void writeByte(uint8_t b) { /* TODO */ }
  29. /// write a word out via SPI (returns immediately on writing register)
  30. void writeWord(uint16_t w) { /* TODO */ }
  31. /// A raw set of writing byte values, assumes setup/init/waiting done elsewhere (static for use by adjustment classes)
  32. static void writeBytesValueRaw(uint8_t value, int len) { /* TODO */ }
  33. /// A full cycle of writing a value for len bytes, including select, release, and waiting
  34. void writeBytesValue(uint8_t value, int len) { /* TODO */ }
  35. /// A full cycle of writing a raw block of data out, including select, release, and waiting
  36. void writeBytes(uint8_t *data, int len) { /* TODO */ }
  37. /// write a single bit out, which bit from the passed in byte is determined by template parameter
  38. template <uint8_t BIT> inline static void writeBit(uint8_t b) { /* TODO */ }
  39. /// write out pixel data from the given PixelController object
  40. template <uint8_t FLAGS, class D, EOrder RGB_ORDER> void writePixels(PixelController<RGB_ORDER> pixels) { /* TODO */ }
  41. };
  42. FASTLED_NAMESPACE_END
  43. #endif
  44. #endif