implemented lld_lcdWriteGPIO() for SSD1289

ugfx_release_2.6
Tectu 2012-06-24 16:44:58 +02:00
parent 89a597bfc4
commit 73e0021db2
1 changed files with 9 additions and 6 deletions

View File

@ -7,12 +7,17 @@ uint16_t DeviceCode;
extern uint16_t lcd_width, lcd_height;
#ifdef LCD_USE_GPIO
static __inline lld_lcdWriteGPIO(uint16_t d) {
LCD_DATA_PORT_1->BSRR = (((~d >> 8) << 16) | (d >> 8) << LCD_DATA_PORT_1_BASE);
LCD_DATA_PORT_2->BSRR = (((~d & 0xFF) << 16) | (d & 0xFF) << LCD_DATA_PORT_2_BASE);
}
static __inline void lld_lcdWriteIndex(uint16_t index) {
Clr_RS;
Set_RD;
LCD_DATA_PORT_1->BSRR = (((~index >> 8) << 16) | (index >> 8) << LCD_DATA_PORT_1_BASE);
LCD_DATA_PORT_2->BSRR = (((~index & 0xFF) << 16) | (index & 0xFF) << LCD_DATA_PORT_2_BASE);
lld_lcdWriteGPIO(index);
Clr_WR;
Set_WR;
@ -21,8 +26,7 @@ static __inline void lld_lcdWriteIndex(uint16_t index) {
static __inline void lld_lcdWriteData(uint16_t data) {
Set_RS;
LCD_DATA_PORT_1->BSRR = (((~data >> 8) << 16) | (data >> 8) << LCD_DATA_PORT_1_BASE);
LCD_DATA_PORT_2->BSRR = (((~data & 0xFF) << 16) | (data & 0xFF) << LCD_DATA_PORT_2_BASE);
lld_lcdWriteGPIO(data);
Clr_WR;
Set_WR;
@ -85,8 +89,7 @@ __inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
Set_RS;
for(i = 0; i < size; i++) {
LCD_DATA_PORT_1->BSRR = (((~buffer[i] >> 8) << 16) | (buffer[i] >> 8) << LCD_DATA_PORT_1_BASE);
LCD_DATA_PORT_2->BSRR = (((~buffer[i] & 0xFF) << 16) | (buffer[i] & 0xFF) << LCD_DATA_PORT_2_BASE);
lld_lcdWriteGPIO(buffer[i]);
Clr_WR;
Set_WR;
}