ESP32 Calling MicroPython from C module
Posted: Thu Mar 05, 2020 12:43 pm
Hello,
From MicroPython i can call C functions off of a C module, with the help of this tutorial:
https://docs.micropython.org/en/latest/ ... dules.html
Now, i'm trying to call a MicroPython function from this C module. With regular Python and C this can be done by importing Python.h on the C module and then following some steps to call the Python function. With this method functions can also be inserted into Python from C.
In MicroPython however, i cannot import Python.h from Python3.7 because i am met with hierarchical errors (Which makes sense because isn't ment for the ESP32), and i am unable to find a Python.h (Or anything that represents it) in the MicroPython repository.
Therefore my question; does anyone know how i can achieve calling a MicroPython function from C? Or maybe what steps i could follow in order to create my own Python.h in MicroPython
From MicroPython i can call C functions off of a C module, with the help of this tutorial:
https://docs.micropython.org/en/latest/ ... dules.html
Now, i'm trying to call a MicroPython function from this C module. With regular Python and C this can be done by importing Python.h on the C module and then following some steps to call the Python function. With this method functions can also be inserted into Python from C.
In MicroPython however, i cannot import Python.h from Python3.7 because i am met with hierarchical errors (Which makes sense because isn't ment for the ESP32), and i am unable to find a Python.h (Or anything that represents it) in the MicroPython repository.
Therefore my question; does anyone know how i can achieve calling a MicroPython function from C? Or maybe what steps i could follow in order to create my own Python.h in MicroPython