Digilent chipKIT Basic I/O Shield Manual de referência - Página 12

Procurar online ou descarregar pdf Manual de referência para Sistemas de E/S Digilent chipKIT Basic I/O Shield. Digilent chipKIT Basic I/O Shield 14 páginas.

chipKIT™ Basic I/O Shield™ Reference Manual
**
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);
Spi2PutByte(ipag);
/* Start at the left column
*/
Spi2PutByte(0x00);
Spi2PutByte(0x10);
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.
*/
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
//Set page command
//page number
//set low nybble of column
//set high nybble of column
Page 12 of 13