Advantech RSB-4210 Evaluation Kit Manual de usuario Pagina 64

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 104
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 63
RSB-4210 User Manual 56
"edge" reads as either "none", "rising", "falling", or "both". Write these strings
to select the signal edge(s) that will make poll(2) on the "value" file
return.
This file exists only if the pin can be configured as aninterrupt generat-
ing input pin.
"active_low" reads as either 0 (false) or 1 (true). Write any nonzero value to invert
the value attribute both for reading and writing. Existing and subse-
quent poll(2) support configuration via the edge attribute for "rising"
and "falling" edges will follow this setting.
GPIO controllers have paths like /sys/class/gpio/gpiochip42/ (for the
controller implementing GPIOs starting at #42) and have the following
read-only attributes:
/sys/class/gpio/gpiochipN/
"base" ... same as N, the first GPIO managed by the chip
"label" ... provided for diagnostics (not always unique)
"ngpio" ... how many GPIOs this manges (N to N + ngpio - 1)
Board documentation should in most cases cover what GPIOs are used for what pur-
poses. However, those numbers are not always stable; GPIOs on a daughtercard
might be different depending on the base board being used, or other cards in the
stack. In such cases, you may need to use the gpiochip nodes (possibly in conjunc-
tion with schematics) to determine the correct GPIO number to use for a given signal.
Exporting from Kernel code
Kernel code can explicitly manage exports of GPIOs which have already been
requested using gpio_request():
/* export the GPIO to userspace */
int gpio_export(unsigned gpio, bool
direction_may_change);
/* reverse gpio_export() */
void gpio_unexport();
/* create a sysfs link to an exported GPIO node */
int gpio_export_link(struct device *dev, const char
*name, unsigned gpio)
/* change the polarity of a GPIO node in sysfs */
int gpio_sysfs_set_active_low(unsigned gpio, int value);
After a kernel driver requests a GPIO, it may only be made available in the sysfs
interface by gpio_export(). The driver can control whether the signal direction may
change. This helps drivers prevent userspace code from accidentally clobbering
important system state.
(More detail please reference "source/linux-2.6.35.3/Documentation/ gpio.txt")
Vista de pagina 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 103 104

Comentarios a estos manuales

Sin comentarios