Ejemplo n.º 1
0
void Display_SSD1327_Update(const uint8_t *framebuf) {
	int col, row, bit;
	uint8_t value, pixelOne, pixelTwo;

	Display_SSD_SendCommand(SSD1327_SET_ROW_ADDRESS);
	Display_SSD_SendCommand(0x00); // Start
	Display_SSD_SendCommand(0x7F); // End

	Display_SSD_SendCommand(SSD1327_SET_COL_ADDRESS);
	Display_SSD_SendCommand(0x10); // Start
	Display_SSD_SendCommand(0x2F); // End

	// SSD1327 uses 4 bits per pixel but framebuffer is 1 bit per pixel.
	for(col = 0; col < DISPLAY_WIDTH; col += 2) {
		for(row = 0; row < (DISPLAY_HEIGHT / 8); row++) {
			for(bit = 0; bit < 8; bit++) {
				value = 0x0;

				pixelOne = framebuf[row + ((DISPLAY_HEIGHT / 8) * col)] >> bit & 0x01;
				pixelTwo = framebuf[row + ((DISPLAY_HEIGHT / 8) * (col + 1))] >> bit & 0x01;

				value |= (pixelOne) ? GRAYLOW   : 0x00;
				value |= (pixelTwo) ? GRAYHIGH  : 0x00;

				Display_SSD_Write(1, &value, 1);
			}
		}
	}
}
Ejemplo n.º 2
0
void Display_SSD1327_SendInitCmds() {
	Display_SSD_Write(0, Display_SSD1327_initCmds, sizeof(Display_SSD1327_initCmds));
}
Ejemplo n.º 3
0
void Display_SSD_SendCommand(uint8_t cmd) {
	Display_SSD_Write(0, &cmd, 1);
}