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

Function LCD_writeControlReg

Scan/Devices/STLcd/lcd_scan.c:187–220  ·  view source on GitHub ↗

Write to a control register

Source from the content-addressed store, hash-verified

185
186// Write to a control register
187void LCD_writeControlReg( uint8_t byte )
188{
189#if defined(_kinetis_)
190 // Wait for TxFIFO to be empt
191 while ( SPI0_TxFIFO_CNT != 0 );
192
193 // Set A0 low to enter control register mode
194 GPIOC_PCOR |= (1<<7);
195
196 // Write byte to SPI FIFO
197 SPI_write( &byte, 1 );
198
199 // Wait for TxFIFO to be empty
200 while ( SPI0_TxFIFO_CNT != 0 );
201
202 // Make sure data has transferred
203 delay_us(10); // XXX Adjust if SPI speed changes
204
205 // Set A0 high to go back to display register mode
206 GPIOC_PSOR |= (1<<7);
207#elif defined(_sam_)
208 // Set A0 low to enter control register mode
209 PIOC->PIO_CODR= (1<<7);
210
211 // Write byte to SPI FIFO
212 SPI_write( &byte, 1 );
213
214 // Make sure data has transferred
215 delay_us(10); // XXX Adjust if SPI speed changes
216
217 // Set A0 high to go back to display register mode
218 PIOC->PIO_SODR= (1<<7);
219#endif
220}
221
222// Write to a data register with a0 bit high
223void LCD_writeDataReg( uint8_t byte )

Callers 7

LCD_writeDisplayRegFunction · 0.85
LCD_clearPageFunction · 0.85
LCD_clearFunction · 0.85
LCD_initializeFunction · 0.85
cliFunc_lcdCmdFunction · 0.85
cliFunc_lcdDispFunction · 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…