Digilent chipKIT Basic I/O Shield Reference Manual - Page 11

Browse online or download pdf Reference Manual for I/O Systems Digilent chipKIT Basic I/O Shield. Digilent chipKIT Basic I/O Shield 14 pages.

chipKIT™ Basic I/O Shield™ Reference Manual
*/
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);
Spi2PutByte(0xC8);
/* Send the commands to select sequential COM configuration. This makes the
** display memory non-interleaved.
*/
Spi2PutByte(0xDA);
Spi2PutByte(0x20);
/* 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
/* ------------------------------------------------------------ */
/*** OledUpdate
**
**
Parameters:
**
none
**
**
Return Value:
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
//remap columns
//remap the rows
//set COM configuration command
//sequential COM, left/right remap enabled
rgbOledBmp
Page 11 of 13