diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2015-02-07 23:55:40 +0300 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2015-02-07 23:55:40 +0300 |
commit | 23d79916dbd18a4fa2073123333a8987f75c7376 (patch) | |
tree | cac506efd05c122434a7be8f7cb8c568abc18341 /fastspi_nop.h | |
parent | f6c91d3687c80be94ecc81430b4b3d5288f4156b (diff) |
Making clockless code compile in conditionally.
Diffstat (limited to 'fastspi_nop.h')
-rw-r--r-- | fastspi_nop.h | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/fastspi_nop.h b/fastspi_nop.h index 64cd5128..e9cd4aa7 100644 --- a/fastspi_nop.h +++ b/fastspi_nop.h @@ -6,13 +6,14 @@ // idea of interfaces - it's possible this could be done with virtual classes, need to decide if i want that overhead) template <uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint8_t _SPI_CLOCK_DIVIDER> class NOPSPIOutput { + Selectable *m_pSelect; public: - NOPSPIOutput() { /* TODO */ } - NOPSPIOutput(Selectable *pSelect) { /* TODO */ } + NOPSPIOutput() { m_pSelect = NULL; } + NOPSPIOutput(Selectable *pSelect) { m_pSelect = pSelect; } // set the object representing the selectable - void setSelect(Selectable *pSelect) { /* TODO */ } + void setSelect(Selectable *pSelect) { m_pSelect = pSelect; } // initialize the SPI subssytem void init() { /* TODO */ } @@ -20,19 +21,22 @@ public: // latch the CS select void select() { /* TODO */ } - // release the CS select + // release the CS select void release() { /* TODO */ } // wait until all queued up data has been written void waitFully(); - + + // not the most efficient mechanism in the world - but should be enough for sm16716 and friends + template <uint8_t BIT> inline static void writeBit(uint8_t b) { /* TODO */ + // write a byte out via SPI (returns immediately on writing register) void writeByte(uint8_t b) { /* TODO */ } // write a word out via SPI (returns immediately on writing register) void writeWord(uint16_t w) { /* TODO */ } // A raw set of writing byte values, assumes setup/init/waiting done elsewhere (static for use by adjustment classes) - static void writeBytesValueRaw(uint8_t value, int len) { /* TODO */ } + static void writeBytesValueRaw(uint8_t value, int len) { /* TODO */ } // A full cycle of writing a value for len bytes, including select, release, and waiting void writeBytesValue(uint8_t value, int len) { /* TODO */ } @@ -43,21 +47,8 @@ public: // write a single bit out, which bit from the passed in byte is determined by template parameter template <uint8_t BIT> inline static void writeBit(uint8_t b) { /* TODO */ } - template <uint8_t SKIP, class D, EOrder RGB_ORDER> void writeBytes3(register uint8_t *data, int len, register uint8_t scale) { /* TODO*/ } - - // template instantiations for writeBytes 3 - template <uint8_t SKIP, EOrder RGB_ORDER> void writeBytes3(register uint8_t *data, int len, register uint8_t scale) { - writeBytes3<SKIP, DATA_NOP, RGB_ORDER>(data, len, scale); - } - template <class D, EOrder RGB_ORDER> void writeBytes3(register uint8_t *data, int len, register uint8_t scale) { - writeBytes3<0, D, RGB_ORDER>(data, len, scale); - } - template <EOrder RGB_ORDER> void writeBytes3(register uint8_t *data, int len, register uint8_t scale) { - writeBytes3<0, DATA_NOP, RGB_ORDER>(data, len, scale); - } - void writeBytes3(register uint8_t *data, int len, register uint8_t scale) { - writeBytes3<0, DATA_NOP, RGB>(data, len, scale); + template <uint8_t FLAGS, class D, EOrder RGB_ORDER> void writePixels(PixelController<RGB_ORDER> pixels) { /* TODO */ } }; -#endif
\ No newline at end of file +#endif |