Returning a pointer to a buffer from a c extension #13114
Unanswered
kdschlosser
asked this question in
Using MicroPython
Replies: 2 comments
-
I'm pretty sure what you want is
Line 971 in b5449b0 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think you are correct. I will give that a shot and see what happens. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a user c module that gets compiled with MicroPython. This module handles setting up the busses for displays. Because of the different allocation mechanisms used between the different boards I need to be able to create the frame buffer in C code. The graphics framework is also a user c module. The bus drivers are a separate module than the framework and I would like to keep it that way. One of the things I need to be able to do is collect the frame buffer and pass it over to the framework. This is something that would be done in Python code.
I need to know how I would go about returning an array.array or a bytearray or a bytes object from a function that is defined in the c module. I have not found this being done anywhere in Micropython. Maybe even a memory view object would work. I need a pointer to be passed from C code to the python side of things and then back into C code.
Beta Was this translation helpful? Give feedback.
All reactions