Skip to contentSkip to conversation

Rotary encoder platform device driver code examples

DISCUSSION GRENON Loïc 2 participants 2 messages Aug 21, 2013 – Aug 27, 2013 HID

lore
Share & tools
lore
#0 lore raw

Hi guys,

I want to interface a magnetic scale position sensor with a BeagleBone Black (an ARM development platform).
While I was reading this following article : http://bwgz57.wordpress.com/2012/04/11/beaglebone-with-a-rotary-encoder/ I discovered that linux has built-in support for rotary encoders connected via GPIO.

The magnetic scale position sensor can be considered like a rotary encoder so I would use the rotary_encoder platform device driver.

I've read the code example at the end of this document : https://www.kernel.org/doc/Documentation/input/rotary-encoder.txt
But I don't know how to access to the "pos" value of the rotary encoder.

Do you have some code example of use of this driver ? Or anything that can be helpful for me.

Thanks,
Regards,

Loïc
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

2013/8/21 GRENON Loïc <[email protected]>:

Quoted 12 lines

Hi guys,

I want to interface a magnetic scale position sensor with a BeagleBone Black (an ARM development platform).
While I was reading this following article :
http://bwgz57.wordpress.com/2012/04/11/beaglebone-with-a-rotary-encoder/ I discovered that linux has built-in support for rotary encoders connected via GPIO.

The magnetic scale position sensor can be considered like a rotary encoder so I would use the rotary_encoder platform device driver.

Quoted 7 lines

I've read the code example at the end of this document :
https://www.kernel.org/doc/Documentation/input/rotary-encoder.txt
But I don't know how to access to the "pos" value of the rotary encoder.

Do you have some code example of use of this driver ? Or anything that can be helpful for me.

As the rotary encoder is an input device it is accessible via /dev/input/eventX where X is
a number. Have a look at evtest user space application.

greets
--
Christian Gmeiner, MSc
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html