libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
gpio.c
Go to the documentation of this file.
1
/** @defgroup gpio_file General Purpose I/O
2
3
@brief <b>LM3S General Purpose I/O</b>
4
5
@ingroup LM3Sxx
6
7
@version 1.0.0
8
9
@author @htmlonly © @endhtmlonly 2011
10
Gareth McMullin <gareth@blacksphere.co.nz>
11
12
@date 10 March 2013
13
14
LGPL License Terms @ref lgpl_license
15
*/
16
17
/*
18
* This file is part of the libopencm3 project.
19
*
20
* Copyright (C) 2011 Gareth McMullin <gareth@blacksphere.co.nz>
21
*
22
* This library is free software: you can redistribute it and/or modify
23
* it under the terms of the GNU Lesser General Public License as published by
24
* the Free Software Foundation, either version 3 of the License, or
25
* (at your option) any later version.
26
*
27
* This library is distributed in the hope that it will be useful,
28
* but WITHOUT ANY WARRANTY; without even the implied warranty of
29
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
* GNU Lesser General Public License for more details.
31
*
32
* You should have received a copy of the GNU Lesser General Public License
33
* along with this library. If not, see <http://www.gnu.org/licenses/>.
34
*/
35
36
/**@{*/
37
38
#include <
libopencm3/lm3s/gpio.h
>
39
40
void
gpio_set
(uint32_t gpioport, uint8_t gpios)
41
{
42
/* ipaddr[9:2] mask the bits to be set, hence the array index */
43
GPIO_DATA
(gpioport)[gpios] = 0xff;
44
}
45
46
void
gpio_clear
(uint32_t gpioport, uint8_t gpios)
47
{
48
GPIO_DATA
(gpioport)[gpios] = 0;
49
}
50
51
/**@}*/
52
gpio.h
GPIO_DATA
#define GPIO_DATA(port)
Definition:
gpio.h:67
gpio_clear
void gpio_clear(uint32_t gpioport, uint8_t gpios)
Definition:
gpio.c:46
gpio_set
void gpio_set(uint32_t gpioport, uint8_t gpios)
Definition:
gpio.c:40
lib
lm3s
gpio.c
Generated on Tue Mar 7 2023 16:12:48 for libopencm3 by
1.9.4