blob: 51351a5d19bef54dfd0330ef2d28db1f6e466de9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#ifndef _SPI_H_
#define _SPI_H_
#include <stdint.h>
#include <avr/io.h>
#define PORT_SPI PORTB
#define DDR_SPI DDRB
#define DD_MISO DDB4
#define DD_MOSI DDB3
#define DD_SS DDB2
#define DD_SCK DDB5
inline void spi_cs_low()
{
PORT_SPI &= ~(_BV(DD_SS));
}
inline void spi_cs_high()
{
PORT_SPI |= _BV(DD_SS);
}
extern void spi_init();
extern uint8_t spi_two_byte(uint8_t cmd, uint8_t data);
#endif /* _SPI_H_ */
|