コンテンツにスキップ

embedded-io — Crate 詳細

embedded-io

Stable no_std

組み込み向けの I/O トレイト(Read/Write/Seek 等)を提供する crate。std の I/O に近い発想で、no_std 環境でもドライバやミドルウェアの共通化をしやすくする。

I/O traits for embedded systems (Read/Write/Seek), usable in no_std environments.

バージョン
0.6.1
ライセンス
MIT OR Apache-2.0
メンテナンス
活発に開発中

コード例

UART/USB/ファイル等の具体実装に依存せず書き込み処理を共通化できます。

Write トレイトで汎用出力
#![no_std]
use embedded_io::Write;
pub fn write_hello<W: Write>(w: &mut W) {
let _ = w.write_all(b"hello\n");
}

関連 Crates