656b848a17
190: update MAX7219 for new release r=adamgreig a=almindor I've taken over the MAX7219 driver since the original author didn't touch it for a year. Driver has been updated to use latest `embedded-hal`, documented and slightly extended with helper functions. I've made a release to crates.io as well since there was none done previously. Co-authored-by: Ales Katona <almindor@gmail.com> |
||
---|---|---|
.github | ||
.travis.yml | ||
Code-of-Conduct.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE-CC0 | ||
README.md | ||
rust-embedded-logo-256x256.png |
Embedded Rust
This is a curated list of resources related to embedded and low-level programming in the programming language Rust, including a list of useful crates.
This project is developed and maintained by the Resources team.
Don't see something you want or need here? Add it to the Not Yet Awesome Embedded Rust list!
Table of contents
- Community
- Books, blogs and training materials
- Tools
- Peripheral Access Crates
- HAL implementation crates
- Architecture support crates
- Board support crates
- Component abstraction crates
- Driver crates
- no-std crates
- Rust forks
- Firmware projects
- License
Community
In 2018 Rust community has created an embedded workgroup to help drive adoption in the Rust ecosystem.
-
Embedded WG, including newsletters with progress updates.
-
You can usually find the members of the embedded WG on the
#rust-embedded
channel (server:irc.mozilla.org
). -
embedded.rs Telegram chat about Rust for microcontrollers in Russian language.
Books, blogs and training materials
- Discovery by @rust-embedded — this book is an introductory course on microcontroller-based embedded systems that uses Rust as the teaching language. Original author: @japaric
- Cortex-M Quickstart by @japaric – a template and introduction to embedded Rust, suitable for developers familiar to embedded development but new to embedded Rust.
- Exploring Rust on Teensy by @branan — Beginner set of articles on getting into embedded dev in Rust.
- Pragmatic Bare Metal Rust A starter article about starting Rust development on STM32 microcontrollers (cubeMX + FFI).
- Using Rust in an Embedded Project: A Simple Example Article and some links on setting up Rust cross-compiling.
- Robigalia general purpose robust operating system in Rust running on secure seL4 microkernel.
- Tock An embedded operating system designed for running multiple concurrent, mutually distrustful applications on low-memory and low-power microcontrollers
- intermezzOS A small teaching operating system in Rust. A book with some explanations is also included.
- Raspberry Pi Bare Metal Programming with Rust
- 32-bit Version (most Pi1 and Pi2 variants) A starter article on OSdev with Rust on RPi (cross-compiler setup and a very basic LED-blinking kernel).
- 64-bit Version (Pi2 Model B v1.2 and all Pi3) A growing collection of tutorials, from simple booting to interfacing components like UARTs or random number generators; Features a painless cross-toolchain setup.
- Fearless concurrency by @japaric — How to easily develop Rust programs for pretty much any ARM Cortex-M microcontroller with memory-safe concurrency.
- RTFM v2 Real-Time For the Masses — Cortex-M programming framework for building concurrent applications.
- cortex-m rtfm RTFM framework for ARM Cortex-M microcontrollers
- msp430 rtfm RTFM framework for MSP430 MCUs
- FreeRTOS.rs Rust interface for the FreeRTOS API
- MicroRust Introductory book for embedded development in Rust on the micro:bit.
- Physical Computing With Rust A (WIP) guide to physical computing with Rust on the Raspberry Pi.
- Internet of Streams A video series by @jamesmunns building a bare metal IoT Sensor Node Platform from (nearly) scratch in Rust
Tools
- xargo Rust package manager with support for non-default std libraries — build rust runtime for your own embedded system.
- xargo is great but it's in maintenance mode, cargo-xbuild is catching up as intended replacement.
- svd2rust Generate Rust structs with register mappings from SVD files.
- μtest unit testing for microcontrollers and other no-std systems.
- embedded-hal-mock Mock implementation of
embedded-hal
traits for testing without accessing real hardware. - - bindgen Automatically generates Rust FFI bindings to C and C++ libraries. -
- cortex-m semihosting Semihosting for ARM Cortex-M processors
- bobbin-cli A Rust command line tool to simplify embedded development and deployment.
- cargo-fel4 A Cargo subcommand for working with feL4 projects. -
Peripheral Access Crates
Register definition for microcontroller families. Usually generated using svd2rust
. -
Peripheral Access Crates were also called Device Crates.
NOTE You may be able to find even more peripheral access crates by searching for the
svd2rust
keyword on crates.io!
Microchip
atsamd21
Peripheral access API for Microchip (formerly Atmel) SAMD21 microcontrollers. This git repo hosts both the peripheral access crate and the hal.atsamd51
Peripheral access API for Microchip (formerly Atmel) SAMD51 microcontrollers. This git repo hosts both the peripheral access crate and the hal.avr-device
Peripheral access API for Microchip (formerly Atmel) AVR microcontroller family.sam3x8e
Peripheral access API for Atmel SAMD3X8E microcontrollers (generated using svd2rust) -
Nordic
nrf51
Peripheral access API for nRF51 microcontrollers (generated using svd2rust) -nrf52810-pac
- Peripheral access API for the nRF52810 microcontroller (generated using svd2rust) -nrf52832-pac
- Peripheral access API for the nRF52832 microcontroller (generated using svd2rust) -nrf52840-pac
- Peripheral access API for the nRF52840 microcontroller (generated using svd2rust) -
NXP
SiFive
e310x
- svd2rust generated interface to SiFive Freedom E310 MCUs -
STMicroelectronics
stm32f103xx
Peripheral access API for STM32F103XX microcontrollers (generated using svd2rust) -stm32f100xx
Peripheral access API for STM32F100XX microcontrollers (generated using svd2rust) -stm32f30x
Peripheral access API for STM32F30X microcontrollers (generated using svd2rust) -stm32f469xx
Peripheral access API for STM32f469XX microcontrollers (generated using svd2rust) -stm32l151
-
stm32-rs
Peripheral access API for most STM32 microcontrollers (generated using svd2rust): stm32f0, stm32f1, stm32f2, stm32f3, stm32f4, stm32f7, stm32l0, stm32l1, stm32l4, stm32h7
Texas Instruments
tm4c123x
Peripheral access API for TM4C123x microcontrollers (generated using svd2rust)tm4c129x
Peripheral access API for TM4C129x microcontrollers (generated using svd2rust)
MSP430
msp430g2553
Peripheral access API for MSP430G2553 microcontrollers (generated using svd2rust)- msp430 quickstart some examples for msp430
HAL implementation crates
Implementations of embedded-hal
for microcontroller families and systems running some OS. -
NOTE You may be able to find even more HAL implementation crates by searching for the
embedded-hal-impl
and embedded-hal
keywords on crates.io!
OS
linux-embedded-hal
for embedded Linux systems like the Raspberry Pi. -ftdi-embedded-hal
for FTDI FTx232H chips connected to Linux systems via USBbitbang-hal
software protocol implementations for microcontrollers with digital::OutputPin and digital::InputPin
Microchip
atsamd-hal
- HAL for SAMD21 and SAMD51 -- 'avr-hal' - HAL for AVR microcontroller family and AVR-based boards
Nordic
NXP
Also check the list of NXP board support crates!
SiFive
e310x-hal
- HAL for SiFive Freedom E310 MCUs -
STMicroelectronics
Also check the list of STMicroelectronics board support crates!
stm32f0xx-hal
-- Has examples that can run on boards like the Nucleo-F042K6 and similar boards
stm32f1xx-hal
-- Can be run on boards like the Blue pill, Nucleo-F103RB and similar boards
-
- Generic HAL implementation for all MCUs of the stm32f4 series
-
- HAL implementation for the the STMicro STM32L0xx family of microcontrollers
-
- Generic hal support for stm32l4 devices, has examples that can run on boards like the Nucleo-L432KC, Solo, and similar boards
Texas Instruments
Espressif
esp8266-hal
(not supported by rustc, so must be built with mrustc, typically via the esp-rs build script)
Silicon Labs
tomu-hal
- HAL implementation targeted for Tomu USB board with EFM32HG309F64 ARMv6-M core. Has support to configure tomu bootloader directly from application via
toboot_config
macro.
- HAL implementation targeted for Tomu USB board with EFM32HG309F64 ARMv6-M core. Has support to configure tomu bootloader directly from application via
XMC
Architecture support crates
Crates tailored for general CPU architectures.
ARM
cortex-m
Low level access to Cortex-M processors -cortex-a
Low level access to Cortex-A processors (early state) -
RISC-V
riscv
Low level access to RISC-V processors -
MIPS
mips
Low level access to MIPS32 processors -
Board support crates
Crates tailored for specific boards.
Adafruit
metro_m4
-pyportal
-trellis_m4
-
Arduino
avr-hal
- Board support crate for several AVR-based boards including the Arduino Uno and the Arduino Leonardo
Nordic
dwm1001
- Decawave DWM1001-DEV -microbit
- micro:bit -
NXP
frdm-kw41z
- FRDM-KW41Z -
SiFive
Sony
prussia
- SDK for the PlayStation 2.
STMicroelectronics
nucleo-f042k6
- Nucleo-F042K6nucleo-f103rb
- Nucleo-F103RBf3
Board Support Crate for the STM32F3DISCOVERY -stm32f407g-disc
Board Support Crate for the STM32F4DISCOVERY (WIP) -stm32f429i-disc
Board Support Crate for the STM32F429DISCOVERY (WIP) -solo-bsp
Board Support Crate for Solo, an open source security token (WIP) -
Texas Instruments
stellaris-launchpad
- For the Texas Instruments Stellaris Launchpad and Tiva-C Launchpadmonotron
- A 1980s home-computer style application for the Texas Instruments Stellaris Launchpad. PS/2 keyboard input, text output on a bit-bashed 800x600 VGA signal. Uses menu, vga-framebuffer and pc-keyboard.
Special Purpose
betafpv-f3
- For the BetaFPV F3 drone flight controller
Component abstraction crates
The following crates provide HAL-like abstractions for subcomponents of embedded
devices which go beyond what is available in embedded-hal
:
accelerometer
- Generic accelerometer support, including traits and types for taking readings from 2 or 3-axis accelerometers and tracking device orientations -embedded-graphics
: 2D drawing library for any size display -smart-leds
: Support for addressable LEDs including WS2812 and APA102
Driver crates
Platform agnostic crates to interface external components. These crates use the embedded-hal
interface to support all the devices and systems that implement the embedded-hal
traits.
The list below contains drivers developed as part of the Weekly Driver initiative and that have achieved the "released" status (published on crates.io + documentation / short blog post).
- L3GD20 - SPI - Gyroscope - Intro blog post -
- LSM303DLHC - I2C - Accelerometer + compass (magnetometer) - Intro blog post -
- MCP3008 - SPI - 8 channel 10-bit ADC - Intro blog post -
- ENC28J60 - SPI - Ethernet controller - Intro blog post -
- MCP3425 - I2C - 16-bit ADC - Intro blog post -
- SGP30 - I2C - Gas sensor - Intro blog post -
- HTS221 - I2C - Humidity and temperature sensor - Intro blog post -
- SSD1306 - I2C/SPI - OLED display controller - Intro blog post -
- MMA7660FC - I2C - 3-axis accelerometer - Intro blog post
- shift-register-driver - GPIO - Shift register - Intro blog post -
- TSL256X - I2C - Light Intensity Sensor - Intro blog post -
- EEPROM24x - I2C - 24x series serial EEPROM driver - Intro blog post -
- DS1307 - I2C - Real-time clock driver - Intro blog post -
- keypad - GPIO - Keypad matrix circuits - Intro post -
- BlueNRG - SPI - driver for BlueNRG-MS Bluetooth module - Intro post
- shared-bus - I2C - utility driver for sharing a bus between multiple devices - Intro post
- TMP006 - I2C - Contact-less infrared (IR) thermopile temperature sensor driver - Intro post
- BNO055 - I2C - Bosch Sensortec BNO055 9-axis IMU driver - Intro post
- SH1106 - I2C - Monochrome OLED display controller - Intro post
- embedded-sdmmc - SPI - SD/MMC Card Driver with MS-DOS Partition and FAT16/FAT32 support - Intro post
- ADXL343 - I2C - 3-axis accelerometer -
- TMP1x2 - I2C - TMP102 and TMP112x temperature sensor driver - Intro blog post
- ADS1x1x - I2C - 12/16-bit ADCs like ADS1013, ADS1015, ADS1115, etc. - Intro blog post -
- KXCJ9 - I2C - KXCJ9/KXCJB 3-axis accelerometers - Intro blog post -
- AD983x - SPI - AD9833/AD9837 waveform generators / DDS - Intro blog post -
NOTE You may be able to find even more driver crates by searching for the embedded-hal-driver
keyword on crates.io!
WIP
Work in progress drivers. Help the authors make these crates awesome!
- MFRC522 - SPI - RFID tag reader/writer
- motor-driver - Motor drivers: L298N, TB6612FNG, etc.
- MAG3110 - I2C - Magnetometer
- SI5351 - I2C - clock generator
- SI7021 - I2C - Humidity and temperature sensor
- MAX7219 - SPI - LED display driver -
- DS3231 - I2C - real time clock
- BH1750 - I2C - ambient light sensor (lux meter)
- SHT2x - I2C - temperature / humidity sensors
- INA260 - I2C - power monitor -
- ILI9341 - SPI - TFT LCD display
- HD44780 - Parallel port - LCD controller
- HD44780-driver - GPIO - LCD controller -
- MCP9808 - I2C - Temperature sensor -
- AXP209 - I2C - Power management unit
- DS3234 - SPI - Real time clock
- PCD8544 - SPI - 48x84 pixels matrix LCD controller
- PCD8544_rich - SPI - Rich driver for 48x84 pixels matrix LCD controller -
- HC-SR04 - DIO - Ultrasound sensor
- AFE4400 - SPI - Pulse oximeter
- SX1278 - SPI - Long range (LoRa) transceiver
- RFM69 - SPI - ISM radio transceiver
- LS010B7DH01 - SPI - Memory LCD
- MAX31855 - SPI - Thermocouple digital converter
- MAX31865 - SPI - RTD to Digital converter -
- SHT3x - I2C - Temperature / humidity sensors
- SX1509 - I2C - IO Expander / Keypad driver
- NRF24L01 - SPI - 2.4 GHz wireless communication
- embedded-nrf24l01 - SPI+GPIO - 2.4 GHz radio
- stm32-eth - MCU - Ethernet
- bme680 - I2C - Temperature / humidity / gas / pressure sensor -
- w5500 - SPI - Ethernet Module with hardwired protocols : TCP, UDP, ICMP, IPv4, ARP, IGMP, PPPoE -
- OneWire - 1wire - OneWire protocol implementation with drivers for devices such as DS18B20 -
- SSD1322 - SPI - Graphical OLED display controller -
- GridEYE - I2C - Rust driver for Grid-EYE / Panasonic AMG88(33) -
- PCF857x - I2C - I/O expanders: PCF8574, PCF8574A, PCF8575
- eink-waveshare - SPI - driver for E-Paper Modules from Waveshare
- xCA9548A - I2C - I2C switches/multiplexers: TCA9548A, PCA9548A -
- SSD1351 - SPI - 16bit colour OLED display driver -
- VEML6070 - I2C - UVA light sensor -
- VEML6075 - I2C - UVA and UVB light sensor -
- LM75 - I2C - Temperature sensor and thermal watchdog -
- MAX44009 - I2C - Ambient light sensor -
- TCS3472 - I2C - RGB color light sensor -
- DS323x - I2C/SPI - Real-time clocks (RTC): DS3231, DS3232 and DS3234 -
- pwm-pca9685 - I2C - 16-channel, 12-bit PWM/Servo/LED controller -
- AS5048A - SPI - AMS AS5048A Magnetic Rotary Encoder
- MAX17048/9 - I2C - LiPo Fuel guage, battery monitoring IC -
- HM11 - USART - HM-11 bluetooth module AT configuration crate -
- APDS9960 - I2C - Proximity, ambient light, RGB and gesture sensor -
- SSD1675 - SPI - Tri-color ePaper display controller -
- CC1101 - SPI - Sub-1GHz RF Transceiver -
- MPU9250 - no_std driver for the MPU9250 (and other MPU* devices) & onboard AK8963 (accelerometer + gyroscope + magnetometer IMU)
- MPU6050 - I2C - no_std driver for the MPU6050
- BMP280 - A platform agnostic driver to interface with the BMP280 pressure sensor
- BME280 - A rust device driver for the Bosch BME280 temperature, humidity, and atmospheric pressure sensor and the Bosch BMP280 temperature and atmospheric pressure sensor.
- LSM303C - A platform agnostic driver to interface with the LSM303C (accelerometer + compass)
- VL53L0X - A platform agnostic driver to interface with the vl53l0x (time-of-flight sensor)
- MCP49xx - SPI - 8/10/12-bit DACs like MCP4921, MCP4922, MCP4801, etc. -
- DW1000 - SPI - Radio transceiver for communication based on IEEE 802.15.4 and position tracking -
- radio-at86rf212 - SPI - Sub GHz 802.15.4 radio transceiver
- vesc-comm - A driver for communicating with VESC-compatible electronic speed controllers
- VEML6040 - I2C - RGBW color light sensor -
- SCD30 - I2C - CO₂ sensor -
- TPA2016D2 - I2C - A driver for interfacing with the Texas Instruments TPA2016D2 Class-D amplifier -
- RN2xx3 - Serial - A driver for the RN2483 / RN2903 LoRaWAN modems by Microchip
- ST7735-lcd - SPI - An embedded-graphics compatible driver for the popular lcd family from Sitronix
no-std crates
#![no_std]
crates designed to run on resource constrained devices.
- atomic: Generic Atomic wrapper type.
- bbqueue: A SPSC, statically allocatable queue based on BipBuffers suitable for DMA transfers -
- bit_field: manipulating bitfields and bitarrays -
- biquad: A library for creating second order IIR filters for signal processing based on Biquads, where both a Direct Form 1 (DF1) and Direct Form 2 Transposed (DF2T) implementation is available.
- bluetooth-hci: device-independent Bluetooth Host-Controller Interface implementation.
- combine: parser combinator library -
- console-traits: Describes a basic text console. Used by menu and implemented by vga-framebuffer.
- tinybmp: No-std, no-alloc BMP parser for embedded systems. Introductory blog post -
- heapless: provides
Vec
,String
,LinearMap
,RingBuffer
backed by fixed-size buffers - - ieee802154: Partial implementation of the IEEE 802.15.4 standard -
- intrusive-collections: intrusive (non-allocating) singly/doubly linked lists and red-black trees -
- managed: provides
ManagedSlice
,ManagedMap
backed by either their std counterparts or fixed-size buffers for#![no_std]
. - - menu: A basic command-line interface library. Has nested menus and basic help functionality.
- micromath: Embedded Rust math library featuring fast, safe floating point approximations for common arithmetic operations, 2D and 3D vector types, and statistical analysis -
- nalgebra: general-purpose and low-dimensional linear algebra library -
- nom: parser combinator framework -
- null-terminated: generic null-terminated arrays -
- num-format: Crate for producing string representations of numbers, formatted according to international standards, e.g. "1,000,000" for US English -
- pc-keyboard: A PS/2 keyboard protocol driver. Transport (bit-banging or SPI) agnostic, but can convert Set 2 Scancodes into Unicode.
- qei : A qei wrapper that allows you to extend your qei timers from a 16 bit integer to a 64 bit integer. -
- register-rs: Unified interface for MMIO and CPU registers. Provides type-safe bitfield manipulation. -
- scroll: extensible and endian-aware Read/Write traits for generic containers -
- smoltcp: a small TCP/IP stack that runs without
alloc
. - vga-framebuffer: A VGA signal generator and font renderer for VGA-less microcontrollers. Used by Monotron to generate 48 by 36 character display using 3 SPI peripherals and a timer.
- dcmimu: An algorithm for fusing low-cost triaxial MEMS gyroscope and accelerometer measurements
- wyhash: A fast, simple and portable hashing algorithm and random number generator. -
WIP
Work in progress crates. Help the authors make these crates awesome!
- light-cli: a lightweight heapless cli interface
- OxCC: A port of Open Source Car Control written in Rust
- Rubble: A pure-Rust embedded BLE stack
Rust forks
AVR
- AVR Rust Fork of Rust with AVR support.
Firmware projects
- anne-key: Alternate keyboard firmware for the Obins ANNE Pro
License
This list is licensed under
- CC0 1.0 Universal License (LICENSE-CC0 or https://creativecommons.org/publicdomain/zero/1.0/legalcode)
Code of Conduct
Contribution to this crate is organized under the terms of the Rust Code of Conduct, the maintainer of this crate, the Resources team, promises to intervene to uphold that code of conduct.