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

Cannot use (type []byte) as type string in argument to strconv.ParseFloat issue

pi@raspberrypi:~/Desktop/go $ go run shell1.go As result i am getting: pi@raspberrypi:~/Desktop/go $ go run shell1.go # command-line-arguments ./shell1.go:29: undefined: n ./shell1.go:29: cannot use b (type []byte) as type string in argument to…
Yevhenii Shashkov
  • 464
  • 1
  • 8
  • 19
3
votes
1 answer

GPIO on Raspberry pi c#

I'm currently working on a project to make a raspberry pi robot car thing using c#. I have absolutely no knowledge of c#, so this is my way of learning it. The car uses an L298N to control the motors, so all I need to figure out how to get the pi to…
Callum M
  • 41
  • 1
  • 4
3
votes
1 answer

How can I control a fan with GPIO on a Raspberry Pi 3 using Python?

I am trying to basically write a simple script that will tell the fan (plugged into pin 4 on the GPIO) to turn on at a certain temp, and if anything less, turn the fan off. I am starting with something simple just to see if I can control the fan…
ALLCAPS
  • 65
  • 1
  • 5
3
votes
0 answers

How to set GPIO falling edge interrupt in linux

I try to use GPIO Interrut(falling edge) in linux (using GPIO Expander PCAL6524). At first I set GPIO low_active/direction like the following. static int pcal6524_setup(struct i2c_client *client, int gpio, unsigned int ngpio, void…
andy
  • 107
  • 3
  • 12
3
votes
0 answers

Is there anyone who has ever implemented Ethernet MDIO(Clause 22 or 45) function through GPIO driver?

I'm using TI DSP Keystone II device for 10G Ethernet service. The 10G interface is connected to Marvell 10G PHY device. What I'm going to try is to use GPIO on the DSP device to access 10G PHY clause 45 management port, instead of using 10G MDIO on…
3
votes
0 answers

Raspberry PWM Output with Pi4J

My target is to code a GUI in Java where with which the user can output a PWM signal over one of the Hardware-PWM Pins of the Raspberry 3. Doing so, the user should be able to select the length of a whole pulse (in ms), the length of the duty cycle…
Jas On
  • 51
  • 8
3
votes
0 answers

MCP23017 GPIO Interrupt Handling (RPi)

I have connected a MCP23017 I2C GPIO Expander chip to RPi. I use the this device driver and the mcp23017.dtbo overlay file. I am trying to check the interrupt handling with the gpio pins. I did the following to connect the pins to interrupt(496 is…
Alex Krish
  • 93
  • 1
  • 13
3
votes
2 answers

AM335x GPIO muxing in device tree gets reset during kernel load

I want to configure set of SoC pins to be used as GPIO inputs or outputs with default values. We are using am3352 SoC and custom board similar to Beaglebone Black. I checked through debug logs that device tree get parsed correctly. But when I check…
nilan
  • 61
  • 1
  • 6
3
votes
1 answer

Linux, ARM: Why is gpiochip only created if I2C GPIO Expander is present at boot?

Using Linux 3.14.52 on a imx6sx hardware platform (NXP embedded ARM). The problem is that PCF8575 I2C GPIO expanders specified in the device tree are not instantiated as devices in the /sys/class/gpio structure unless they are present during kernel…
Bruce
  • 33
  • 4
3
votes
2 answers

tail a constantly updated logfile and perform an action when a string is found

I have an odroid-c1+ that I would like to use as a pi-hole server (basically dns blackhole for ad's) I would like to trigger an led to blink when a string is found in the logfile. I also have wiringpi installed and working, the example blink.sh…
DanielS
  • 53
  • 6
3
votes
2 answers

How to detect to which pin connected the sensor?

I have PIR sensor and MBOX306GS control board with Android. This board has I/O Control Interface with 4 GPIO. I found 91 available pins using command cat /sys/kernel/debug/gpio. Then I activated them and tried to read values but with no luck. I've…
Joks
  • 309
  • 2
  • 17
3
votes
1 answer

Bitwise manipulation on GPIO with some masks

I want to do some bitwise manipulation on GPIO result, suppose I have three variables to define whether the state of some GPIO devices are on or off: mask : 1 means bit is set, and need to be calculate value : real gpio value 0 /…
user430926
  • 4,017
  • 13
  • 53
  • 77
3
votes
1 answer

GPIO on Beaglebone Black

I'm currently stuck on a problem with GPIO pins with the Beaglebone black. I am looking for a proper way to read the values from GPIO pin p8_4 in C. I tried to use a library which used an old not supported way from the time before device tree's…
Joris Mathijssen
  • 629
  • 7
  • 20
3
votes
2 answers

Determining port inside the GPIO EXTI Handler

How to determine the port from which the interrupt has been generated in the handler? For example, in the EXTI0_IRQHandler how will I determine whether the interrupt was generated through PA0, PB0 or PC0? Is it even possible to handle interrupts…
Nikhil Gupta
  • 172
  • 1
  • 18
3
votes
1 answer

File not ready for write after open?

I have the following code: #!/usr/bin/python export = open('/sys/class/gpio/export', 'w') export.write('44\n') And this code produces the following output: close failed in file object destructor: IOError: [Errno 16] Device or resource busy If I…
Dave
  • 151
  • 1
  • 6