FastLED 3.9.15
Loading...
Searching...
No Matches

◆ writeBit() [1/4]

template<uint8_t DATA_PIN, uint8_t CLOCK_PIN, uint32_t SPI_SPEED>
template<uint8_t BIT>
static void AVRSoftwareSPIOutput< DATA_PIN, CLOCK_PIN, SPI_SPEED >::writeBit ( uint8_t b)
inlinestatic

Write the BIT'th bit out via SPI, setting the data pin then strobing the clock.

Template Parameters
BITthe bit index in the byte
Parameters
bthe byte to read the bit from

Definition at line 153 of file fastspi_bitbang.h.

153 {
154 //cli();
155 if(b & (1 << BIT)) {
157#ifdef ESP32
158 // try to ensure we never have adjacent write opcodes to the same register
162#else
165#endif
166 } else {
169#ifdef ESP32
170 // try to ensure we never have adjacent write opcodes to the same register
172#else
174#endif
175 }
176 //sei();
177 }
Software SPI (aka bit-banging) support Includes aggressive optimizations for when the clock and data ...
static void toggle()
Toggle the pin.
Definition fastpin.h:249
static void lo()
Set the pin state to LOW
Definition fastpin.h:243
static void hi()
Set the pin state to HIGH
Definition fastpin.h:241

References CLOCK_HI_DELAY, CLOCK_LO_DELAY, FastPin< PIN >::hi(), FastPin< PIN >::lo(), and FastPin< PIN >::toggle().

Referenced by writeBit(), writeByte(), writeByte(), writeByte(), writeByte(), and writePixels().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: