void lcd_transfer_sub_page(uint8_t page, uint8_t offset) { uint8_t idx; uint8_t *memory = lcd_memory; buffer += page * LCD_PAGE_SIZE + offset; /* enable and reset com interface of the ST7565R */ dog_spi_enable_client(); /* set write position */ dog_cmd_mode(); dog_spi_out(0x0b0 | page); /* select current page (ST7565R) */ dog_spi_out(0x010); /* set upper 4 bit of the col adr to 0 */ dog_spi_out(0x000); /* set lower 4 bit of the col adr to 0 */ /* send a complete page */ dog_data_mode(); #ifdef LCD_REVERSE idx = 0; while (idx != LCD_PAGE_WIDTH) { dog_spi_out(buffer[idx++]); } #else /* DOG_REVERSE */ idx = LCD_PAGE_WIDTH; while (idx != 0) { dog_spi_out(buffer[--idx]); } #endif /* disable com interface of the ST7565R */ dog_spi_disable_client(); }
void dog_SetInvertPixelMode(uint8_t val) { val &= 1; val |= 0x0a6; /* invert pixel mode */ dog_spi_enable_client(); dog_cmd_mode(); dog_spi_out(val); dog_data_mode(); dog_spi_disable_client(); }
void dog_SetContrast(uint8_t val) { val &= 63; dog_spi_enable_client(); dog_cmd_mode(); dog_spi_out(0x081); /* set contrast */ dog_spi_out(val); /* contrast value */ dog_data_mode(); dog_spi_disable_client(); }
void dog_SetUC1610GrayShade(uint8_t val) { #if defined(DOGXL160_HW_BW) || defined(DOGXL160_HW_GR) val &= 3; dog_spi_enable_client(); dog_cmd_mode(); dog_spi_out(0x0d0 | val); /* set RMS gray level separation value */ dog_data_mode(); dog_spi_disable_client(); #endif }
static void dog_transfer_page(void) { uint8_t idx; /* enable and reset com interface of the ST7565R */ dog_spi_enable_client(); /* set write position */ dog_cmd_mode(); dog_spi_out(0x0b0 | dog_curr_page ); /* select current page */ dog_spi_out(0x010 ); /* set upper 4 bit of the col adr to 0 */ dog_spi_out(0x000 ); /* set lower 4 bit of the col adr to 0 */ /* send a complete page */ dog_data_mode(); //#ifdef DOG_REVERSE if (dog_reverse) { idx = 0; while( idx != DOG_PAGE_WIDTH ) { dog_spi_out(dog_page_buffer[idx]); idx++; } //#else } else { idx = DOG_PAGE_WIDTH; while( idx != 0 ) { idx--; dog_spi_out(dog_page_buffer[idx]); } //#endif } /* disable com interface of the ST7565R */ dog_spi_disable_client(); }