#devices #module #r2d2 #io #communication #serial #define

r2d2-pal

An I/O device communication module written in Rust

1 unstable release

0.1.11 Nov 26, 2024

#874 in Hardware support

Download history 124/week @ 2024-11-22 19/week @ 2024-11-29 6/week @ 2024-12-06

149 downloads per month

MIT license

18KB
410 lines

R2D2

"Rust Reliable Device Drivers"

r2d2-pal (R2D2 Protocol Abstraction Layer) is a module to define Rust bindings for Python of the linux_embedded_hal crate.

Installation

pip install -U r2d2-pal

Usage

Serial example:

import r2d2

bus = r2d2.SerialBus(
    port_name=port_name,
    baud_rate=baud_rate,
    byte_size=byte_size,
    parity=str(parity),
    stop_bits=stop_bits,
)

bus.write(b"Hello, World!")
data = bus.read(13, 10.0)

Dependencies

~4.5MB
~91K SLoC