diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-10-30 15:45:38 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-10-30 15:45:38 +0000 |
commit | 43f9fd4180030081daae9122bd57a521ec9c58e1 (patch) | |
tree | af4185a0b33d984503a16c0b55e2febe2a9a73bf /os/io/spi.h | |
parent | 5ccb308ed861f6f7a42b7d826e939fd8efa68bac (diff) | |
download | ChibiOS-43f9fd4180030081daae9122bd57a521ec9c58e1.tar.gz ChibiOS-43f9fd4180030081daae9122bd57a521ec9c58e1.tar.bz2 ChibiOS-43f9fd4180030081daae9122bd57a521ec9c58e1.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1258 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io/spi.h')
-rw-r--r-- | os/io/spi.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/os/io/spi.h b/os/io/spi.h index 816e9f6d4..e0a163db2 100644 --- a/os/io/spi.h +++ b/os/io/spi.h @@ -38,6 +38,16 @@ #error "SPI_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
#endif
+/**
+ * @brief Driver state machine possible states.
+ */
+typedef enum {
+ SPI_UNINIT = 0, /**< @brief Not initialized. */
+ SPI_STOP = 1, /**< @brief Stopped. */
+ SPI_READY = 2, /**< @brief Ready. */
+ SPI_ACTIVE = 3 /**< @brief Slave selected. */
+} spistate_t;
+
#include "spi_lld.h"
#ifdef __cplusplus
@@ -45,7 +55,8 @@ extern "C" { #endif
void spiInit(void);
void spiObjectInit(SPIDriver *spip);
- void spiSetup(SPIDriver *spip, const SPIConfig *config);
+ void spiStart(SPIDriver *spip, const SPIConfig *config);
+ void spiStop(SPIDriver *spip);
void spiSelect(SPIDriver *spip);
void spiUnselect(SPIDriver *spip);
msg_t spiExchange(SPIDriver *spip, size_t n, void *rxbuf, void *txbuf);
|