source code for read_digital, and set_pull

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
rhubarbdog
Posts: 168
Joined: Tue Nov 07, 2017 11:45 pm

source code for read_digital, and set_pull

Post by rhubarbdog » Thu Nov 29, 2018 12:57 pm

i'm trying to get a sensor working.
i need to run `pinX.set_pull(pinX.PULL_UP)`
i want this to go faster so wanted to see the source to see if i can make it ,go
the problem is i cant remember the name and location of the source code for these micropython micobit objects and methods

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: source code for read_digital, and set_pull

Post by Roberthh » Thu Nov 29, 2018 1:30 pm

micropython/ports/nrf/modules/machine/pin.c
nrf_gpio_cfg() is called in there to configure the GPIO pin

rhubarbdog
Posts: 168
Joined: Tue Nov 07, 2017 11:45 pm

Re: source code for read_digital, and set_pull

Post by rhubarbdog » Thu Nov 29, 2018 6:18 pm

i've found much of the source. main files are /source/microbit/microbitpin.cpp and source/microbit/microbitpinmode.c. how ever microbitpin.cpp reference 2 headers "MicroBitPin.h" and "nrf_gpio.h"
i've tried the find file button on both microbit/micropython and micropython/mcropython and can't locate the or the corresponding .c files if they exist

Post Reply