I am attempting to write a driver for an OV2680 camera sensor. I want to turn on some GPIO pins as one of the steps in its ->probe() function. Those GpioIo() pins are declared in the DSDT tables like so (for a device upon which the OV2680 is dependent; see full DSDT table: Note absence of a _DSD segment, m…
Tag: gpio
How can I use the cat command to read from a character device with my own character device driver?
I am trying to write a simple read/write character driver for a beaglebone. One of the tasks is to be able to use the cat command to read from the device, but I am unable to do so. Here is the code for my read function for my character device driver located inside char_drvr.c: Read executes successfully (the …
Purpose and usage of GPIO-Hog declaration
Questions What is the purpose and use-case of the gpio-hog declaration? Can a ‘hogged’ gpio pin be interfaced with from Userspace? If a ‘hogged’ gpio pin cannot be interfaced with from Userspace, then is there any mechanism to configure GPIO pins in the dts file for Userspace interacti…
Example device-tree-aware i2c gpio driver for Linux?
Is there a good example device-tree-aware i2c gpio driver for Linux? I’ve been looking at gpio-pcf857x but it has a header file containing struct pcf857x_platform_data which is used in board files. I am looking for a similar example, but where the i2c id is defined-in/retrieved-from the device tree. Ans…
ARM linux userspace gpio operations using mmap /dev/mem approach (able to write to GPIO registers, but fail to read from them)
Kernel version 3.12.30-AM335x-PD15.1.1 by PHYTEC. If I use the /sys/class/gpio way, I can see that the button input pin (gpio103 of AM3359) value changes from 0 to 1. Following the this exercise http://elinux.org/EBC_Exercise_11b_gpio_via_mmap and executing the below command for reading gpio pins usig /dev/me…
Countdown thread RPi stop if GPIO input change
I’m not sure the best way to do this, and is not working for my as it will lock the program on when its asleep not sure how to make it works right… Im trying to monitor when a door open and closes with a raspberry Pi if there door is open for more than x time send some sort
Executing a python script including GPIO commands by cron in Raspberry Pi 2
Environment Raspberry Pi 2 raspbian-jessie-lite Windows 8.1 PuTTY 0.66 (SSH) Issue Can’t get cron to execute a python script with sudo. The script deals with GPIO input so it should be called with sudo. The program is supposed to save temperature and humidity to files but cat temp.txt and cat humid.txt …
No access to /dev/mem. Try running as root
I’m a newbie! I have python files code to turn on the light: i tried here and here and here here on forum i chmod pi for /dev , adduser group file 1 file 2 access GPIO: Error occurs here. “No access to /dev/mem. Try running as root!” i have try here and here and here here on forum and
How to write to data register in C, without touching previous writes?
Iam a beginner in C and have this scenario: I can successfully write to a gpio port with data register 0x103 and direction register 0x95. If I want to write to another pin I have to “overwrite” the previously pin. As if I first write 00010000 and then want to make another pin high I need to write …
Periodic task in a Linux kernel module
Currently I am developing GPIO kernel module for friendlyarm Linux 2.6.32.2 (mini2440). I am from electronics background and new to Linux. The kernel module loaded at start-up and the related device file is located in /dev as gpiofreq. At first time writing to device file, GPIO pin toggles continuously at 50k…