File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export enum GPIOPinState {
77 Input ,
88 InputPullUp ,
99 InputPullDown ,
10+ InputBusKeeper ,
1011}
1112
1213export const FUNCTION_PWM = 4 ;
@@ -186,10 +187,15 @@ export class GPIOPin {
186187 return this . outputValue ? GPIOPinState . High : GPIOPinState . Low ;
187188 } else {
188189 // TODO: check what happens when we enable both pullup/pulldown
189- if ( this . pulldownEnabled ) {
190+ // ANSWER: It is valid, see: 2.19.4.1. Bus Keeper Mode, datasheet p240
191+ if ( this . pulldownEnabled && this . pullupEnabled ) {
192+ // Pull high when high, pull low when low:
193+ return GPIOPinState . InputBusKeeper ;
194+ }
195+ else if ( this . pulldownEnabled ) {
190196 return GPIOPinState . InputPullDown ;
191197 }
192- if ( this . pullupEnabled ) {
198+ else if ( this . pullupEnabled ) {
193199 return GPIOPinState . InputPullUp ;
194200 }
195201 return GPIOPinState . Input ;
You can’t perform that action at this time.
0 commit comments