The friendly Operating System for the Internet of Things
lm4f120/include/periph_cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Rakendra Thapa <rakendrathapa@gmail.com>
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 
19 #ifndef PERIPH_CPU_H
20 #define PERIPH_CPU_H
21 
22 #include "periph/dev_enums.h"
23 #include "cpu_conf.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 #define CPUID_LEN (12U)
33 
38 #define HAVE_GPIO_T
39 typedef uint32_t gpio_t;
40 #define GPIO_PIN(x,y) ((gpio_t)((x<<4) | y))
41 
43 #ifndef DOXYGEN
44 
48 #define HAVE_GPIO_MODE_T
49 typedef enum {
50  GPIO_IN = (GPIO_DIR_MODE_IN | (GPIO_PIN_TYPE_STD << 4)),
51  GPIO_IN_PD = (GPIO_DIR_MODE_IN | (GPIO_PIN_TYPE_STD_WPD << 4)),
52  GPIO_IN_PU = (GPIO_DIR_MODE_IN | (GPIO_PIN_TYPE_STD_WPU << 4)),
53  GPIO_OUT = (GPIO_DIR_MODE_OUT | (GPIO_PIN_TYPE_STD << 4)),
54  GPIO_OD = (GPIO_DIR_MODE_OUT | (GPIO_PIN_TYPE_OD << 4)),
55  GPIO_OD_PU = (GPIO_DIR_MODE_OUT | (GPIO_PIN_TYPE_OD_WPU << 4)),
56 } gpio_mode_t;
58 #endif /* ndef DOXYGEN */
59 
64 #define HAVE_GPIO_DIR_T
65 typedef enum {
66  GPIO_DIR_IN = GPIO_DIR_MODE_IN,
67  GPIO_DIR_OUT = GPIO_DIR_MODE_OUT
68 } gpio_dir_t;
71 #ifndef DOXYGEN
72 
76 #define HAVE_GPIO_FLANK_T
77 typedef enum {
78  GPIO_FALLING = GPIO_FALLING_EDGE,
79  GPIO_RISING = GPIO_RISING_EDGE,
80  GPIO_BOTH = GPIO_BOTH_EDGES
81 } gpio_flank_t;
83 #endif /* ndef DOXYGEN */
84 
88 enum {
89  PORT_A = 0,
90  PORT_B = 1,
91  PORT_C = 2,
92  PORT_D = 3,
93  PORT_E = 4,
94  PORT_F = 5,
95 };
96 
100 #ifndef DOXYGEN
101 #define HAVE_ADC_RES_T
102 typedef enum {
103  ADC_RES_6BIT = 0xa00,
104  ADC_RES_8BIT = 0xb00,
105  ADC_RES_10BIT = ADC_RES_10BIT_S,
106  ADC_RES_12BIT = ADC_RES_12BIT_S,
107  ADC_RES_14BIT = 0xc00,
108  ADC_RES_16BIT = 0xd00,
109 } adc_res_t;
110 #endif /* ndef DOXYGEN */
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif /* PERIPH_CPU_H */
117 
Implementation specific CPU configuration options.
emit interrupt on rising flank
Definition: gpio.h:114
ADC resolution: 12 bit.
emit interrupt on both flanks
Definition: gpio.h:115
gpio_flank_t
Definition of possible active flanks for external interrupt mode.
Definition: gpio.h:112
ADC resolution: 14 bit (not supported)
Device enumerations for backward compatibility with existing peripheral driver implementations.
configure pin as output
ADC resolution: 10 bit.
unsigned int gpio_t
GPIO type identifier.
Definition: gpio.h:69
ADC resolution: 16 bit (not supported)
configure pin as input
ADC resolution: 8 bit.
ADC resolution: 6 bit.
emit interrupt on falling flank
Definition: gpio.h:113
input, pull-up
input, no pull
not supported
input, pull-down