lpc1768/include/periph_cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef PERIPH_CPU_H
21 #define PERIPH_CPU_H
22 
23 #include <stdint.h>
24 
25 #include "cpu.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define HAVE_GPIO_T
36 typedef uint8_t gpio_t;
42 #define GPIO_PIN(port, pin) (gpio_t)((port << 5) | pin)
43 
48 #define PIN_DIR_IN (0x00 << 0)
49 #define PIN_DIR_OUT (0x01 << 0)
50 #define PIN_MODE_PU (0x00 << 1)
51 #define PIN_MODE_PD (0x02 << 1)
52 #define PIN_MODE_NONE (0x03 << 1)
53 #define PIN_MODE_OD (0x01 << 3)
54 
55 #define HAVE_GPIO_MODE_T
56 typedef enum {
57  GPIO_IN = (PIN_DIR_IN | PIN_MODE_NONE),
58  GPIO_IN_PD = (PIN_DIR_IN | PIN_MODE_PD),
59  GPIO_IN_PU = (PIN_DIR_IN | PIN_MODE_PU),
60  GPIO_OUT = (PIN_DIR_OUT | PIN_MODE_NONE),
61  GPIO_OD = (PIN_DIR_OUT | PIN_MODE_OD),
62  GPIO_OD_PU = (PIN_DIR_OUT | PIN_MODE_OD | PIN_MODE_PU)
63 } gpio_mode_t;
69 #define PROVIDES_PM_LAYERED_OFF
70 
74 #define PM_NUM_MODES (2U)
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif /* PERIPH_CPU_H */
81 
push-pull output
unsigned int gpio_t
GPIO type identifier.
Definition: gpio.h:69
in with pull-up
in without pull-up/down
open-drain output
in with pull-down
open-drain output with pull-up