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
11
of
13
*/
PORTClearBits(prtVddCtrl, bitVddCtrl);
DelayMs(1);
/* Display off command
*/
Spi2PutByte(0xAE);
/* Bring Reset low and then high
*/
PORTClearBits(prtReset, bitReset);
DelayMs(1);
PORTSetBits(prtReset, bitReset);
/* Send the Set Charge Pump and Set Pre-Charge Period commands
*/
Spi2PutByte(0x8D);
Spi2PutByte(0x14);
Spi2PutByte(0xD9);
Spi2PutByte(0xF1);
/* Turn on VCC and wait 100ms
*/
PORTClearBits(prtVbatCtrl, bitVbatCtrl);
DelayMs(100);
/* Send the commands to invert the display. This puts the display origin
** in the upper left corner.
*/
Spi2PutByte(0xA1);
//remap columns
Spi2PutByte(0xC8);
//remap the rows
/* Send the commands to select sequential COM configuration. This makes the
** display memory non-interleaved.
*/
Spi2PutByte(0xDA);
//set COM configuration command
Spi2PutByte(0x20);
//sequential COM, left/right remap enabled
/* Send Display On command
*/
Spi2PutByte(0xAF);
}
Display Memory Update
This function copies the contents of a 512-byte buffer from PIC32 memory to the display. The display memory is
organized as four pages of 128 bytes each. Each memory page corresponds to an 8-pixel-high stripe across the
display. Each byte in the memory page corresponds to an 8-pixel-high column on the display. The least significant
bit in a display byte is the top most pixel, and the most significant bit the bottom most pixel. The first byte in the
page corresponds to the left most pixels on the display and the last byte the right most pixels.
This function assumes that the display buffer to be copied is the global variable
rgbOledBmp
/* ------------------------------------------------------------ */
/*** OledUpdate
**
**
Parameters:
**
none
**
**
Return Value: