-
Notifications
You must be signed in to change notification settings - Fork 3k
Doc: spi documentation fixes #8516
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
Conversation
* | ||
* @return Operation success. | ||
* @retval 0 A transfer was started or added to the queue. | ||
* @retval -1 Transfer can't be added because queue is full. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is actually a bug in the implementation, it doesn't forward the error code, will file an issue
@paul-szczepanek-arm Please take another look at your |
Thanks, apologies, never a good idea to commit at the end of the day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need \brief before /** sections?
@@ -36,39 +36,44 @@ | |||
namespace mbed { | |||
/** \addtogroup drivers */ | |||
|
|||
/** A SPI Master, used for communicating with SPI slave devices | |||
/** A SPI Master, used for communicating with SPI slave devices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An SPI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pronounced "spy". I think 'an' vs 'a' is decided by pronunciation. So it's "an honour" and I can't think of a counter example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Right, in that case, carry on.
I'm quite pleased it IS a 'spymaster' after all!
drivers/SPI.h
Outdated
* | ||
* mosi or miso can be specified as NC if not used | ||
* @note Either mosi or miso can be specified as NC if not used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what device-side standards are, but we usually replace passive constructions like this with 'you can'.
*/ | ||
SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel = NC); | ||
virtual ~SPI(); | ||
|
||
/** Configure the data transmission format | ||
/** Configure the data transmission format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need \brief commands/tags/whatever they're called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. @brief is implied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
drivers/SPI.h
Outdated
int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event); | ||
|
||
/** Configures a callback, spi peripheral and initiate a new transfer | ||
/** Configure a callback, spi peripheral and initiate a new transfer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPI is capitalized in some places and not others.
can you re-review please @melinda? |
looks like that littlefs test has the DOXYGEN_ONLY macro defined? |
Comments addressed. Please re-review.
@geky Question about the Travis CI check that's failing in this PR. Is that snippet doing a similar thing where it parses and runs code comment blocks? And does that mean this PR is failing because the comment(s) fail to compile? 😄 |
drivers/SPI.h
Outdated
* | ||
* @returns | ||
* Response from the SPI slave | ||
* @return Response from the SPI slave |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing period.
drivers/SPI.h
Outdated
@@ -179,75 +186,85 @@ class SPI : private NonCopyable<SPI> { | |||
return 0; | |||
} | |||
|
|||
/** Abort the on-going SPI transfer, and continue with transfer's in the queue if any. | |||
/** Abort the on-going SPI transfer, and continue with transfers in the queue if any. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... in the queue, if any.
drivers/SPI.h
Outdated
int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event); | ||
|
||
/** Configures a callback, spi peripheral and initiate a new transfer | ||
/** Configure a callback, SPI peripheral and initiate a new transfer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... callback, SPI peripheral, and initiate...
Re-review done. |
Applied your requested changes |
@paul-szczepanek-arm Can you review travis failure? it can't compile SPI.cpp file |
void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event); | ||
|
||
#if !defined(DOXYGEN_ONLY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found the issue, the ifdefs were interleaved and would fail depending on the configuration of DEVICE_SPI_ASYNCH, @paul-szczepanek-arm let me know if you're happy with this. |
good catch, thank you! |
Note: This PR is now a part of a rollup PR (#8552). No further work is needed here, as once that PR is merged, this PR will also be closed and marked as merged. If any more commits are made to this PR, this will have to go through CI on it's own. |
Description
Fixed missing and incorrect descriptions, style and grammar.
Pull request type