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 151 of file fastspi_bitbang.h.

151 {
152 //cli();
153 if(b & (1 << BIT)) {
155#ifdef ESP32
156 // try to ensure we never have adjacent write opcodes to the same register
160#else
163#endif
164 } else {
167#ifdef ESP32
168 // try to ensure we never have adjacent write opcodes to the same register
170#else
172#endif
173 }
174 //sei();
175 }
Software SPI (aka bit-banging) support Includes aggressive optimizations for when the clock and data ...
static void toggle()
Toggle the pin.
Definition fastpin.h:247
static void lo()
Set the pin state to LOW
Definition fastpin.h:241
static void hi()
Set the pin state to HIGH
Definition fastpin.h:239

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: