summaryrefslogtreecommitdiffhomepage
path: root/digital/avr/modules/spi/spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/avr/modules/spi/spi.c')
-rw-r--r--digital/avr/modules/spi/spi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/digital/avr/modules/spi/spi.c b/digital/avr/modules/spi/spi.c
index 1098b260..8fb35bb9 100644
--- a/digital/avr/modules/spi/spi.c
+++ b/digital/avr/modules/spi/spi.c
@@ -91,6 +91,18 @@ spi_recv(void)
return SPDR;
}
+/** Receive a date from the SPI bus from the address provided by parameters.
+ * \param addr the address from which the data shall be read
+ * \return the data at the address requested.
+ */
+uint8_t
+spi_recv_from (uint8_t addr)
+{
+ SPDR = addr;
+
+ return spi_recv();
+}
+
/** Return the status register from the SPI driver.
* \return the status register value
*/