31 #if !defined(CPUID_LEN) || defined(DOXYGEN)
32 # define CPUID_LEN (4U)
38 #if !defined(PM_NUM_MODES) || defined(DOXYGEN)
39 # define PM_NUM_MODES (1U)
45 #define PROVIDES_PM_LAYERED_OFF
48 #if defined(MODULE_PERIPH_GPIO_LINUX) || defined(DOXYGEN)
49 # include <linux/gpio.h>
59 # define GPIO_PORT_SHIFT (24)
64 # define GPIO_PIN(port, pin) (gpio_t)((port << GPIO_PORT_SHIFT) | pin)
69 # define HAVE_GPIO_MODE_T
73 # if !defined(GPIOHANDLE_REQUEST_PULL_DOWN) || defined(DOXYGEN)
74 # define GPIOHANDLE_REQUEST_PULL_DOWN (0xFF)
79 # if !defined(GPIOHANDLE_REQUEST_PULL_UP) || defined(DOXYGEN)
80 # define GPIOHANDLE_REQUEST_PULL_UP (0xFF)
92 GPIO_IN = GPIOHANDLE_REQUEST_INPUT,
95 GPIO_OUT = GPIOHANDLE_REQUEST_OUTPUT,
96 GPIO_OD = GPIOHANDLE_REQUEST_OPEN_DRAIN,
103 # define HAVE_GPIO_FLANK_T
115 #elif defined(MODULE_PERIPH_GPIO_MOCK)
126 void (*cb)(
void *arg);
130 # define GPIO_UNDEF 0
132 # if !defined(GPIO_PORT_MAX) || defined(DOXYGEN)
133 # define GPIO_PORT_MAX (16)
136 # if !defined(GPIO_PIN_MAX) || defined(DOXYGEN)
137 # define GPIO_PIN_MAX (32)
143 extern gpio_mock_t gpio_mock[GPIO_PORT_MAX][GPIO_PIN_MAX];
149 typedef gpio_mock_t*
gpio_t;
155 # define GPIO_PIN(port, pin) \
156 (((port >= 0) && (pin >= 0) && (port < GPIO_PORT_MAX) && (pin < GPIO_PIN_MAX)) \
157 ? &gpio_mock[port][pin] \
165 #define PERIPH_TIMER_PROVIDES_SET
172 #define PROVIDES_PM_OFF
173 #define PROVIDES_PM_SET_LOWEST
181 #if defined(MODULE_PERIPH_SPIDEV_LINUX) || defined(DOXYGEN)
190 # define PERIPH_SPI_NEEDS_TRANSFER_BYTE
194 # define PERIPH_SPI_NEEDS_TRANSFER_REG
198 # define PERIPH_SPI_NEEDS_TRANSFER_REGS
204 # define HAVE_SPI_CLK_T
225 #if !defined(EEPROM_SIZE) || defined(DOXYGEN)
226 # define EEPROM_SIZE (1024U)
229 #ifdef MODULE_PERIPH_CAN
@ GPIO_OUT
select GPIO MASK as output
@ GPIO_IN
select GPIO MASK as input
Peripheral MCU configuration for the Zigduino board.
Implementation of simulated CAN controller driver using SocketCAN on Linux.
gpio_mode_t
Available pin modes.
#define GPIOHANDLE_REQUEST_PULL_UP
Pull-up.
#define GPIOHANDLE_REQUEST_PULL_DOWN
Pull-down.
unsigned int gpio_t
GPIO type identifier.
@ GPIO_FALLING
emit interrupt on falling flank
@ GPIO_RISING
emit interrupt on rising flank
@ GPIO_BOTH
emit interrupt on both flanks
@ GPIO_OD
configure as output in open-drain mode without pull resistor
@ GPIO_IN_PU
configure as input with pull-up resistor
@ GPIO_OD_PU
configure as output in open-drain mode with pull resistor enabled
@ GPIO_IN_PD
configure as input with pull-down resistor
@ SPI_CLK_10MHZ
drive the SPI bus with 10MHz
@ SPI_CLK_5MHZ
drive the SPI bus with 5MHz
@ SPI_CLK_400KHZ
drive the SPI bus with 400KHz
@ SPI_CLK_1MHZ
drive the SPI bus with 1MHz
@ SPI_CLK_100KHZ
drive the SPI bus with 100KHz