コード例 #1
0
ファイル: Display_SSD1327.c プロジェクト: ploop/evic-sdk
void Display_SSD1327_Flip() {
	bool flipped;

	flipped = Display_IsFlipped();

	Display_SSD_SendCommand(SSD1327_SET_OFFSET);
	Display_SSD_SendCommand(flipped ? 0x80 : 0x00);
	Display_SSD_SendCommand(SSD1327_SET_REMAP);
	Display_SSD_SendCommand(flipped ? 0x57 : 0x44);
}
コード例 #2
0
ファイル: Display_SSD1327.c プロジェクト: ploop/evic-sdk
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);
			}
		}
	}
}
コード例 #3
0
ファイル: Display_SSD1327.c プロジェクト: ploop/evic-sdk
void Display_SSD1327_SetInverted(bool invert) {
	Display_SSD_SendCommand(invert ? SSD1327_INVERTED_DISPLAY : SSD1327_NORMAL_DISPLAY);
}
コード例 #4
0
ファイル: Display_SSD.c プロジェクト: MaDc0wUSP/evic-sdk
void Display_SSD_SetContrast(uint8_t contrast) {
	Display_SSD_SendCommand(SSD_SET_CONTRAST_LEVEL);
	Display_SSD_SendCommand(contrast);
}
コード例 #5
0
ファイル: Display_SSD.c プロジェクト: MaDc0wUSP/evic-sdk
void Display_SSD_SetOn(uint8_t isOn) {
	Display_SSD_SendCommand(isOn ? SSD_DISPLAY_ON : SSD_DISPLAY_OFF);
}