All Projects → numworks → epsilon-sample-app-rust

numworks / epsilon-sample-app-rust

Licence: BSD-3-Clause License
A sample Rust app for the NumWorks graphing calculator

Programming Languages

python
139335 projects - #7 most used programming language
rust
11053 projects
assembly
5116 projects

Projects that are alternatives of or similar to epsilon-sample-app-rust

mbedtls-esp8266
Updated and Upgraded mbedTLS library for the ESP8266 (probably ESP32 too)
Stars: ✭ 13 (-18.75%)
Mutual labels:  embedded
static string
A fixed capacity dynamically sized string
Stars: ✭ 46 (+187.5%)
Mutual labels:  embedded
sabotage
a radical and experimental distribution based on musl libc and busybox
Stars: ✭ 502 (+3037.5%)
Mutual labels:  embedded
tinypacks
A data serialization format for constrained environments like 8-bit and 16-bit microcontrollers.
Stars: ✭ 30 (+87.5%)
Mutual labels:  embedded
zhe
Lighter-than-air, peer-to-peer, bounded, non-blocking, non-threaded, etc., publish-subscribe networking
Stars: ✭ 44 (+175%)
Mutual labels:  embedded
OpenWare
Firmware for OWL devices
Stars: ✭ 23 (+43.75%)
Mutual labels:  embedded
NinjaCalc
An embedded engineering calculator toolbox for doing calculations in a breeze.
Stars: ✭ 14 (-12.5%)
Mutual labels:  embedded
pwm-pca9685-rs
Platform-agnostic Rust driver for the PCA9685 I2C 16-channel, 12-bit PWM/Servo/LED controller
Stars: ✭ 19 (+18.75%)
Mutual labels:  embedded
mros2
agent-less and lightweight communication library compatible with rclcpp for embedded devices
Stars: ✭ 72 (+350%)
Mutual labels:  embedded
go-jdk
Run JVM-based code in Go efficiently
Stars: ✭ 61 (+281.25%)
Mutual labels:  embedded
ArduinoSpritzCipher
Spritz encryption system portable C library, CSPRNG, cryptographic hash and MAC functions, symmetric-key data encryption, and general-purpose functions. It's also an Arduino library.
Stars: ✭ 67 (+318.75%)
Mutual labels:  embedded
Ellie-Language
Ellie is a type-safe programing language that runs on embedded and sandboxed environments.
Stars: ✭ 16 (+0%)
Mutual labels:  embedded
apex
Apex RTOS - A (somewhat) Linux compatible real time operating system
Stars: ✭ 15 (-6.25%)
Mutual labels:  embedded
oic
Open Instrument Control
Stars: ✭ 40 (+150%)
Mutual labels:  embedded
Cicada-FW
IoT Communications Module for Energy Access. An easy way to get production ready, bi-directional communications for your IoT embedded device. Proiect supported by the EnAccess Foundation - https://enaccess.org
Stars: ✭ 12 (-25%)
Mutual labels:  embedded
nixos-on-arm
Cross Compiling NixOS to ARM as a replacement for Yocto
Stars: ✭ 129 (+706.25%)
Mutual labels:  embedded
wymlp
tiny fast portable real-time deep neural network for regression and classification within 50 LOC.
Stars: ✭ 36 (+125%)
Mutual labels:  embedded
cortex-uni-startup
Unified startup code and link scripts for Cortex-M microcontrollers
Stars: ✭ 33 (+106.25%)
Mutual labels:  embedded
esp-idf-hal
embedded-hal implementation for Rust on ESP32 and ESP-IDF
Stars: ✭ 42 (+162.5%)
Mutual labels:  embedded
eze
Embedded Zeebe Engine
Stars: ✭ 13 (-18.75%)
Mutual labels:  embedded

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 toolchain as well as the corresponding rust target and a couple Python modules.

brew install rustup numworks/tap/arm-none-eabi-gcc # Or equivalent on your OS
rustup-init
rustup target add thumbv7em-none-eabihf
pip3 install lz4 pypng
cargo build

Run the app

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

brew install dfu-util # Or equivalent on your OS
# 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. Note that at the moment Epsilon 16 is in beta, so you'll need to register as a beta tester.

Epsilon expects apps to follow a certain layout in memory. Namely, they should start with the following header:

Offset Size Value Description
0x00 0x04 0xDEC0BEBA Magic start-of-header marker
0x04 0x04 0x00000000 API Level
0x08 0x04 - Offset from start of the app to a NULL-terminated NFKD UTF-8 string containing the app name
0x0C 0x04 - Size of the icon data
0x10 0x04 - Offset from start of the app to the actual icon data. This data should be the result of LZ4-compressing a sequence of 55x56 RGB565 pixels
0x14 0x04 - Offset from start of the app to the entry point
0x18 0x04 - Size of the entire app
0x22 0x04 0xDEC0BEBA Magic end-of-header marker

Generating the appropriate header is taken care of by a linker script when you run cargo build. Once the corresponding binary is built on your computer, you will need to install it at address 0x90350000 in your calculator's Flash memory. The included run.py script will take care of this for you when you call cargo run.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].