You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying the MicroPython component in a system, there is currently no way to actually interface with another component on the system purely by writing Python code. By interfacing with another component we mean:
reading from and writing to shared memory regions;
notifying and being notified;
calling PPCs;
handling PPCs (?).
Instead, a user needs to write a C module for MicroPython and then call that module from Python. It would probably be useful to define a small module which provides an interface to other components which the MicroPython has a channel to. The module could consist of:
a method for notifying another component;
an asynchronous flag object which allows awaiting a notification from another component;
a method for executing a PPC;
an object providing a view of a shared memory region.
With the above a user would be able to use the MicroPython component to interface with another component writing only Python without any C.
The information required for these methods to work (information about shared memory regions, channel IDs) could be provided in the MicroPython resource object. Then, from Python code, the user could use the module to enumerate the channels available to it and call the above methods on a channel object to interface with it. Some pseudocode:
import lionsos
channels = lionsos.channels()
for ch in channel:
ch.regions[0] = "Hello"
ch.notify()
await ch.notification()
print(ch.regions[1])
The text was updated successfully, but these errors were encountered:
When deploying the MicroPython component in a system, there is currently no way to actually interface with another component on the system purely by writing Python code. By interfacing with another component we mean:
Instead, a user needs to write a C module for MicroPython and then call that module from Python. It would probably be useful to define a small module which provides an interface to other components which the MicroPython has a channel to. The module could consist of:
With the above a user would be able to use the MicroPython component to interface with another component writing only Python without any C.
The information required for these methods to work (information about shared memory regions, channel IDs) could be provided in the MicroPython resource object. Then, from Python code, the user could use the module to enumerate the channels available to it and call the above methods on a channel object to interface with it. Some pseudocode:
The text was updated successfully, but these errors were encountered: