Questions tagged [gpio]

General Purpose Input/Output (GPIO) is a generic pin on a chip whose behavior (including whether it is an input or output pin) can be controlled (programmed) by the user at run time.

GPIO pins have no special purpose defined, and go unused by default. The idea is that sometimes the system integrator building a full system that uses the chip might find it useful to have a handful of additional digital control lines, and having these available from the chip can save the hassle of having to arrange additional circuitry to provide them. For example, the Realtek ALC260 chips (audio codec) have 8 GPIO pins, which go unused by default. Some system integrators (Acer Inc. laptops) employing the ALC260 use the first GPIO (GPIO0) to turn on the amplifier used for the laptop's internal speakers and external headphone jack.

Further information and deeper analysis: Opus on wikipedia

1751 questions
3
votes
1 answer

Using libgpiod how do I switch direction of a requested line on the fly?

I'm rewriting my code, changing from sysfs interface forward to libgpiod. After the request of a line, direction is fixed and I need to figure out, how to switch the direction of this line on the fly for changing between input and output. At the…
Jo Luxer
  • 111
  • 9
3
votes
0 answers

DMA limitation for STM32L0 accessing GPIO

I am using a STM32L072KB microcontroller and tried to get familiar with timers. I wanted to use a timer to toggle a GPIO/LED via DMA. I read on a book "Mastering STM32" (https://leanpub.com/mastering-stm32) that it is obviously not possible here, to…
user9564464
  • 173
  • 2
  • 16
3
votes
0 answers

Raspberry Pi Gpio Continuous Servo Motor Control

I am making a node.js raspberry pi app where I need to control a servo motor. When I press the up arrow, it sends a post request to '/fb' and on key up it sends a post request to '/fbTerm'. Here is the code for post requests. const express =…
Ank i zle
  • 2,089
  • 3
  • 14
  • 36
3
votes
1 answer

How to use I2C GPIO expander's pin instead of RTS to control the RS485 direction, in Linux AUART kernel driver?

I'm creating an embedded system based on i.MX287 processor from NXP(Freescale). I'm using a core processing board which is connected to my evaluation board via a mini PCIe connector. UARTs 0,3,4 are used as RS232 and UARTs 1,2 as RS485. The core…
embedded
  • 51
  • 7
3
votes
1 answer

How do Linux GPIO numbers get their values?

I am trying to understand how the Linux GPIO numbers get their values. e.g. GPIO mapping for Joule. I tried reading linux documentation on Pinctrl Subsystem and also looked at the code of GPIO driver being used in Intel Joule :…
Naveen
  • 7,944
  • 12
  • 78
  • 165
3
votes
2 answers

How does C/C++ select work with gpio under Linux?

How does select work with gpio under Linux? Is it possible to use select to create a kind of interrupt driven program, maybe with the help of some threads? And what shall I think about when I use the select call? Thanks Note: I have read the man…
Johan
  • 20,067
  • 28
  • 92
  • 110
3
votes
1 answer

Read gpio value through /dev/input/eventX

I used to handle gpio in user space with /sys/class/gpio. Problem is that I need to use this gpio in a kernel driver. Due to the gpio request from the kernel driver, I cannot manipulate this gpio through /sys/class/gpio. However I was able to use it…
ArthurLambert
  • 749
  • 1
  • 7
  • 30
3
votes
1 answer

android.os.ServiceSpecificException: GPIO2_IO02 is already in use (code 16)

I am working on android things(Pico i.MX7D I/O).I got android.os.ServiceSpecificException: GPIO2_IO02 is already in use (code 16) exception,What it means by this? Please help me. My sample program is cloned from …
happy_coding
  • 1,064
  • 1
  • 13
  • 24
3
votes
4 answers

Python threading class for GPIO Led blink

I come here after after trying in all directions to come out of this problem without any results, unfortunately. What I have in mind: I need a class, named Led, that in the constructor simply accept a GPIO pin and offer method for: Light On Light…
3
votes
1 answer

GPIO irq: Falling and Rising edge detection

I try to create bare metal application for TI am335x soc based board. One thing I need to do is to invoke callback1 on rising edge and callback2 on falling edge. From the datasheet I figured out, that simultaneous detection for rising and falling…
Alex Hoppus
  • 3,821
  • 4
  • 28
  • 47
3
votes
3 answers

Notify when gpio value is changed

I'm currently trying to poll gpio value with only shell script. I basically developped the script with a test file before using /sys/class/gpio/gpioxx/value This is the solution I found : #!/bin/bash SCRIPT_DIR=$(dirname $(readlink -f…
Arkaik
  • 852
  • 2
  • 19
  • 39
3
votes
1 answer

How are the steps to access GPIOs in linux kernel modules?

I am struggling to find out, what steps are necessary to access a gpio-pin from a linux kernel module. Maybe someone can explain it to me by a simple example. I like to use pin 4(input) and 33(output). My steps so far: 1.) Device Tree(dts): I leave…
Stefan Jaritz
  • 1,999
  • 7
  • 36
  • 60
3
votes
1 answer

How to fix a Memory Map Failed Exception for GPIO write on raspberry pi

I'm trying to use the Raspberry Sharp IO library to write to a pin on the Pi. But it gives me an exception on runtime. It had worked before, but doesnt any more. Why is this error being thrown? using System; using Raspberry.IO.GeneralPurpose; using…
narcissus789
  • 166
  • 12
3
votes
1 answer

Emulate Gpio input on Raspberry Pi for testing

I have a python script running on my RPi. It uses the Gpiozero library (that's really great by the way). For testing purposes i was wondering if it was possible to emulate GPIO states somehow (say emulate pressing a button) and have it picked up by…
Malcoolm
  • 478
  • 2
  • 17
3
votes
1 answer

ImportError :No module named RPI.GPIO

I use Raspberry pi3 model B, I have installed RPI.GPIO successfully with both code (pip install, sudo apt-get install) that you see bellow, but when I tried import RPI.GPIO it says: ImportError: No module named RPI.GPIO What should I do? Thank you…
samaneh
  • 31
  • 1
  • 3