aboutsummaryrefslogtreecommitdiff
path: root/src/spi.c
blob: adf858d6c501221d6d511d7867fb9add60dc99ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <spi.h>

#ifdef CONFIG_SPI

volatile int8_t _spi_busy;
volatile Mutex spi_mutex;

void (*spi_receive) (uint8_t data) = 0;

ISR(SPI_STC_vect, ISR_BLOCK) {
    _spi_busy = 0;
    if (spi_receive != NULL) {
        spir_w(SPDR);
    }
}

#endif /* CONFIG_SPI */