Skip to content

Commit a43f6e0

Browse files
committed
more specific documentation
1 parent c702120 commit a43f6e0

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

Adafruit_SPIDevice.cpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ bool Adafruit_SPIDevice::begin(void) {
114114
}
115115

116116
/*!
117-
* @brief Transfer (send/receive) one byte over hard/soft SPI
117+
* @brief Transfer (send/receive) a buffer over hard/soft SPI, without
118+
* transaction management
118119
* @param buffer The buffer to send and receive at the same time
119120
* @param len The number of bytes to transfer
120121
*/
@@ -251,7 +252,8 @@ void Adafruit_SPIDevice::transfer(uint8_t *buffer, size_t len) {
251252
}
252253

253254
/*!
254-
* @brief Transfer (send/receive) one byte over hard/soft SPI
255+
* @brief Transfer (send/receive) one byte over hard/soft SPI, without
256+
* transaction management
255257
* @param send The byte to send
256258
* @return The byte received while transmitting
257259
*/
@@ -281,7 +283,8 @@ void Adafruit_SPIDevice::endTransaction(void) {
281283
}
282284

283285
/*!
284-
* @brief Write a buffer or two to the SPI device.
286+
* @brief Write a buffer or two to the SPI device, with transaction
287+
* management.
285288
* @param buffer Pointer to buffer of data to write
286289
* @param len Number of bytes from buffer to write
287290
* @param prefix_buffer Pointer to optional array of data to write before
@@ -347,7 +350,8 @@ bool Adafruit_SPIDevice::write(const uint8_t *buffer, size_t len,
347350
}
348351

349352
/*!
350-
* @brief Read from SPI into a buffer from the SPI device.
353+
* @brief Read from SPI into a buffer from the SPI device, with transaction
354+
* management.
351355
* @param buffer Pointer to buffer of data to read into
352356
* @param len Number of bytes from buffer to read.
353357
* @param sendvalue The 8-bits of data to write when doing the data read,
@@ -386,9 +390,9 @@ bool Adafruit_SPIDevice::read(uint8_t *buffer, size_t len, uint8_t sendvalue) {
386390
}
387391

388392
/*!
389-
* @brief Write some data, then read some data from SPI into another buffer.
390-
* The buffers can point to same/overlapping locations. This does not
391-
* transmit-receive at the same time!
393+
* @brief Write some data, then read some data from SPI into another buffer,
394+
* with transaction management. The buffers can point to same/overlapping
395+
* locations. This does not transmit-receive at the same time!
392396
* @param write_buffer Pointer to buffer of data to write from
393397
* @param write_len Number of bytes from buffer to write.
394398
* @param read_buffer Pointer to buffer of data to read into.
@@ -462,9 +466,9 @@ bool Adafruit_SPIDevice::write_then_read(const uint8_t *write_buffer,
462466

463467
/*!
464468
* @brief Write some data and read some data at the same time from SPI
465-
* into the same buffer. This is basicaly a wrapper for transfer() with
466-
* CS-pin and transaction management.
467-
* This /does/ transmit-receive at the same time!
469+
* into the same buffer, with transaction management. This is basicaly a wrapper
470+
* for transfer() with CS-pin and transaction management. This /does/
471+
* transmit-receive at the same time!
468472
* @param buffer Pointer to buffer of data to write/read to/from
469473
* @param len Number of bytes from buffer to write/read.
470474
* @return Always returns true because there's no way to test success of SPI
@@ -486,6 +490,10 @@ bool Adafruit_SPIDevice::write_and_read(uint8_t *buffer, size_t len) {
486490
return true;
487491
}
488492

493+
/*!
494+
* @brief Assert/Deassert the CS pin if it is defined
495+
* @param value The state the CS is set to
496+
*/
489497
void Adafruit_SPIDevice::setChipSelect(int value) {
490498
if (_cs == -1)
491499
return;

0 commit comments

Comments
 (0)