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 
44 #define HAVE_GPIO_FLANK_T
45 typedef enum {
50 } gpio_flank_t;
57 #define PERIPH_SPI_NEEDS_INIT_CS
58 #define PERIPH_SPI_NEEDS_TRANSFER_BYTE
59 #define PERIPH_SPI_NEEDS_TRANSFER_REG
60 #define PERIPH_SPI_NEEDS_TRANSFER_REGS
61 
69 #define SPI_MODE_SEL(pol, pha) ((pol << 3) | (pha << 2))
70 
78 #define HAVE_SPI_MODE_T
79 typedef enum {
84 } spi_mode_t;
93 #define SPI_CLK_SEL(s2x, pr1, pr0) ((s2x << 2) | (pr1 << 1) | pr0)
94 
101 #define HAVE_SPI_CLK_T
102 typedef enum {
108 } spi_clk_t;
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif /* PERIPH_CPU_COMMON_H */
116 
emit interrupt on rising flank
emit interrupt when pin low
#define SPI_MODE_SEL(pol, pha)
SPI mode select macro.
emit interrupt on both flanks
emit interrupt on falling flank
#define SPI_CLK_SEL(s2x, pr1, pr0)
SPI speed selection macro.