Skip to content

Missing documentation for spi.read() second argument #207

Closed
@microbit-carlos

Description

@microbit-carlos

Present in V1 and V2, it essentially writes to the SPI out the value of the second argument, for as long as it is reading data.

V1: https://github.com/bbcmicrobit/micropython/blob/v1.1.1/source/microbit/microbitspi.cpp#L111-L117

V2:

uint8_t byte_out = 0;
if (n_args == 3) {
byte_out = mp_obj_get_int(args[2]);
}
memset(vstr.buf, byte_out, vstr.len);
int ret = microbit_hal_spi_transfer(vstr.len, (uint8_t *)vstr.buf, (uint8_t *)vstr.buf);

Metadata

Metadata

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions