Skip to content

stm32: Implement Asynchronous SPI Slave #1650

@ryannathans

Description

@ryannathans

This issue is to implement asynchronous sending and receiving on the SPI when configured as a slave - instead of blocking and waiting for whenever a clock is provided from the master. SPI (read and write) should probably have a configurable buffer like uart rx currently does. When the master clocks, the contents of the send buffer should be clocked out and whatever the master is sending should be clocked in to the read buffer (if exists). The user should probably be able to choose between blocking and non-blocking modes as mentioned in #1533.

Related: #1642 (async uart tx)

Bug with existing implementation:
Currently when reading SPI as a slave, the function blocks until the specified number of bytes is received or the timeout occurs. If the timeout occurs an exception is raised (OS: 116) #1414 . An exception shouldn't be raised. Whatever data was read should be returned, just as the uart read currently does.

As a result of not having asynchronous read/writes and with the existing quirky behaviors, spi slave mode seems rather unusable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementationsport-stm32

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions