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

◆ writeBit() [1/4]

template<uint8_t DATA_PIN, uint8_t CLOCK_PIN, fl::u32 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 154 of file fastspi_bitbang.h.

154 {
155 //cli();
156 if(b & (1 << BIT)) {
158#ifdef ESP32
159 // try to ensure we never have adjacent write opcodes to the same register
163#else
166#endif
167 } else {
170#ifdef ESP32
171 // try to ensure we never have adjacent write opcodes to the same register
173#else
175#endif
176 }
177 //sei();
178 }
Software SPI (aka bit-banging) support Includes aggressive optimizations for when the clock and data ...
static void toggle()
Toggle the pin.
Definition fastpin.h:326
static void lo()
Set the pin state to LOW
Definition fastpin.h:320
static void hi()
Set the pin state to HIGH
Definition fastpin.h:318

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: