The friendly Operating System for the Internet of Things
atmega_common/include/periph_cpu_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 HAW Hamburg
3  * 2016 Freie Universit├Ąt Berlin
4  * 2016 INRIA
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
23 #ifndef PERIPH_CPU_COMMON_H
24 #define PERIPH_CPU_COMMON_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 #define GPIO_PIN(x, y) ((x << 4) | y)
34 
39 #define PERIPH_SPI_NEEDS_INIT_CS
40 #define PERIPH_SPI_NEEDS_TRANSFER_BYTE
41 #define PERIPH_SPI_NEEDS_TRANSFER_REG
42 #define PERIPH_SPI_NEEDS_TRANSFER_REGS
43 
51 #define SPI_MODE_SEL(pol, pha) ((pol << 3) | (pha << 2))
52 
60 #define HAVE_SPI_MODE_T
61 typedef enum {
66 } spi_mode_t;
75 #define SPI_CLK_SEL(s2x, pr1, pr0) ((s2x << 2) | (pr1 << 1) | pr0)
76 
83 #define HAVE_SPI_CLK_T
84 typedef enum {
90 } spi_clk_t;
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif /* PERIPH_CPU_COMMON_H */
98 
#define SPI_MODE_SEL(pol, pha)
SPI mode select macro.
#define SPI_CLK_SEL(s2x, pr1, pr0)
SPI speed selection macro.