39 #if defined(GLCD_DEVICE_AVR8)
44 #if defined(GLCD_CONTROLLER_PCD8544)
53 sbi(DDR(AVR_SS_PORT),AVR_SS_PIN);
59 sbi(DDR(CONTROLLER_MOSI_PORT),CONTROLLER_MOSI_PIN);
60 sbi(DDR(CONTROLLER_SS_PORT),CONTROLLER_SS_PIN);
61 sbi(DDR(CONTROLLER_SCK_PORT),CONTROLLER_SCK_PIN);
64 sbi( DDR(CONTROLLER_SS_PORT), CONTROLLER_SS_PIN );
65 sbi( DDR(CONTROLLER_DC_PORT), CONTROLLER_DC_PIN );
66 sbi( DDR(CONTROLLER_RST_PORT), CONTROLLER_RST_PIN );
75 SPCR = (1<<SPE)|(1<<MSTR);
101 #elif defined(GLCD_CONTROLLER_ST7565R)
110 sbi(DDR(AVR_SS_PORT),AVR_SS_PIN);
113 sbi(DDR(CONTROLLER_SCK_PORT),CONTROLLER_SCK_PIN);
114 sbi(DDR(CONTROLLER_MOSI_PORT),CONTROLLER_MOSI_PIN);
120 cbi(DDR(CONTROLLER_MISO_PORT),CONTROLLER_MISO_PIN);
121 sbi(CONTROLLER_MISO_PORT,CONTROLLER_MISO_PIN);
124 sbi(DDR(CONTROLLER_SS_PORT),CONTROLLER_SS_PIN);
127 sbi(DDR(CONTROLLER_A0_PORT),CONTROLLER_A0_PIN);
130 sbi(CONTROLLER_SS_PORT,CONTROLLER_SS_PIN);
136 SPCR = (1<<SPE) | (1<<MSTR) | (0<<CPOL) | (0<<CPHA);
170 #error "Controller not supported"
179 while(!(SPSR & (1<<SPIF)));
#define PCD8544_FUNCTION_SET
void glcd_spi_write(uint8_t c)
Write a byte to the connected SPI slave.
void glcd_select_screen(uint8_t *buffer, glcd_BoundingBox_t *bbox)
Select screen buffer and bounding box structure.
void glcd_reset(void)
Reset the LCD.
#define PCD8544_EXTENDED_INSTRUCTION
#define PCD8544_DISPLAY_NORMAL
glcd_BoundingBox_t glcd_bbox
Keeps track of bounding box of area on LCD which need to be updated next reresh cycle.
#define PCD8544_DISPLAY_CONTROL
void glcd_all_on(void)
All display points on (native)
void glcd_set_start_line(uint8_t addr)
Set start line/page.
void glcd_command(uint8_t c)
Send command byte to LCD.
void glcd_clear(void)
Clear the display.
void glcd_clear_now(void)
Clear the display immediately, does not buffer.
uint8_t glcd_buffer[GLCD_LCD_WIDTH *GLCD_LCD_HEIGHT/8]
Screen buffer.
#define GLCD_RESET_TIME
Reset duration by glcd_reset(), in milliseconds.
void glcd_init(void)
Initialise the LCD.
void glcd_normal(void)
Set to normal mode.