| 143 | // write a single bit out, which bit from the passed in byte is determined by template parameter |
| 144 | // not the most efficient mechanism in the world - but should be enough for sm16716 and friends |
| 145 | template <u8 BIT> inline void writeBit(u8 b) FL_NOEXCEPT { |
| 146 | // need to wait for all exisiting data to go out the door, first |
| 147 | waitFully(); |
| 148 | disableSPI(); |
| 149 | if(b & (1 << BIT)) { |
| 150 | FastPin<_DATA_PIN>::hi(); |
| 151 | } else { |
| 152 | FastPin<_DATA_PIN>::lo(); |
| 153 | } |
| 154 | |
| 155 | FastPin<_CLOCK_PIN>::hi(); |
| 156 | FastPin<_CLOCK_PIN>::lo(); |
| 157 | enableSPI(); |
| 158 | } |
| 159 | |
| 160 | // write a block of uint8_ts out in groups of three. len is the total number of uint8_ts to write out. The template |
| 161 | // parameters indicate how many uint8_ts to skip at the beginning and/or end of each grouping |