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 &copy; @endhtmlonly 2011
10Gareth McMullin <gareth@blacksphere.co.nz>
11
12@date 10 March 2013
13
14LGPL 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
39
40void 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
46void gpio_clear(uint32_t gpioport, uint8_t gpios)
47{
48 GPIO_DATA(gpioport)[gpios] = 0;
49}
50
51/**@}*/
52
#define GPIO_DATA(port)
Definition: gpio.h:67
void gpio_clear(uint32_t gpioport, uint8_t gpios)
Definition: gpio.c:46
void gpio_set(uint32_t gpioport, uint8_t gpios)
Definition: gpio.c:40