grift_arena_embedded 1.2.0

Embedded-specific features for the Grift Scheme interpreter, including hardware register and memory access
Documentation

Grift Arena Embedded

Embedded-specific features for the Grift Scheme interpreter.

This crate provides native Rust functions for:

  • Hardware register access (read/write)
  • Memory peek/poke operations
  • GPIO control
  • Bit manipulation utilities

Design

This crate is designed to be modular and work in no_std environments. The core Lisp interpreter (grift_eval) remains independent of hardware, while this crate provides the bridge to embedded functionality.

Usage

use grift_eval::{Lisp, Evaluator};
use grift_arena_embedded::register_embedded_natives;

let lisp: Lisp<10000> = Lisp::new();
let mut eval = Evaluator::new(&lisp).unwrap();

// Register all embedded native functions
register_embedded_natives(&mut eval).unwrap();

// Now you can call embedded functions from Lisp:
// (peek 0)           ; Read memory at address
// (poke 0 42)        ; Write to memory
// (gpio-read 0)      ; Read GPIO register 0
// (gpio-write 0 1)   ; Write 1 to GPIO register 0

Safety

Memory access functions are inherently unsafe on real hardware. This crate provides a mock implementation for testing that uses a simulated memory space rather than real hardware registers.