Plain C AVR library for ST7735 displays
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11 lines
255 B

#include "spi.h"
void spi_init(void) {
// Set MOSI and SCK, SS/CS output, all others input
DDRB = (1<<PB3) | (1<<PB5) | (1<<PB2);
// Enable SPI, Master, set clock rate fck/4, mode 0
SPCR = (1<<SPE) | (1<<MSTR);
// Set SS/CS
PORTB |= (1 << PB2);
}