SPI struct implements both SpiBus and SpiDevice
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- linux, rust
調査の方向性
現在の Spidev ラッパーと、SpiBus および SpiDevice に対する embedded-hal の実装を、issue #87 の議論と併せて確認することから始めます。チップセレクトとバス共有について提案されている動作を含め、ラッパーを SpidevBus と SpidevDevice に分割することを評価してください。API の分離とそのドキュメントが、意図されたカーネルおよびバスマルチプレクシングのセマンティクスに明確に一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Currently our Spidev wrapper struct implements both SpiBus and SpiDevice from embedded-hal. I think this is likely to lead to some confusion, especially since the SpiBus methods will still actually be using a shared SPI bus, toggling CS, and multiplexing with any other spidev devices on the same bus.
We discussed this a bit in #87 and while the main problem there is resolved by the new embedded-hal design, I think the split suggested is still worth considering. The proposal is to have two wrapper structs, SpidevBus and SpidevDevice perhaps, where:
SpidevBusimplements just theSpiBustrait- we configure
spidevto not drive the associated CS pin - we explain in the documentation that when this struct is used, it must be the only active
spidevdevice on that bus - we encourage users to give it a CS pin that is not connected to anything, since whatever pin is assigned to it in the device tree can't be re-used as GPIO (and therefore can't be used as a CS)
- this struct can then be used with any of the bus-multiplexing crates (like embedded-hal-bus) to generate lots of
SpiDeviceobjects, using generic GPIO for CS control, or used when dedicated bus access is required (eg to generate smart LED waveforms) - we are basically lying to the kernel about it being a single device, because there's no way to request exclusive bus access with
spidev
- we configure
SpidevDeviceimplements just theSpiDevicetrait- it's already a perfect fit for
SpiDevice, the kernel handles sharing and CS for us, even with other programs - it will work just as users expect
- but their device tree has to be set up to create the device and use the right CS
- it's already a perfect fit for
I'm happy to implement this as a PR if it sounds good to people, but it'd be great to get some feedback first or any suggestions on how it might be better done, especially if there's any clever spidev-related tricks that might be useful.
- 主要言語
- Rust
- スター
- 323
- フォーク
- 60
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-embedded/linux-embedded-hal のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
rust-embedded/linux-embedded-hal#121 · コメント 4 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rust-embedded/linux-embedded-hal#117 · リアクション 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
rust-embedded/linux-embedded-hal#116 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
rust-embedded/linux-embedded-hal の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[Bug] ComponentType classifies 0x8A8A-0xEAEA as GREASE; mls-extensions §7.5 makes them private useオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
area:ecosystem documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Chelis-Lang/chelis#3866 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
metasequoiaime/msime#8620 ·
メンテナーはふだん 1 日以内に返信
-
agent-detection macos p2 triaged
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信