support for setpull
This commit is contained in:
parent
45ecd883bb
commit
af42dbf30a
@ -134,6 +134,17 @@ namespace pins {
|
|||||||
PINOP(setAnalogPeriodUs(micros));
|
PINOP(setAnalogPeriodUs(micros));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures the pull of this pin.
|
||||||
|
* @param name pin to set the pull mode on
|
||||||
|
* @param pull one of the mbed pull configurations: PullUp, PullDown, PullNone
|
||||||
|
*/
|
||||||
|
//% help=pins/digital-set-pull weight=21 blockGap=8
|
||||||
|
//% blockId=device_set_pull block="digital set pull|pin %pin|to %pull"
|
||||||
|
void setPull(DigitalPin name, PinMode pull) {
|
||||||
|
PINOP(setPull(pull));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures this pin to a digital input, and generates events where the timestamp is the duration that this pin was either ``high`` or ``low``.
|
* Configures this pin to a digital input, and generates events where the timestamp is the duration that this pin was either ``high`` or ``low``.
|
||||||
*/
|
*/
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
enum PinMode {
|
||||||
|
PullDown,
|
||||||
|
PullUp,
|
||||||
|
PullNone
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Control currents in Pins for analog/digital signals, servos, i2c, ...
|
* Control currents in Pins for analog/digital signals, servos, i2c, ...
|
||||||
*/
|
*/
|
||||||
|
9
libs/microbit/shims.d.ts
vendored
9
libs/microbit/shims.d.ts
vendored
@ -487,6 +487,15 @@ declare namespace pins {
|
|||||||
//% blockId=device_set_analog_period block="analog set period|pin %pin|to (µs)%micros" shim=pins::analogSetPeriod
|
//% blockId=device_set_analog_period block="analog set period|pin %pin|to (µs)%micros" shim=pins::analogSetPeriod
|
||||||
function analogSetPeriod(name: AnalogPin, micros: number): void;
|
function analogSetPeriod(name: AnalogPin, micros: number): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures the pull of this pin.
|
||||||
|
* @param name pin to set the pull mode on
|
||||||
|
* @param pull one of the mbed pull configurations: PullUp, PullDown, PullNone
|
||||||
|
*/
|
||||||
|
//% help=pins/digital-set-pull weight=21 blockGap=8
|
||||||
|
//% blockId=device_set_pull block="digital set pull|pin %pin|to %pull" shim=pins::setPull
|
||||||
|
function setPull(name: DigitalPin, pull: PinMode): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures this pin to a digital input, and generates events where the timestamp is the duration that this pin was either ``high`` or ``low``.
|
* Configures this pin to a digital input, and generates events where the timestamp is the duration that this pin was either ``high`` or ``low``.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user