nrf5/drivers: Updating sharp memory display driver and python module to a working state.

This commit is contained in:
Glenn Ruben Bakke 2017-01-19 20:43:23 +01:00
parent 4cef9cd480
commit 158edcad2c
2 changed files with 13 additions and 5 deletions

View File

@ -92,12 +92,17 @@ void driver_ls0xxb7dxxx_clear(uint16_t color)
}
void driver_ls0xxb7dxxx_update_line(uint16_t line, framebuffer_byte_t * p_bytes, uint16_t len) {
// update single line - 0x01 <line_num> <50bytes data> 0x00 0x00
// update multi line - 0x01 <line_num> <50bytes data> 0x00 [<line_num> <50bytes data> 0x00] 0x00
mp_hal_pin_high(mp_cs_pin);
mp_hal_delay_us(3);
raw_write(0x01);
raw_write(line);
for (uint8_t i = 0; i < len; i++)
for (uint8_t i = 0; i < 50; i++)
{
uint8_t byte = (uint8_t)((uint8_t *)p_bytes)[i];
raw_write(~byte);
@ -105,6 +110,9 @@ void driver_ls0xxb7dxxx_update_line(uint16_t line, framebuffer_byte_t * p_bytes,
raw_write(0x00);
raw_write(0x00);
mp_hal_delay_us(1);
mp_hal_pin_low(mp_cs_pin);
}

View File

@ -54,8 +54,8 @@ typedef struct _lcd_ls0xxb7dxxx_obj_t {
pin_obj_t * pin_power_charge;
} lcd_ls0xxb7dxxx_obj_t;
#define LCD_LS0XXB7DXXX_COLOR_WHITE 0
#define LCD_LS0XXB7DXXX_COLOR_BLACK 1
#define LCD_LS0XXB7DXXX_COLOR_BLACK 0
#define LCD_LS0XXB7DXXX_COLOR_WHITE 1
static void set_pixel(void * p_display,
uint16_t x,
@ -64,9 +64,9 @@ static void set_pixel(void * p_display,
lcd_ls0xxb7dxxx_obj_t *self = (lcd_ls0xxb7dxxx_obj_t *)p_display;
if (color == LCD_LS0XXB7DXXX_COLOR_BLACK) {
framebuffer_pixel_clear(self->framebuffer, x, y);
} else {
framebuffer_pixel_set(self->framebuffer, x, y);
} else {
framebuffer_pixel_clear(self->framebuffer, x, y);
}
}