-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Labels
EnhancementChanges/Updates/Additions to existing featuresChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsChanges to public APIs
Description
rx_bufsparameter (inspi_transceiveandspi_transceive_asyncfunctions) could be declared as a pointer to a constant structure, as the content of any RX buffer structure is not (and shouldn't be) modified, only what itsbufmember points to is a subject to modification. This would allow to pass an array of RX buffers stored in flash as the parameter. Currently this is not possible without artificial typecasting.- The same applies to
configparameter in all functions exposed by this API. Although this structure can not be placed in flash (because of itsdevmember that is filled in runtime), it is not supposed to be modified inside SPI drivers, thus it should be marked as such. - "EEPROM read mode" should be described (it is not a widely known feature) and I think this feature should be optional, since it may be troublesome to implement for some controllers. What would be wrong when a driver returns an error when it does not provide this option?
spi_transceiveandspi_transceive_asynctake too many parameters. This will be ineffective (at least on some architectures) as it will force placing some of them on stack. And some of these parameters are tightly coupled (liketx_bufsandtx_count), so it feels natural to pack them in structures (which will be constant, so they can be placed in flash). Then, if one direction of the transfer is not needed (inspi_readandspi_write) a singleNULLinstead of a pairNULL, 0could be passed instead of a structure for this direction.- I think it would be clearer if the asynchronous part was enabled not by CONFIG_POLL directly but by some config option with a more SPI related name that depends on POLL. This would also allow building only the synchronous part of the SPI driver in a system with POLL enabled (in case someone finds such fancy setup useful).
Metadata
Metadata
Assignees
Labels
EnhancementChanges/Updates/Additions to existing featuresChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsChanges to public APIs