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
5
votes
1 answer

GPIO monitoring with select

I am attempting to monitor a GPIO pin, and per the Linux docs I should be able to do this by monitoring the /sys/class/gpio/gpio##/value file with select: "value" ... reads as either 0 (low) or 1 (high). If the GPIO is configured as an output,…
Jason Whitehorn
  • 13,585
  • 9
  • 54
  • 68
5
votes
4 answers

Raspberry Pi - GPIO in Python

I am trying to get my Raspberry Pi's GPIO pins working, and I am following Tutorial: How to use your Raspberry Pi like an Arduino. ( I'm working through SSH running Raspbian.) I have successfully installed distribute. When trying to install PIP, I…
ChrisPDuckling
  • 73
  • 1
  • 1
  • 5
5
votes
4 answers

linux gpio c api

I have an powerpc board with 3.2 kernel running on it. Accessing gpio with sysfs works as expected e.g. > echo 242 > /sys/class/gpio/export > cat /sys/class/gpio/gpio242/value > 1 Is there no API to direct access gpio pins from user space? Must I…
Klaus
  • 24,205
  • 7
  • 58
  • 113
4
votes
1 answer

Linux Userspace GPIO Interrupts using sysfs

I would like to use interrupts with GPIO on userspace using sysfs. I use these commands : [root@at91]:gpio109 > echo 109 > export [root@at91]:gpio109 > cd gpio109/ [root@at91]:gpio109 > ll -rw-r--r-- 1 root 0 4096 Jan 1 00:17…
lgm42
  • 591
  • 1
  • 6
  • 29
4
votes
4 answers

How to properly initialize I2C stm32?

I want to get data from ADXL345 accelerometer,but seems that I incorrectly connect it. SCL- PC6(with 10k resistor) SDA- PC7(with 10k resistor) SDO- GND CS - VCC GND - GND 3.3v - VCC Here is my code to initalize: void I2CG_Init(void) { …
SevenDays
  • 3,718
  • 10
  • 44
  • 71
4
votes
1 answer

Java binding for C library(GPIO)

I need to write Java binding for GPIO library. Decided to go with JNI for the purpose. All of the references have examples with using standard C libraries with functions such as printf or, from scientific library with method such as multiply. The…
Meenohara
  • 314
  • 4
  • 9
4
votes
1 answer

Can I configure an interrupt for a GPIO pin on a STM32F103ZE chip?

Is there any GPIO interrupt available for STM32F103ZE? I went through the datasheet but didn't find anything related to that. I am new to this processor but recently used TI's MSP430. In MSP430 we can configure interrupts using some GPIO registers.…
Harikrishnan
  • 3,664
  • 7
  • 48
  • 77
4
votes
0 answers

How do I get 'onoff' working on a Raspberry Pi 4B?

I am trying to make a 'Coocking-aid'. I am using a Raspberry Pi 4B with the official 7" touchscreen and an active piezo buzzer. The 'program' should run in Chromium (the RPi's webbrowser) and I write it in HTML, CSS and Javascript. I can do some…
PimV
  • 141
  • 1
  • 4
4
votes
2 answers

How to programmatically use GPIO Expander driver in Linux?

I am trying to configure my Yocto Linux distro to setup two on-board I2C GPIO Expanders and document how to access them programmatically (i.e. from a C user application). The GPIO Expanders are both NXP PCA9557, which is supported by the…
4
votes
2 answers

what is the /sys/class/gpio/export and `/sys/class/gpio/unexport mechanism and what is the underlying sysfs functionality?

Using the legacy sysfs GPIO under Android and Linux the first step in the process is toe export the particular GPIO pins you want to use. And when you are done with the GPIO pin to unexport it. I've been looking for an explanation of what the export…
Richard Chambers
  • 16,643
  • 4
  • 81
  • 106
4
votes
1 answer

How to disable Raspberry Pi GPIO event for certain time period after it runs in Python?

I am creating an event whenever my Raspberry Pi's GPIO pin has a falling edge. However, I want to disable this event for a certain amount of time (5 seconds for example) after each time it runs. I want the event to be enabled again after that time…
Mr.Mips
  • 379
  • 2
  • 18
4
votes
1 answer

How to connect GPIO in QEMU-emulated machine to an object in host?

I need to connect the GPIO pins in the ARM machine emulated in QEMU to the GUI objects in application working on the host machine. For example, the level on the output GPIO should be reflected by a color of a rectangle. The input GPIO should be…
wzab
  • 788
  • 7
  • 24
4
votes
3 answers

How reliable is DMA to GPIO on STM32 MCUs?

ST has some application notes that talk about emulating a parallel bus using DMA to GPIO. I appreciate that, but it doesn't answer important questions. I am looking through the reference manual, and I can't seem to find clarify the things that I am…
Sven
  • 1,364
  • 2
  • 17
  • 19
4
votes
1 answer

gpiod - use labels in devicetree

I want to use libgpiod to control a few GPIOs via userspace on a custom board. I have an i.MX6UL processor, which has hundreds of pins, I'll use only 8 of them (as GPIOs). I read about the libgpiod as it is replacing the old sysfs API, and I'm happy…
Franz Forstmayr
  • 1,219
  • 1
  • 15
  • 31
4
votes
3 answers

STM32f103c8 gpio speed limit

I have this simple inline assembly code: __asm__ volatile ( ".equ GPIOA_ODR, 0x4001080C \n\t" //GPIOA base address is 0x40010800 and ODR offset is 0x0C //turns on PA8 "ldr r1, =(1 << 8) \n\t" "ldr r2, =#GPIOA_ODR …
SirSpunk
  • 91
  • 1
  • 8