Skip to content

Commit c418cda

Browse files
committed
document howo to enable all the eqep pins
1 parent c6b314c commit c418cda

File tree

2 files changed

+52
-5
lines changed

2 files changed

+52
-5
lines changed

Adafruit_BBIO/Encoder.py

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,56 @@
11
#!/usr/bin/python
22

33
# ===========================================================================
4-
# Adafruit_BBIO.Encoder.QEP Class
4+
# Adafruit_BBIO.Encoder Class
55
# ===========================================================================
6-
76
# refers to graycatlabs/PyBBIO/bbio/libraries/RotaryEncoder/rotary_encoder.py
8-
# /sys/devices/platform/ocp/48302000.epwmss/48302180.eqep/position
9-
# /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position
10-
# /sys/devices/platform/ocp/48300000.epwmss/48300180.eqep/position
7+
8+
# BeagleBone must boot with cape-universal enabled
9+
# and load the cape-universala overlay in order to
10+
# use all the eQEP pins
11+
#
12+
# Install the latest Device Tree overlays:
13+
# ========================================
14+
# sudo apt-get upgrade bb-cape-overlays
15+
#
16+
# File: /boot/uEnv.txt
17+
# ====================
18+
# uname_r=4.4.62-ti-r99
19+
# cmdline=coherent_pool=1M quiet cape_universal=enable
20+
# cape_enable=bone_capemgr.enable_partno=cape-universala
21+
#
22+
# File: /sys/devices/platform/bone_capemgr/slots
23+
# ==============================================
24+
# 0: PF---- -1
25+
# 1: PF---- -1
26+
# 2: PF---- -1
27+
# 3: PF---- -1
28+
# 4: P-O-L- 0 Override Board Name,00A0,Override Manuf,cape-universala
29+
#
30+
# eqep0: P9_27, P9_92
31+
# ===================
32+
# config-pin P9_27 qep
33+
# config-pin P9_92 qep # alias for P9_42.1
34+
# cat /sys/devices/platform/ocp/48300000.epwmss/48300180.eqep/position
35+
#
36+
# eqep1: P8.33, P8.35
37+
# ===================
38+
# config-pin P8.33 qep
39+
# config-pin P8.35 qep
40+
# cat /sys/devices/platform/ocp/48302000.epwmss/48302180.eqep/position
41+
#
42+
# eqep2: P8.11, P8.12
43+
# ===================
44+
# config-pin P8.11 qep
45+
# config-pin P8.12 qep
46+
# cat /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position
47+
#
48+
# alternate pins for eqep2 (mutually exclusive)
49+
# eqep2b: P8.41, P8.42
50+
# ====================
51+
# config-pin P8.41 qep
52+
# config-pin P8.42 qep
53+
# cat /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position
1154

1255
import os
1356

@@ -51,6 +94,7 @@ class RotaryEncoder(object):
5194
'%s/48302000.epwmss/48302180.eqep' % OCP_PATH,
5295
'%s/48304000.epwmss/48304180.eqep' % OCP_PATH
5396
]
97+
5498
EQEP0 = 0
5599
EQEP1 = 1
56100
EQEP2 = 2

test/test_rotary.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/python
22

33
import Adafruit_BBIO.Encoder as Encoder
4+
# /sys/devices/platform/ocp/48300000.epwmss/48300180.eqep/position 0
5+
# /sys/devices/platform/ocp/48302000.epwmss/48302180.eqep/position 0
6+
# /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position 882
47
# P8.11: eqep2b_in
58
# P8.12: eqep2a_in
69
# run "config-pin p8.11 qep && config-pin p8.12 qep"

0 commit comments

Comments
 (0)