File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ class DriverPins {
216
216
PinsFunction pin (function, pinNo, index, logic);
217
217
addPin (pin);
218
218
}
219
-
219
+ // / Get pin information by function
220
220
Optional<PinsFunction> getPin (PinFunctionEnum function, int pos = 0 ) {
221
221
for (PinsFunction &pin : pins) {
222
222
if (pin.function == function && pin.index == pos)
@@ -225,19 +225,21 @@ class DriverPins {
225
225
return {};
226
226
}
227
227
228
+ // / Get pin information by pin ID
229
+ Optional<PinsFunction> getPin (Pin pinId){
230
+ for (PinsFunction &pin : pins) {
231
+ if (pin.pin == pinId)
232
+ return pin;
233
+ }
234
+ return {};
235
+ }
236
+
228
237
Pin getPinID (PinFunctionEnum function, int pos = 0 ) {
229
238
auto pin = getPin (function, pos);
230
239
if (pin) return pin.value ().pin ;
231
240
return -1 ;
232
241
}
233
242
234
- ActiveLogic getPinActiveLogic (Pin pinId){
235
- for (PinsFunction &pin : pins) {
236
- if (pin.pin == pinId)
237
- return pin.active_logic ;
238
- }
239
- return ActiveLogic::ActiveUndefined;
240
- }
241
243
242
244
Optional<PinsI2C> getI2CPins (PinFunctionEnum function) {
243
245
for (PinsI2C &pin : i2c) {
You can’t perform that action at this time.
0 commit comments