Project 2  8×8 Dot-Matrix Display
Neff Site
spi.h
Go to the documentation of this file.
1 
16 #ifndef SPI_H_
17 #define SPI_H_
18 
19 #include <avr/io.h>
20 
21 #define SPI_PORT PORTF
22 #define SPI_MODULE SPIF
23 
24 #define SPI_SS_bp PIN4_bp
25 #define SPI_MOSI_bp PIN5_bp
26 #define SPI_MISO_bp PIN6_bp
27 #define SPI_SCK_bp PIN7_bp
28 
29 #define SPI_SS_bm PIN4_bm
30 #define SPI_MOSI_bm PIN5_bm
31 #define SPI_MISO_bm PIN6_bm
32 #define SPI_SCK_bm PIN7_bm
33 
34 #define SPI_CLOCK_SPEED_gc SPI_PRESCALER_DIV4_gc
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
45 void spi_init(void);
46 
51 void spi_select_slave(void);
52 
58 void spi_deselect_slave(void);
59 
67 uint8_t spi_transfer(uint8_t byte);
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* SPI_H_ */
uint8_t spi_transfer(uint8_t byte)
Transfer one data byte.
void spi_deselect_slave(void)
Dectivate the slave.
void spi_select_slave(void)
Activate the slave.
void spi_init(void)
Initialize interface.
Contact