Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor change of SPI interface [API breaking] #6187

Closed
drahnr opened this issue Feb 23, 2018 · 3 comments
Closed

Minor change of SPI interface [API breaking] #6187

drahnr opened this issue Feb 23, 2018 · 3 comments

Comments

@drahnr
Copy link
Contributor

drahnr commented Feb 23, 2018

Note: This is just a template, so feel free to use/remove the unnecessary things

Description

  • Type: Enhancement | Question
  • Priority: Minor

Question

using SPI the types do not make much sense.

The idea is that things are bytes that are written, I am not 100% sure if charis guaranteed to be unsigned. At least as of C11 this is implementation specific.

So should there not be either be made usage of uint8_t (as defined in <cinttypes> or <cstdint>) or define a custom byte_t.

virtual int write(const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length);

The API of virtual int write(int value); is not very idiomatic either, the argument should also be an uint8_t since that is what is actually transfered, the return value is a mingled version of an error code and a return code.

proposal (this is an API breaking change):

virtual int write(const uint8_t *tx_buffer, size_t tx_length, uint8_t *rx_buffer, size_t rx_length);
virtual int write(uint8_t value, uint8_t *ret);

I'd like to know what you think about this or what was the reasoning to use the above?

@deepikabhavnani
Copy link

deepikabhavnani commented Aug 27, 2018

I'd like to know what you think about this or what was the reasoning to use the above?

Work on this is going on at the HAL layer, once low level API's are updated we will update the driver as well. Refer #7671 for updated API's

[Mirrored to Jira]

@ARMmbed ARMmbed deleted a comment from ciarmcom Oct 2, 2018
@adbridge
Copy link
Contributor

adbridge commented Oct 4, 2018

Internal Jira reference: https://jira.arm.com/browse/IOTCORE-144

@evedon
Copy link
Contributor

evedon commented May 23, 2019

HAL layer was updated.
Closing this question as it is rather old. Please reopen if you need additional assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants