diff options
author | 2016-10-31 14:53:40 +0200 | |
---|---|---|
committer | 2016-10-31 14:53:40 +0200 | |
commit | ce0841ecfaca463c93dd5551bc5f45cd9365a938 (patch) | |
tree | 7dc7bf6942600a96393c83d91fecd0f6cda389e5 /include | |
parent | fbb41f2290c0eb940bbe8f77fc2afff3974fa264 (diff) | |
download | librin-ce0841ecfaca463c93dd5551bc5f45cd9365a938.tar.gz librin-ce0841ecfaca463c93dd5551bc5f45cd9365a938.tar.bz2 librin-ce0841ecfaca463c93dd5551bc5f45cd9365a938.zip |
gpio: add initial implementation.
Diffstat (limited to 'include')
-rw-r--r-- | include/rin/gpio.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/rin/gpio.h b/include/rin/gpio.h new file mode 100644 index 0000000..83ca934 --- /dev/null +++ b/include/rin/gpio.h @@ -0,0 +1,37 @@ +/* + * The Rin Library – gpio module + * + * Copyright (C) 2016 Gediminas Jakutis + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; version 2.1 + * of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef LIBRIN_GPIO_INCLUDED +#define LIBRIN_GPIO_INCLUDED + +enum rin_gpiotype { + rin_gpio_in, + rin_gpio_out, + rin_gpio_closed +}; + +unsigned int rin_gpio_open(const unsigned int num, const enum rin_gpiotype type); +unsigned int rin_gpio_close(const unsigned int num); +unsigned int rin_gpio_setval(const unsigned int num, const unsigned int val); +unsigned int rin_gpio_readval(const unsigned int num, unsigned int * const val); +unsigned int rin_gpio_pin_exists(const unsigned int pin); +unsigned int rin_gpio_get_pincount(void); + +#endif /* LIBRIN_GPIO_INCLUDED */ |