Now #Rhai Script is transcoded to uLisp #BL602 with the proper scopes
https://github.com/lupyuen/bl602-simulator/blob/transcode/bl602-script/src/transcode.rs#L393-L622
Let's add a #RustLang Module to manage the Nested uLisp Scopes for #BL602 ... Like "let*" and "dotimes"
https://github.com/lupyuen/bl602-simulator/blob/transcode/bl602-script/src/scope.rs
#Rhai Loops are now transcoded to uLisp #BL602 yay!
https://github.com/lupyuen/bl602-simulator/blob/transcode/bl602-script/src/transcode.rs#L279-L443
But can we connect ST7789 Display in 3-Wire, 9-bit Mode ... And pack the 9-bit data into 8-bit SPI? 🤔
Normally we connect ST7789 Display in 4-Wire Mode and transmit 8-bit data over SPI...
https://lupyuen.github.io/articles/display#display-image-on-st7789
Our #Rhai Script to uLisp #BL602 Transcoder ... So far so good!
https://github.com/lupyuen/bl602-simulator/blob/transcode/bl602-script/src/transcode.rs#L158-L370
OK transcoding a #Rhai StackSlot to uLisp #BL602 wasn't so hard!
https://github.com/lupyuen/bl602-simulator/blob/transcode/bl602-script/src/transcode.rs#L110-L156
Transcoding #Rhai Function Calls to uLisp #BL602 ... Needs more work because of the "StackSlot" parameters 🤔
https://github.com/lupyuen/bl602-simulator/blob/transcode/bl602-script/src/transcode.rs#L107-L141
How we transcode #Rhai Statements and Expressions to uLisp for #BL602
https://github.com/lupyuen/bl602-simulator/blob/transcode/bl602-script/src/transcode.rs#L54-L105
Here's how we compile #Rhai Script to Abstract Syntax Tree ... Then walk the tree and transcode to uLisp #BL602
https://github.com/lupyuen/bl602-simulator/blob/transcode/bl602-script/src/transcode.rs
Anyone knows how to talk to ST7789 Display on 3-Wire (9-bit) Mode ... Over 8-bit SPI? Do we pack our bits into 9-byte chunks? (9 bits x 8) Thanks! 🙏
#Rhai Abstract Syntax Tree will have Gnarly Nested Nodes ... Transcoding to uLisp will be an interesting challenge!
https://github.com/lupyuen/bl602-simulator/blob/main/bl602-script/src/lib.rs#L193-L284
How to Transcode #Rhai Script to #uLisp? We walk the Abstract Syntax Tree and convert every node
https://github.com/lupyuen/bl602-simulator/blob/main/bl602-script/src/lib.rs#L158-L192
#Rhai Script runs OK on #BL602 WebAssembly Simulator ... But to run on Real BL602 Hardware we shall transcode to uLisp
https://lupyuen.github.io/articles/rustsim?25#appendix-rhai-scripts-on-bl602
#Rhai lets us register our #RustLang Module with the Script Engine ... So calling the #BL602 Rust Wrapper is no problemo!
https://github.com/lupyuen/bl602-simulator/blob/main/bl602-script/src/lib.rs
Braised Chicken with Daikon and Mushroom
https://www.rotinrice.com/braised-chicken-with-dark-soy-sauce-and-mushrooms/
75 upvotes on r/rust ... Super nervous 😬
IoT Techie and Educator / Apache NuttX PMC