Subversion Repositories Projects

Rev

Rev 244 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
244 dhylands 1
/****************************************************************************
2
*
3
*   Copyright (c) 2008 Dave Hylands     <dhylands@gmail.com>
4
*
5
*   This program is free software; you can redistribute it and/or modify
6
*   it under the terms of the GNU General Public License version 2 as
7
*   published by the Free Software Foundation.
8
*
9
*   Alternatively, this software may be distributed under the terms of BSD
10
*   license.
11
*
12
*   See README and COPYING for more details.
13
*
14
****************************************************************************
15
*
16
*   Interface file for the user-gpio library, which allows user-mode
17
*   access to gpio pins.
18
*
19
****************************************************************************/
20
 
21
#if !defined( USER_GPIO_H )
22
#define USER_GPIO_H
23
 
24
/* ---- Include Files ---------------------------------------------------- */
25
 
26
/* ---- Constants and Types ---------------------------------------------- */
27
 
28
/* ---- Variable Externs ------------------------------------------------- */
29
 
30
/* ---- Function Prototypes ---------------------------------------------- */
31
 
321 dhylands 32
#if defined( __cplusplus )
33
extern "C" {
34
#endif
35
 
244 dhylands 36
int  gpio_init( void );
37
void gpio_term( void );
38
 
39
/*
40
 * This is the same API as gpiolib, which is used from kernel space.
41
 */
42
 
43
int  gpio_request( unsigned gpio, const char *label );
44
void gpio_free( unsigned gpio );
45
int  gpio_direction_input( unsigned gpio );
46
int  gpio_direction_output( unsigned gpio, int initialValue );
47
int  gpio_get_value( unsigned gpio );
48
void gpio_set_value( unsigned gpio, int value );
49
 
321 dhylands 50
#if defined( __cplusplus )
51
}
52
#endif
53
 
244 dhylands 54
#endif  /* USER_GPIO_H */
55