conf_d_quadEnc.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright 2014-2019 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 
14 #ifndef CONF_D_QUADENC_H_
15 #define CONF_D_QUADENC_H_
16 
17 #if 1
18 
19 /*********** Left Wheel Encoder ***********/
20 /*** Position ***/
21 // EVB H8-9: GPIO5 - QDEC2-A - TIOA6 - PC5
22 // EVB H8-10: GPIO6 - QDEC2-B - TIOB6 - PC6
23 #define QE0_POS TC2
24 #define ID_QE0_POS ID_TC6
25 
26 #define PIN_QE0_POS_PHA (PIO_PC5_IDX) //TC2 TIOA6
27 #define PIN_QE0_POS_PHA_MUX (IOPORT_MODE_MUX_B)
28 
29 #define PIN_QE0_POS_PHB (PIO_PC6_IDX) //TC2 TIOB6
30 #define PIN_QE0_POS_PHB_MUX (IOPORT_MODE_MUX_B)
31 
32 /*** Speed ***/
33 #if 1
34  // EVB H8-9: GPIO5 - TIOA5 - PC29
35  #define TCCAP0_SPD TC1
36  #define TCCAP0_SPD_CHANNEL 2
37  #define ID_TCCAP0_SPD ID_TC5
38 
39  #define PIN_TCCAP0_SPD (PIO_PC29_IDX)
40  #define PIN_TCCAP0_SPD_MUX (IOPORT_MODE_MUX_B)
41 
42  #define TCCAP0_SPD_Handler TC5_Handler
43  #define TCCAP0_SPD_IRQn TC5_IRQn
44 #else
45  // EVB H8-11: GPIO7 - TIOA10 - PE3
46  #define TCCAP0_SPD TC3
47  #define TCCAP0_SPD_CHANNEL 1
48  #define ID_TCCAP0_SPD ID_TC10
49 
50  #define PIN_TCCAP0_SPD (PIO_PE3_IDX)
51  #define PIN_TCCAP0_SPD_MUX (IOPORT_MODE_MUX_B)
52 
53  #define TCCAP0_SPD_Handler TC10_Handler
54  #define TCCAP0_SPD_IRQn TC10_IRQn
55 #endif
56 
57 /*********** Right Wheel Encoder ***********/
58 /*** Position ***/
59 // EVB H8-13: GPIO9 - QDEC3-A - TIOA9 - PE0
60 // EVB H8-14: GPIO10 - QDEC3-B - TIOB9 - PE1
61 #define QE1_POS TC3
62 #define ID_QE1_POS ID_TC9
63 
64 #define PIN_QE1_POS_PHA (PIO_PE0_IDX) //TC3 TIOA9
65 #define PIN_QE1_POS_PHA_MUX (IOPORT_MODE_MUX_B)
66 
67 #define PIN_QE1_POS_PHB (PIO_PE1_IDX) //TC3 TIOB9
68 #define PIN_QE1_POS_PHB_MUX (IOPORT_MODE_MUX_B)
69 
70 /*** Speed ***/
71 // EVB H8-7: GPIO3 - TIOA0 - PA0
72 #define TCCAP1_SPD TC0
73 #define TCCAP1_SPD_CHANNEL 0
74 #define ID_TCCAP1_SPD ID_TC0
75 
76 #define PIN_TCCAP1_SPD (PIO_PA0_IDX)
77 #define PIN_TCCAP1_SPD_MUX (IOPORT_MODE_MUX_B)
78 
79 #define TCCAP1_SPD_Handler TC0_Handler
80 #define TCCAP1_SPD_IRQn TC0_IRQn
81 
82 #else
83 /*********** Use for testing with EVB-2 rev 2.0.0 *********/
84 
85  /*** Position ***/
86  // EVB H8-7: GPIO3 - QDEC0-A - TIOA0 - PA0
87  // EVB H8-8: GPIO4 - QDEC0-B - TIOB0 - PA1
88  #define QE0_POS TC0
89  #define ID_QE0_POS ID_TC0
90 
91  #define PIN_QE0_POS_PHA (PIO_PA0_IDX) //TC0 TIOA0
92  #define PIN_QE0_POS_PHA_MUX (IOPORT_MODE_MUX_B)
93 
94  #define PIN_QE0_POS_PHB (PIO_PA1_IDX) //TC0 TIOB0
95  #define PIN_QE0_POS_PHB_MUX (IOPORT_MODE_MUX_B)
96 
97  /*** Speed ***/
98  // EVB H8-7: GPIO3 - QDEC0-A - TIOA0 - PA0
99  #define TCCAP0_SPD TC0
100  #define TCCAP0_SPD_CHANNEL 0
101  #define ID_TCCAP0_SPD ID_TC0
102 
103  #define PIN_TCCAP0_SPD (PIO_PA0_IDX)
104  #define PIN_TCCAP0_SPD_MUX (IOPORT_MODE_MUX_B)
105 
106  #define TCCAP0_SPD_Handler TC0_Handler
107  #define TCCAP0_SPD_IRQn TC0_IRQn
108 
109  /*********** Right Wheel Encoder ***********/
110  /*** Position ***/
111  // EVB H8-13: GPIO9 - QDEC3-A - TIOA9 - PE0
112  // EVB H8-14: GPIO10 - QDEC3-B - TIOB9 - PE1
113  #define QE1_POS TC3
114  #define ID_QE1_POS ID_TC9
115 
116  #define PIN_QE1_POS_PHA (PIO_PE0_IDX) //TC3 TIOA9
117  #define PIN_QE1_POS_PHA_MUX (IOPORT_MODE_MUX_B)
118 
119  #define PIN_QE1_POS_PHB (PIO_PE1_IDX) //TC3 TIOB9
120  #define PIN_QE1_POS_PHB_MUX (IOPORT_MODE_MUX_B)
121 
122  /*** Speed ***/
123  // EVB H8-13: GPIO1 - TIOA9 - PE0
124  #define TCCAP1_SPD TC3
125  #define TCCAP1_SPD_CHANNEL 0
126  #define ID_TCCAP1_SPD ID_TC9
127 
128  #define PIN_TCCAP1_SPD (PIO_PE0_IDX)
129  #define PIN_TCCAP1_SPD_MUX (IOPORT_MODE_MUX_B)
130 
131  #define TCCAP1_SPD_Handler TC9_Handler
132  #define TCCAP1_SPD_IRQn TC9_IRQn
133 
134 #endif
135 
136 #endif /* CONF_D_QUADENC_H_ */


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04