Documentation - amir1387aht/MicroCS GitHub Wiki

MicroCS documentation

New here? Read the main README first: it shows the two ways to use MicroCS (a library inside your firmware, or the whole firmware as a C# REPL).

Guide What you will find
🧭 Step-by-step guides from nothing to C# on your board: PC, ESP32, ESP32-C3 + OLED, Raspberry Pi Pico, STM32, Arduino, Zephyr
šŸš€ Getting started build, first script, simulator, REPL, precompiling, embedding — in 10 minutes
šŸ”Œ Hardware API GPIO, UART, I²C, SPI, ADC, DAC, PWM, timers, I²S, QSPI, CAN, watchdog, RTC; interrupts; writing a board table
šŸŽ›ļø Peripheral configuration GpioConfig, SpiConfig, UartConfig …: pins, pulls, drive strength, filters, board options; what each board supports; implementing it in a port
⚔ DMA DmaBuffer, SPI.WriteAsync & co., DmaTransfer, memory DMA; ordering and lifetime rules; per-board support; implementing it in a port
šŸ“¶ Wi-Fi & networking Wifi (station, soft AP, scan, events, static IP, saved networks), ESP-NOW, NTP, mDNS, ping, TcpClient / TcpListener / UdpClient, Http + HTTPS, Json; ESP32 setup; the --sim radio
šŸ”µ Bluetooth LE opt-in Ble: advertising and beacons, scanning, GATT server (BleService) and client (BleConnection), pairing / bonding, BleUart; ESP32 NimBLE, Pico W BTstack, Zephyr, ArduinoBLE; the --sim radio
šŸ–„ļø U8g2 displays optional C# U8g2 / U8x8 on olikraus' u8g2: turning it on in each build, choosing displays and fonts, fonts from files, the whole API, the --oled simulator
🧩 Device drivers the driver registry, the built-in ws2812 (LedStrip) and servo (Servo) drivers and their backends, writing your own, turning drivers off
āš™ļø Configuration the project config header mcs_user_config.h, -D options, profiles, precedence, per build system
🧭 Porting & build systems Make, CMake, ESP-IDF, Zephyr, PlatformIO, Arduino, CubeIDE/Keil/IAR; the vendor ports; new chips
šŸ“Ÿ Standalone firmware mcs_runtime, the REPL, boot sequence, upload protocol, mcs_remote.py
šŸ”§ Embedding the C API: VMs, running code, C bindings, calling scripts, limits, GC rules
🧩 Language the supported C# subset, feature by feature, and every known difference from .NET
šŸ“š Standard library generated reference of every class and member a script can call
šŸ’¾ Filesystem VFS mounts, RAM / POSIX / TinyFS / LittleFS / YAFFS2 backends, flash ports, File / Directory / Path
ā±ļø Scheduler startup / once / periodic jobs, jobs.cfg
🧵 Threads optional real OS threads: FreeRTOS / Zephyr / POSIX, second core, Channel
🪫 Small MCUs running in 24–64 KB of RAM: profiles, execute-in-place images, GC tuning, measured results
šŸ“Š Performance benchmarks, Cortex-M footprint, memory findings — with commands to reproduce
šŸ—ļø Architecture pipeline, VM, GC, modules, invariants for contributors
🧱 Bytecode .mcsb image format, loader validation, full instruction set
šŸ›”ļø Security what the sandbox guarantees and what it does not
🧪 Testing test matrix, port checks, fuzzing, sanitizers, .NET parity, adding tests

Port guides: STM32 Ā· ESP32 Ā· RP2040/RP2350 Ā· Zephyr Ā· Arduino Ā· examples: examples/

The same pages are on the wiki (published from this folder on every push to main by tools/wiki_sync.py; edit them here).

Project history: CHANGELOG Ā· Contributing