summaryrefslogtreecommitdiffstats
path: root/watch-library/shared/watch
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-01-26 22:39:09 -0500
committerJoey Castillo <joeycastillo@utexas.edu>2022-01-26 22:40:49 -0500
commit523a5d2f0b3f0d79b16784470870935313dd5775 (patch)
treeb7631b071432bba90eb14aa9540f97c01c5503ac /watch-library/shared/watch
parentb2dbc4feeb48697fbbdbb7740b6db552a45b3c02 (diff)
downloadSensor-Watch-523a5d2f0b3f0d79b16784470870935313dd5775.tar.gz
Sensor-Watch-523a5d2f0b3f0d79b16784470870935313dd5775.tar.bz2
Sensor-Watch-523a5d2f0b3f0d79b16784470870935313dd5775.zip
implement SPI flash chip
Diffstat (limited to 'watch-library/shared/watch')
-rw-r--r--watch-library/shared/watch/watch_spi.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/watch-library/shared/watch/watch_spi.h b/watch-library/shared/watch/watch_spi.h
index 9bb0d194..b72b0e0b 100644
--- a/watch-library/shared/watch/watch_spi.h
+++ b/watch-library/shared/watch/watch_spi.h
@@ -41,19 +41,26 @@ void watch_enable_spi(void);
*/
void watch_disable_spi(void);
-/** @brief Sends a series of values to a device on the SPI bus.
+/** @brief Writes a series of values to a device on the SPI bus.
* @param buf A series of unsigned bytes; the data you wish to transmit.
* @param length The number of bytes in buf that you wish to send.
* @note This function does not manage the chip select pin (usually A3).
*/
-void watch_spi_send(uint8_t *buf, uint16_t length);
+bool watch_spi_write(const uint8_t *buf, uint16_t length);
-/** @brief Receives a series of values from a device on the SPI bus.
+/** @brief Reads a series of values from a device on the SPI bus.
* @param buf Storage for the incoming bytes; on return, it will contain the received data.
* @param length The number of bytes that you wish to receive.
* @note This function does not manage the chip select pin (usually A3).
*/
-void watch_spi_receive(uint8_t *buf, uint16_t length);
+bool watch_spi_read(uint8_t *buf, uint16_t length);
+
+/** @brief Reads a series of values from a device on the SPI bus.
+ * @param buf Storage for the incoming bytes; on return, it will contain the received data.
+ * @param length The number of bytes that you wish to receive.
+ * @note This function does not manage the chip select pin (usually A3).
+ */
+bool watch_spi_transfer(const uint8_t *data_out, uint8_t *data_in, uint16_t length);
/// @}
#endif