This commit is contained in:
trsaunders 2012-06-27 16:40:23 +01:00
parent c10f54e5af
commit 351c50cc48
2 changed files with 35 additions and 6 deletions

View File

@ -238,6 +238,18 @@ __inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) {
}
}
__inline void lld_lcdReadStreamStart(void) {
/* TODO */
}
__inline void lld_lcdReadStreamStop(void) {
/* TODO */
}
__inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
/* TODO */
}
void lld_lcdFillArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) {
uint32_t index = 0, area;
@ -350,13 +362,33 @@ uint16_t lld_lcdGetWidth(void) {
return lcd_width;
}
/* a positive lines value shifts the screen up, negative down */
/* TODO: test this */
void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) {
uint16_t row0, row1;
uint16_t i;
lld_lcdSetWindow(x0, y0, x1, y1);
/* if negative shift, then subtract from the height of the area */
lines = (lines < 0) ? ((y1-y0) + lines) : lines;
for(i = 0; i < ((y1-y0) - abs(lines)); i++) {
if(lines > 0) {
row0 = y0 + i + lines;
row1 = y0 + i;
} else {
row0 = (y1 - i - 1) + lines;
row1 = (y1 - i - 1);
}
/* TODO: implement */
/* read row0 into the buffer and then write at row1*/
lld_lcdSetWindow(x0, row0, x1, row0);
lld_lcdReadStreamStart();
lld_lcdReadStream(buf, x1-x0);
lld_lcdReadStreamStop();
lld_lcdSetWindow(x0, row1, x1, row1);
lld_lcdWriteStreamStart();
lld_lcdWriteStream(buf, x1-x0);
lld_lcdWriteStreamStop();
}
}

3
glcd.c
View File

@ -317,6 +317,3 @@ void lcdDrawCircle(uint16_t x, uint16_t y, uint16_t radius, uint8_t filled, uint
void lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) {
lld_lcdVerticalScroll(x0,y0,x1,y1,lines);
}