Contiki-Inga 3.x
xmega_spi.h
1 #ifndef __XMEGA_SPI_H__
2 #define __XMEGA_SPI_H__
3 
4 #include <avr/io.h>
5 #include <stdint.h>
6 
7 /*
8  CLK2X | 0 | 1 |
9  -------------------------------------------------
10  SPI_PRESCALER_DIV4_gc | /4 | /2 |
11  SPI_PRESCALER_DIV16_gc | /16 | /8 |
12  SPI_PRESCALER_DIV64_gc | /64 | /32 |
13  SPI_PRESCALER_DIV128_gc | /128 | /64 |
14 */
15 
16 #ifndef SPI_PRESCALER_DIV2_gc
17  #define SPI_PRESCALER_DIV2_gc (SPI_PRESCALER_DIV4_gc | SPI_CLK2X_bm)
18 #endif
19 
20 #ifndef SPI_PRESCALER_DIV8_gc
21  #define SPI_PRESCALER_DIV8_gc (SPI_PRESCALER_DIV16_gc | SPI_CLK2X_bm)
22 #endif
23 
24 #ifndef SPI_PRESCALER_DIV32_gc
25  #define SPI_PRESCALER_DIV32_gc (SPI_PRESCALER_DIV64_gc | SPI_CLK2X_bm)
26 #endif
27 
28 
29 #endif // #ifndef __XMEGA_SPI_H__