aboutsummaryrefslogtreecommitdiff
path: root/spi.h
blob: 86149f7a2fcf6a85881e4f68c9d3e288bae9025f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <avr/io.h>
#include <stdint.h>

#ifndef _IOE_SPI_H_
#define _IOE_SPI_H_

inline void ioe_spi_init(void);
inline int ioe_spi_bussy(void);
inline void ioe_spi_join(void);
#ifdef IOE_SPI_MASTER
inline int8_t ioe_spi_transfer(int8_t data);
#else /* IOE_SPI_MASTER */
inline void ioe_spi_expose(int8_t data);
#endif /* IOE_SPI_MASTER */

// Following function must be user defined
inline void ioe_spi_retrieve(int8_t);

#if !(__MCU_ATmega328p__ || __MCU_ATmega32U4p__)
#error "SPI is not probably supported by your hardware."
#endif

#endif /* _IOE_SPI_H_ */