Skip to content

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

Merged
merged 7 commits into from
Oct 27, 2018
Merged

Conversation

paul-szczepanek-arm
Copy link
Member

Description

Fixed missing and incorrect descriptions, style and grammar.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[x] Docs update
[ ] Test update
[ ] Breaking change

*
* @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.
Copy link
Member Author

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

@cmonr
Copy link
Contributor

cmonr commented Oct 23, 2018

@paul-szczepanek-arm Please take another look at your #if/#endif declarations.

@paul-szczepanek-arm
Copy link
Member Author

Thanks, apologies, never a good idea to commit at the end of the day.

Copy link
Contributor

@melwee01 melwee01 left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An SPI

Copy link
Member Author

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.

Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. @brief is implied.

Copy link
Contributor

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.
Copy link
Contributor

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.

@paul-szczepanek-arm
Copy link
Member Author

can you re-review please @melinda?

@paul-szczepanek-arm
Copy link
Member Author

looks like that littlefs test has the DOXYGEN_ONLY macro defined?

@cmonr
Copy link
Contributor

cmonr commented Oct 25, 2018

@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
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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...

@melwee01
Copy link
Contributor

Re-review done.

@paul-szczepanek-arm
Copy link
Member Author

Applied your requested changes

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 25, 2018

@paul-szczepanek-arm Can you review travis failure? it can't compile SPI.cpp file

@cmonr
Copy link
Contributor

cmonr commented Oct 25, 2018

@0xc0170 Waiting to hear back from @geky about the script. I suspect the Travis command that is failing is attempting to compile commented code.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is causing the travis failure. @0xc0170 @cmonr does anyone know if DOXYGEN_ONLY is set for all travis jobs?

@geky
Copy link
Contributor

geky commented Oct 25, 2018

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.

@paul-szczepanek-arm
Copy link
Member Author

good catch, thank you!

@cmonr
Copy link
Contributor

cmonr commented Oct 26, 2018

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.

@cmonr cmonr merged commit fa09fff into ARMmbed:master Oct 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants