Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2900ed2

Browse files
committed
add SPI.write_readinto() to esp8266 port
1 parente75fd0e commit2900ed2

File tree

1 file changed

+20
-0
lines changed
  • esp8266/common-hal/busio

1 file changed

+20
-0
lines changed

‎esp8266/common-hal/busio/SPI.c‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,23 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self,
185185
}
186186
return true;
187187
}
188+
189+
boolcommon_hal_busio_spi_transfer(busio_spi_obj_t*self,uint8_t*data_out,uint8_t*data_in,size_tlen) {
190+
// Process data in chunks, let the pending tasks run in between
191+
size_tchunk_size=1024;// TODO this should depend on baudrate
192+
size_tcount=len /chunk_size;
193+
size_ti=0;
194+
for (size_tj=0;j<count;++j) {
195+
for (size_tk=0;k<chunk_size;++k) {
196+
data_in[i]=spi_transaction(HSPI,0,0,0,0,8,data_out[i],8,0);
197+
++i;
198+
}
199+
ets_loop_iter();
200+
}
201+
while (i<len) {
202+
data_in[i]=spi_transaction(HSPI,0,0,0,0,8,data_out[i],8,0);
203+
++i;
204+
}
205+
return true;
206+
207+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp