Where to find source code for Pyboard classes?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
BillG
Posts: 9
Joined: Fri Feb 05, 2016 4:12 pm

Where to find source code for Pyboard classes?

Post by BillG » Mon Aug 08, 2016 12:07 am

I'd like to read the source code for the Pyboard class ADC library. Where do I find this? I've fished around in github but don't see it. I found "stmhal" in micropython-master and it contains adc.c, but there must be a Python layer above that.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Where to find source code for Pyboard classes?

Post by dhylands » Mon Aug 08, 2016 3:48 am

That adc.c file that you found is the interface. It's C code which implements the python interface.

You can find the documentation for the python interface here:
http://docs.micropython.org/en/latest/p ... b.ADC.html

For example, the read method: http://docs.micropython.org/en/latest/p ... b.ADC.read is implemented here:
https://github.com/micropython/micropyt ... #L252-L259

BillG
Posts: 9
Joined: Fri Feb 05, 2016 4:12 pm

Re: Where to find source code for Pyboard classes?

Post by BillG » Mon Aug 08, 2016 2:36 pm

Thanks, Dave. I read through adc.c more thoroughly overnight and saw the notations for interfacing to Python.

Post Reply