Sponsored Content
Top Forums Programming How to set the DSR pin using a C Code Post 302080113 by grumpf on Sunday 16th of July 2006 12:01:00 PM
Old 07-16-2006
man 4 tty_ioctl

the example at the end of the page handles dtr (linux man pages)
 

8 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Pin to desktop

Hello everybody! I need some help. Is there a way to pin a window to the desktop in Linux? I have a list of tasks in Calc. And I want the window of Calc to be always before my eyes, so that it sort of reminds me of my tasks. The window must be «stuck» to the desktop, and when I click the... (0 Replies)
Discussion started by: alex777
0 Replies

2. Programming

How to read the CTS and DSR of RS232 in Unix using C language?

Hello to all Gurus out there, Could you show me a source code in Unix platform using C language. I want to read the status or voltage level of the DSR and CTS. Thanks a lot, Swing5 (2 Replies)
Discussion started by: Swing5
2 Replies

3. Programming

Need pin generation code

Hi Can any one tell me from where can i get the code/library(c/c++(Sun)) for PIN generation. Actually i need to generate a new PIN for the user in case sombody reset his PIN. Thanks in Advance. (1 Reply)
Discussion started by: unisuraj
1 Replies

4. Programming

regarding adding fields to DSR protocol in ns2.34

hi i am student doing project in ns2.34. i hav to add field in route cache and packet of DSR routing protocol. which files hv to be changed...pl help me (1 Reply)
Discussion started by: khubalkar
1 Replies

5. Homework & Coursework Questions

regarding adding fields to DSR protocol in ns2.34

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: want to add field to route cache and packet of DSR routing protocol in ns2.34, add field, DSR package in ns2.34... (2 Replies)
Discussion started by: khubalkar
2 Replies

6. IP Networking

How to configure RHEL6 to support Aleton 4408 in DSR mode?

Dears How to configure RHEL6 to support Aleton 4408 in DSR(Direct Server Return) mode We have config Aleton 4408 + Windows 2008R2 then Windows set loopback interface with VIP. the exec the following command in CMD netsh interface ipv4 set interface "net" weakhostreceive=enabled netsh... (0 Replies)
Discussion started by: nnnnnnine
0 Replies

7. IP Networking

Source IP address field in RREP on DSR routing

Hello I have a question about routing in MANET using Dynamic Source Routing protocol. IN RFC4728 (DSR) in section "IP fields" of RREP (Route Reply) packet we have this: ok. I read in several books and also in rfc4728 that: when a source node (node that initiate route discovery process)... (1 Reply)
Discussion started by: acu281
1 Replies

8. Shell Programming and Scripting

Pin code counter

hello i wanted to see if anyone can analyze the following code and see where the error lies. it is supposed to echo the current date and start counting from 0000-9999 and show the approximate range that it is at. here is a pic of what the output should look like:... (3 Replies)
Discussion started by: Kooftness
3 Replies
GPIO(3) 						   BSD Library Functions Manual 						   GPIO(3)

NAME
gpio_open, gpio_close -- library to handle GPIO pins LIBRARY
library ``libgpio'' SYNOPSIS
#include <libgpio.h> gpio_handle_t gpio_open(unsigned int unit); gpio_handle_t gpio_open_device(const char *device); void gpio_close(gpio_handle_t handle); int gpio_pin_list(gpio_handle_t handle, gpio_config_t **pcfgs); int gpio_pin_config(gpio_handle_t handle, gpio_config *cfg); int gpio_pin_set_flags(gpio_handle_t handle, gpio_config_t *cfg); gpio_value_t gpio_pin_get(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_set(gpio_handle_t handle, gpio_pin_t pin, gpio_value_t value); int gpio_pin_toggle(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_low(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_high(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_input(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_output(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_opendrain(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_pushpull(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_tristate(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_pullup(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_pulldown(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_invin(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_invout(gpio_handle_t handle, gpio_pin_t pin); int gpio_pin_pulsate(gpio_handle_t handle, gpio_pin_t pin); DESCRIPTION
The libgpio library provides an interface to configure GPIO pins. The library operates with a gpio_handle_t opaque type which can be created with gpio_open() or gpio_open_device(). When no more GPIO operations are needed, this handle can be destroyed with gpio_close(). To get a list of all available pins, one can call gpio_pin_list(). This function takes a pointer to a gpio_config_t which is dynamically allocated. This pointer should be freed with free(3) when it's no longer necessary. The function gpio_pin_config() retrieves the current configuration of a pin. The pin number should be passed in via the g_pin variable which is part of the gpio_config_t structure. The function gpio_pin_set_flags() configures a pin with the flags passed in by the gpio_config_t structure. The pin number should also be passed in through the g_pin variable. All other structure members will be ignored by this function. The list of flags can be found in /usr/include/sys/gpio.h. The get or set the state of a GPIO pin, the functions gpio_pin_get() and gpio_pin_set() are available, respectively. To toggle the state, use gpio_pin_toggle(). The functions gpio_pin_low() and gpio_pin_high() are wrappers around gpio_pin_set(). The functions gpio_pin_input(), gpio_pin_output(), gpio_pin_opendrain(), gpio_pin_pushpull(), gpio_pin_tristate(), gpio_pin_pullup(), gpio_pin_pulldown(), gpio_pin_invin(), gpio_pin_invout() and gpio_pin_pulsate() are wrappers around gpio_pin_set_flags(). EXAMPLES
The following example shows how to configure pin 16 as output and then drive it high: #include <err.h> #include <libgpio.h> gpio_handle_t handle; handle = gpio_open(0); if (handle == GPIO_HANDLE_INVALID) err(1, "gpio_open failed"); gpio_pin_output(handle, 16); gpio_pin_high(handle, 16); gpio_close(handle); The following example shows how to get a configuration of a pin: gpio_config_t cfg; cfg.g_pin = 32; gpio_pin_config(handle, &cfg); The structure will contain the name of the pin and its flags. SEE ALSO
gpiobus(4), gpioctl(8) HISTORY
The libgpio library first appeared in FreeBSD 11.0. AUTHORS
The libgpio library was implemented by Rui Paulo <rpaulo@FreeBSD.org>. BSD
November 17, 2014 BSD
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy