Merge pull request #92 from eringerli/more-specific-documentation

More specific Documentation
This commit is contained in:
Limor "Ladyada" Fried 2022-05-02 16:11:36 -04:00 committed by GitHub
commit 4ca049393f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 10 deletions

View File

@ -114,7 +114,8 @@ bool Adafruit_SPIDevice::begin(void) {
} }
/*! /*!
* @brief Transfer (send/receive) one byte over hard/soft SPI * @brief Transfer (send/receive) a buffer over hard/soft SPI, without
* transaction management
* @param buffer The buffer to send and receive at the same time * @param buffer The buffer to send and receive at the same time
* @param len The number of bytes to transfer * @param len The number of bytes to transfer
*/ */
@ -251,7 +252,8 @@ void Adafruit_SPIDevice::transfer(uint8_t *buffer, size_t len) {
} }
/*! /*!
* @brief Transfer (send/receive) one byte over hard/soft SPI * @brief Transfer (send/receive) one byte over hard/soft SPI, without
* transaction management
* @param send The byte to send * @param send The byte to send
* @return The byte received while transmitting * @return The byte received while transmitting
*/ */
@ -281,7 +283,8 @@ void Adafruit_SPIDevice::endTransaction(void) {
} }
/*! /*!
* @brief Write a buffer or two to the SPI device. * @brief Write a buffer or two to the SPI device, with transaction
* management.
* @param buffer Pointer to buffer of data to write * @param buffer Pointer to buffer of data to write
* @param len Number of bytes from buffer to write * @param len Number of bytes from buffer to write
* @param prefix_buffer Pointer to optional array of data to write before * @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,
} }
/*! /*!
* @brief Read from SPI into a buffer from the SPI device. * @brief Read from SPI into a buffer from the SPI device, with transaction
* management.
* @param buffer Pointer to buffer of data to read into * @param buffer Pointer to buffer of data to read into
* @param len Number of bytes from buffer to read. * @param len Number of bytes from buffer to read.
* @param sendvalue The 8-bits of data to write when doing the data read, * @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) {
} }
/*! /*!
* @brief Write some data, then read some data from SPI into another buffer. * @brief Write some data, then read some data from SPI into another buffer,
* The buffers can point to same/overlapping locations. This does not * with transaction management. The buffers can point to same/overlapping
* transmit-receive at the same time! * locations. This does not transmit-receive at the same time!
* @param write_buffer Pointer to buffer of data to write from * @param write_buffer Pointer to buffer of data to write from
* @param write_len Number of bytes from buffer to write. * @param write_len Number of bytes from buffer to write.
* @param read_buffer Pointer to buffer of data to read into. * @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,
/*! /*!
* @brief Write some data and read some data at the same time from SPI * @brief Write some data and read some data at the same time from SPI
* into the same buffer. This is basicaly a wrapper for transfer() with * into the same buffer, with transaction management. This is basicaly a wrapper
* CS-pin and transaction management. * for transfer() with CS-pin and transaction management. This /does/
* This /does/ transmit-receive at the same time! * transmit-receive at the same time!
* @param buffer Pointer to buffer of data to write/read to/from * @param buffer Pointer to buffer of data to write/read to/from
* @param len Number of bytes from buffer to write/read. * @param len Number of bytes from buffer to write/read.
* @return Always returns true because there's no way to test success of SPI * @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) {
return true; return true;
} }
/*!
* @brief Assert/Deassert the CS pin if it is defined
* @param value The state the CS is set to
*/
void Adafruit_SPIDevice::setChipSelect(int value) { void Adafruit_SPIDevice::setChipSelect(int value) {
if (_cs == -1) if (_cs == -1)
return; return;