arduino / arduino/ArduinoCore-API

SPI API add void transfer(const void *tx_buffer, void *rx_buffer, size_t count);

オープン
#243 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
C++
スター
306
フォーク
150
PR マージ指標
30日以内にマージされた PR はありません

説明

### API component

SPI API

### Description

SPI API add
```
virtual void transfer(const void *tx_buffer, void *rx_buffer, size_t count);
```
[Expand SPI API and Functionality for High Speed Devices](https://github.com/arduino/ArduinoCore-API/discussions/189)

### Is this a breaking change?

Unlikely

### Additional information

This is really a missing API method, it doesn't make sense to have only a single buffer for both transmit and receive, as DMA hardware normally works in 2 buffers.
The plain old
https://github.com/arduino/ArduinoCore-API/blob/master/api/HardwareSPI.h#L112
```
virtual void transfer(void *buf, size_t count) = 0;
```
forces hacks such as:
- allocate a temporary buffer
- do the DMA transfers receiving into the temporary buffer
- copy that temporary buffer data back into the address pointed by *buf*
wasting both memory and cpu cycles

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

api/HardwareSPI.h の既存の単一バッファ転送宣言から始め、次にリンクされたディスカッションを読んで、想定されている SPI API の範囲を確認します。インターフェースを変更する前に、影響を受ける API 実装と検証経路を追跡します。2 バッファの仮想転送シグネチャが一貫してサポートされ、一時バッファのワークアラウンドが不要になれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
api, embedded-iot
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。