Skip to content

Commit

Permalink
adding alternate pin config for eqep2 from the beagleboard mailing list
Browse files Browse the repository at this point in the history
  • Loading branch information
pdp7 committed Jun 23, 2014
1 parent 69a6a02 commit d29b9f6
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions encoders/dts/bone_eqep2alt.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (C) 2013 Nathaniel R. Lewis - http://teknoman117.wordpress.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Enable eQEP2 on the Beaglebone White and Black
*/
/dts-v1/;
/plugin/;

/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";

/* identification */
part-number = "bone_eqep2";
version = "00A0";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
pinctrl_eqep2: pinctrl_eqep2_pins {
pinctrl-single,pins = <
0x038 0x24 /* P8_16 = GPIO2_14 = EQEP2_index, MODE4 */
0x03C 0x24 /* P8_15 = GPIO2_15 = EQEP2_strobe, MODE4 */
0x030 0x34 /* P8_12 = GPIO2_12 = EQEP2A_in, MODE4 */
0x034 0x34 /* P8_11 = GPIO2_13 = EQEP2B_in, MODE4 */
>;
};
};
};

fragment@1 {
target = <&epwmss2>;
__overlay__ {
status = "okay";
};
};

fragment@2 {
target = <&eqep2>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_eqep2>;

count_mode = <0>; /* 0 - Quadrature mode, normal 90 phase offset cha & chb. 1 - Direction mode. cha input = clock, chb input = direction */
swap_inputs = <0>; /* Are channel A and channel B swapped? (0 - no, 1 - yes) */
invert_qa = <1>; /* Should we invert the channel A input? */
invert_qb = <1>; /* Should we invert the channel B input? I invert these because my encoder outputs drive transistors that pull down the pins */
invert_qi = <0>; /* Should we invert the index input? */
invert_qs = <0>; /* Should we invert the strobe input? */

status = "okay";
};
};
};

0 comments on commit d29b9f6

Please sign in to comment.