omgpiovar.h revision 1.1
1/* $OpenBSD: omgpiovar.h,v 1.1 2013/09/04 14:38:31 patrick Exp $ */ 2/* 3 * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18#ifndef OMGPIOVAR_H 19#define OMGPIOVAR_H 20 21#define OMGPIO_DIR_IN 0 22#define OMGPIO_DIR_OUT 1 23 24unsigned int omgpio_get_function(unsigned int gpio, unsigned int fn); 25void omgpio_set_function(unsigned int gpio, unsigned int fn); 26unsigned int omgpio_get_bit(unsigned int gpio); 27void omgpio_set_bit(unsigned int gpio); 28void omgpio_clear_bit(unsigned int gpio); 29void omgpio_set_dir(unsigned int gpio, unsigned int dir); 30 31/* interrupts */ 32void omgpio_clear_intr(unsigned int gpio); 33void omgpio_intr_mask(unsigned int gpio); 34void omgpio_intr_unmask(unsigned int gpio); 35void omgpio_intr_level(unsigned int gpio, unsigned int level); 36void *omgpio_intr_establish(unsigned int gpio, int level, int spl, 37 int (*func)(void *), void *arg, char *name); 38void omgpio_intr_disestablish(void *cookie); 39 40#endif /* OMGPIOVAR_H */ 41