UART driver in RUST

I am developing a UART driver in rust. The driver as an entity is developed. However, I am trying to wrap the UART driver inside a OnceCell which is inside a OwnMutex, and then declare it in the main() function. I have written the OnceCell as well, but I am facing difficulty in understanding how to write the OwnMutex. It needs to be a simple mutex created without any std libraries. It needs to have a modify function(takes a reference of the mutex and a function impl), which will disable the UART interrupts, implement the function and then enable the interrupt again. My UART driver already has the UART peripheral inside it. Any suggestions on how to code the OwnMutex?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.