Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libgpio/gpio.3
Show All 19 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd November 17, 2014 | .Dd March 7, 2015 | ||||
.Dt GPIO 3 | .Dt GPIO 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm gpio_open , | .Nm gpio_open , | ||||
.Nm gpio_close | .Nm gpio_close | ||||
.Nd "library to handle GPIO pins" | .Nd "library to handle GPIO pins" | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libgpio | .Lb libgpio | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In libgpio.h | .In libgpio.h | ||||
.Ft "gpio_handle_t" | .Ft "gpio_handle_t" | ||||
.Fn gpio_open "unsigned int unit" | .Fn gpio_open "unsigned int unit" | ||||
.Ft "gpio_handle_t" | .Ft "gpio_handle_t" | ||||
.Fn gpio_open_device "const char *device" | .Fn gpio_open_device "const char *device" | ||||
.Ft void | .Ft void | ||||
.Fn gpio_close "gpio_handle_t handle" | .Fn gpio_close "gpio_handle_t handle" | ||||
.Ft int | .Ft int | ||||
.Fn gpio_pin_list "gpio_handle_t handle, gpio_config_t **pcfgs" | .Fn gpio_pin_list "gpio_handle_t handle, gpio_config_t **pcfgs" | ||||
.Ft int | .Ft int | ||||
.Fn gpio_pin_config "gpio_handle_t handle, gpio_config *cfg" | .Fn gpio_pin_config "gpio_handle_t handle, gpio_config_t *cfg" | ||||
.Ft int | .Ft int | ||||
.Fn gpio_pin_set_name "gpio_handle_t handle, gpio_pin_t pin, char *name" | |||||
.Ft int | |||||
.Fn gpio_pin_set_flags "gpio_handle_t handle, gpio_config_t *cfg" | .Fn gpio_pin_set_flags "gpio_handle_t handle, gpio_config_t *cfg" | ||||
.Ft gpio_value_t | .Ft gpio_value_t | ||||
.Fn gpio_pin_get "gpio_handle_t handle, gpio_pin_t pin" | .Fn gpio_pin_get "gpio_handle_t handle, gpio_pin_t pin" | ||||
.Ft int | .Ft int | ||||
.Fn gpio_pin_set "gpio_handle_t handle, gpio_pin_t pin, gpio_value_t value" | .Fn gpio_pin_set "gpio_handle_t handle, gpio_pin_t pin, gpio_value_t value" | ||||
.Ft int | .Ft int | ||||
.Fn gpio_pin_toggle "gpio_handle_t handle, gpio_pin_t pin" | .Fn gpio_pin_toggle "gpio_handle_t handle, gpio_pin_t pin" | ||||
.Ft int | .Ft int | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
The function | The function | ||||
.Fn gpio_pin_config | .Fn gpio_pin_config | ||||
retrieves the current configuration of a pin. | retrieves the current configuration of a pin. | ||||
The pin number should be passed in via the | The pin number should be passed in via the | ||||
.Ft g_pin | .Ft g_pin | ||||
variable which is part of the | variable which is part of the | ||||
.Ft gpio_config_t | .Ft gpio_config_t | ||||
structure. | structure. | ||||
.Pp | |||||
The function | |||||
.Fn gpio_pin_set_name | |||||
sets the name used to describe a pin. | |||||
.Pp | .Pp | ||||
The function | The function | ||||
.Fn gpio_pin_set_flags | .Fn gpio_pin_set_flags | ||||
configures a pin with the flags passed in by the | configures a pin with the flags passed in by the | ||||
.Ft gpio_config_t | .Ft gpio_config_t | ||||
structure. | structure. | ||||
The pin number should also be passed in through the | The pin number should also be passed in through the | ||||
.Ft g_pin | .Ft g_pin | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |