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.
 
 
 
 

22 lines
303 B

#ifndef _SPI_H_
#define _SPI_H_
#include<avr/io.h>
void spi_init(void);
static inline void spi_write(uint8_t byte) {
SPDR = byte;
while(!(SPSR & (1<<SPIF)));
}
static inline void spi_set_cs(void) {
PORTB |= (1 << PB2);
}
static inline void spi_unset_cs(void) {
PORTB &= ~(1 << PB2);
}
#endif