libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
l4/gpio.h
Go to the documentation of this file.
1
/** @defgroup gpio_defines GPIO Defines
2
*
3
* @brief <b>Defined Constants and Types for the STM32L4xx General Purpose I/O</b>
4
*
5
* @ingroup STM32L4xx_defines
6
*
7
* @version 1.0.0
8
*
9
* @date 12 November 2015
10
*
11
* LGPL License Terms @ref lgpl_license
12
*/
13
14
/*
15
* This file is part of the libopencm3 project.
16
*
17
* This library is free software: you can redistribute it and/or modify
18
* it under the terms of the GNU Lesser General Public License as published by
19
* the Free Software Foundation, either version 3 of the License, or
20
* (at your option) any later version.
21
*
22
* This library is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
* GNU Lesser General Public License for more details.
26
*
27
* You should have received a copy of the GNU Lesser General Public License
28
* along with this library. If not, see <http://www.gnu.org/licenses/>.
29
*/
30
31
/**@{*/
32
#ifndef LIBOPENCM3_GPIO_H
33
#define LIBOPENCM3_GPIO_H
34
35
#include <
libopencm3/stm32/common/gpio_common_f24.h
>
36
37
/*****************************************************************************/
38
/* Module definitions */
39
/*****************************************************************************/
40
41
/*****************************************************************************/
42
/* Register definitions */
43
/*****************************************************************************/
44
45
#define GPIO_BRR(port) MMIO32((port) + 0x28)
46
#define GPIOA_BRR GPIO_BRR(GPIOA)
47
#define GPIOB_BRR GPIO_BRR(GPIOB)
48
#define GPIOC_BRR GPIO_BRR(GPIOC)
49
#define GPIOD_BRR GPIO_BRR(GPIOD)
50
#define GPIOE_BRR GPIO_BRR(GPIOE)
51
#define GPIOF_BRR GPIO_BRR(GPIOF)
52
#define GPIOG_BRR GPIO_BRR(GPIOG)
53
#define GPIOH_BRR GPIO_BRR(GPIOH)
54
55
/* Analog Switch Control Register */
56
#define GPIO_ASCR(port) MMIO32((port) + 0x2c)
57
#define GPIOA_ASCR GPIO_ASCR(GPIOA)
58
#define GPIOB_ASCR GPIO_ASCR(GPIOB)
59
#define GPIOC_ASCR GPIO_ASCR(GPIOC)
60
#define GPIOD_ASCR GPIO_ASCR(GPIOD)
61
#define GPIOE_ASCR GPIO_ASCR(GPIOE)
62
#define GPIOF_ASCR GPIO_ASCR(GPIOF)
63
#define GPIOG_ASCR GPIO_ASCR(GPIOG)
64
#define GPIOH_ASCR GPIO_ASCR(GPIOH)
65
66
/*****************************************************************************/
67
/* Register values */
68
/*****************************************************************************/
69
70
/** @defgroup gpio_speed GPIO Output Pin Speed
71
@ingroup gpio_defines
72
@{*/
73
#define GPIO_OSPEED_LOW 0x0
74
#define GPIO_OSPEED_MED 0x1
75
#define GPIO_OSPEED_HIGH 0x2
76
#define GPIO_OSPEED_VERYHIGH 0x3
77
/**@}*/
78
79
/*****************************************************************************/
80
/* API definitions */
81
/*****************************************************************************/
82
83
/*****************************************************************************/
84
/* API Functions */
85
/*****************************************************************************/
86
87
BEGIN_DECLS
88
89
END_DECLS
90
91
#endif
92
/**@}*/
END_DECLS
#define END_DECLS
Definition:
common.h:34
BEGIN_DECLS
#define BEGIN_DECLS
Definition:
common.h:33
gpio_common_f24.h
include
libopencm3
stm32
l4
gpio.h
Generated on Tue Mar 7 2023 16:12:11 for libopencm3 by
1.9.4