void spi_reset_pulse(void) { RST = 1; dly_ms(1); RST = 0; dly_ms(20); }
void spi_init(void) { ANSELA = 0; ANSELC = 0; RST_T = 0; RST = 1; dly_ms(20); TRISC0 = 0; TRISC2 = 0; SSPSTAT = 0xC0; SSPCON1 = 0x2A; SSP1ADD = 100; sck_dur = 1; spi_set_sck_duration(sck_dur); RST = 0; spi_reset_pulse(); }
void ConfigOled(void) { unsigned char i; OLED_RST = 0; //reset OLED dly_us(5); //waiting for reset delay OLED_RST = 1; //release the line dly_ms(5); //see datasheet setDeviceSPI(DISPLAY); //select the Oled screen for (i = 0; i < sizeof(ssd1306_init_sequence); i++) OledSendCommand(ssd1306_init_sequence[i]); //set all initialization command setDeviceSPI(NONE); currentLine = 0; currentColumn = 0; }