MCPcopy Create free account
hub / github.com/kiibohd/controller / LCD_writeDataReg

Function LCD_writeDataReg

Scan/Devices/STLcd/lcd_scan.c:223–251  ·  view source on GitHub ↗

Write to a data register with a0 bit high

Source from the content-addressed store, hash-verified

221
222// Write to a data register with a0 bit high
223void LCD_writeDataReg( uint8_t byte )
224{
225#if defined(_kinetis_)
226 // Wait for TxFIFO to be empt
227 while ( SPI0_TxFIFO_CNT != 0 );
228
229 // Set A0 high to enter display register mode
230 GPIOC_PSOR |= (1<<7);
231
232 // Write byte to SPI FIFO
233 SPI_write( &byte, 1 );
234
235 // Wait for TxFIFO to be empty
236 while ( SPI0_TxFIFO_CNT != 0 );
237
238 // Make sure data has transferred
239 delay_us(10); // XXX Adjust if SPI speed changes
240#elif defined(_sam_)
241 // Set A0 high to enter display register mode
242 PIOC->PIO_SODR= (1<<7);
243
244 // Write byte to SPI FIFO
245 SPI_write( &byte, 1 );
246
247 // Make sure data has transferred
248 delay_us(10); // XXX Adjust if SPI speed changes
249#endif
250
251}
252
253// Write to display register
254// Pages 0-7 normal display

Callers 1

cliFunc_lcdCmdFunction · 0.85

Calls 2

SPI_writeFunction · 0.85
delay_usFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…