aboutsummaryrefslogtreecommitdiff
path: root/include/spi.h
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-03-20 16:39:30 +0100
committerKarel Kočí <cynerd@email.cz>2016-03-20 16:39:30 +0100
commit9439c6f1caffd938673018f3af7460b33a12528e (patch)
tree55eb32bfb1f90a489982853f698619a2083a4285 /include/spi.h
parent1ac3026c039cb15dd8c110c84215096854c3c804 (diff)
downloadavr-ioe-9439c6f1caffd938673018f3af7460b33a12528e.tar.gz
avr-ioe-9439c6f1caffd938673018f3af7460b33a12528e.tar.bz2
avr-ioe-9439c6f1caffd938673018f3af7460b33a12528e.zip
Another work progress
Diffstat (limited to 'include/spi.h')
-rw-r--r--include/spi.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/spi.h b/include/spi.h
index 8d51eb9..bdfce25 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -9,6 +9,11 @@
#define _IOE_SPI_H_
#ifdef CONFIG_SPI
+/*! \brief Modes definition for spi_init
+ *
+ * This enum is used by spi_init to define if SPI should be initialized as master
+ * or slave.
+ */
enum spiMode {
SPI_MODE_MASTER,
SPI_MODE_SLAVE
@@ -17,6 +22,10 @@ enum spiMode {
volatile extern int8_t _spi_busy;
volatile extern Mutex spi_mutex;
+/*! \brief Initializes SPI interface.
+ *
+ * \param mode Specify mode of SPI interface
+ */
static inline void spi_init(enum spiMode mode) {
_spi_busy = 0;
if (mode == SPI_MODE_MASTER) {
@@ -59,7 +68,6 @@ static inline void spi_expose(uint8_t data) {
SPDR = data;
}
-// Null terminated array
extern void (*spi_receive)(uint8_t data);
#endif /* CONFIG_SPI */