MCPcopy Create free account
hub / github.com/cbm80amiga/Arduino_ST7789_Fast / writeSPI

Method writeSPI

Arduino_ST7789_Fast.cpp:121–143  ·  view source on GitHub ↗

---------------------------------------------------------- speed test results: in AVR best performance mode -> about 6.9 Mbps in compatibility mode (SPI.transfer(c)) -> about 4 Mbps

Source from the content-addressed store, hash-verified

119// in AVR best performance mode -> about 6.9 Mbps
120// in compatibility mode (SPI.transfer(c)) -> about 4 Mbps
121inline void Arduino_ST7789::writeSPI(uint8_t c)
122{
123#ifdef COMPATIBILITY_MODE
124 SPI.transfer(c);
125#else
126 SPDR = c;
127 /*
128 asm volatile("nop"); // 8 NOPs seem to be enough for 16MHz AVR @ DIV2 to avoid using while loop
129 asm volatile("nop");
130 asm volatile("nop");
131 asm volatile("nop");
132 asm volatile("nop");
133 asm volatile("nop");
134 asm volatile("nop");
135 asm volatile("nop");
136 */
137 asm volatile("rjmp .+0\n");
138 asm volatile("rjmp .+0\n");
139 asm volatile("rjmp .+0\n");
140 asm volatile("rjmp .+0\n");
141 //while(!(SPSR & _BV(SPIF))) ;
142#endif
143}
144
145// ----------------------------------------------------------
146// fast method to send multiple 16-bit values via SPI

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected