chipKIT™ Basic I/O Shield™ Reference Manual
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
Page
12
of
13
**
none
**
**
Errors:
**
none
**
**
Description:
**
Update the OLED display with the contents of the memory buffer
*/
void
OledUpdate()
{
int
ipag;
int
icol;
BYTE *
pb;
pb = rgbOledBmp;
for (ipag = 0; ipag < cpagOledMax; ipag++) {
PORTClearBits(prtDataCmd, bitDataCmd);
/* Set the page address
*/
Spi2PutByte(0x22);
//Set page command
Spi2PutByte(ipag);
//page number
/* Start at the left column
*/
Spi2PutByte(0x00);
//set low nybble of column
Spi2PutByte(0x10);
//set high nybble of column
PORTSetBits(prtDataCmd, bitDataCmd);
/* Copy this memory page of display data.
*/
OledPutBuffer(ccolOledMax, pb);
pb += ccolOledMax;
}
}
Low-Level SPI Functions
The following functions are used to write data to the display panel using the SPI controller.
/* ------------------------------------------------------------ */
/*** OledPutBuffer
**
**
Parameters:
**
cb
- number of bytes to send/receive
**
rgbTx
- pointer to the buffer to send
**
**
Return Value:
**
none
**
**
Errors:
**
none
**
**
Description:
**
Send the bytes specified in rgbTx to the slave.
*/