Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 2.1 KB

README.md

File metadata and controls

55 lines (37 loc) · 2.1 KB

Sample Rust app for Epsilon

Build

Sample Rust app for the NumWorks graphing calculator

This is a sample Rust app to use on a NumWorks calculator. Yes, you can now use Rust to write code for a graphing calculator!

fn eadk_main() {
    for _ in 0..100 {
        let c = eadk::Color { rgb565: random_u16() };
        let r = eadk::Rect { x: random_coordinate(), y: random_coordinate(), width: random_coordinate(), height: random_coordinate() };
        eadk::display::push_rect_uniform(r, c);
    }
    loop {}
}

Build the app

You need to install an embedded ARM rust compiler as well as nwlink.

brew install rustup node # Or equivalent on your OS
rustup-init
rustup target add thumbv7em-none-eabihf
npm install -g nwlink
cargo build

Run the app

The app is sent over to the calculator using the DFU protocol over USB.

# Now connect your NumWorks calculator to your computer using the USB cable
cargo run

Notes

The NumWorks calculator runs Epsilon, a tailor-made calculator operating system. Starting from version 16, Epsilon allows installing custom binary apps. To run this sample app, make sure your calculator is up-to-date by visiting https://my.numworks.com.

Due to the embedded nature of Epsilon, the Rust app has to be no_std. The interface that an app can use to interact with the OS is essentially a short list of system calls. Feel free to browse the code of Epsilon itself if you want to get an in-depth look.

Please note that any custom app is removed when resetting the calculator.

License

This sample app is distributed under the terms of the BSD License. See LICENSE for details.

Trademarks

NumWorks and Rust are a registered trademarks.