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/templates | |
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/templates')
-rw-r--r-- | os/io/templates/spi_lld.c | 21 | ||||
-rw-r--r-- | os/io/templates/spi_lld.h | 12 |
2 files changed, 19 insertions, 14 deletions
diff --git a/os/io/templates/spi_lld.c b/os/io/templates/spi_lld.c index e31dffc4b..c212946e0 100644 --- a/os/io/templates/spi_lld.c +++ b/os/io/templates/spi_lld.c @@ -47,11 +47,24 @@ void spi_lld_init(void) { }
/**
- * @brief Low level SPI bus setup.
- * + * @brief Configures and activates the SPI peripheral.
+ *
+ * @param[in] spip pointer to the @p SPIDriver object
+ */
+void spi_lld_start(SPIDriver *spip) {
+
+ if (spip->spd_state == SPI_STOP) {
+ /* Clock activation.*/
+ }
+ /* Configuration.*/
+}
+
+/**
+ * @brief Deactivates the SPI peripheral.
+ *
* @param[in] spip pointer to the @p SPIDriver object
*/
-void spi_lld_setup(SPIDriver *spip) {
+void spi_lld_stop(SPIDriver *spip) {
}
@@ -65,7 +78,7 @@ void spi_lld_select(SPIDriver *spip) { }
/**
- * @brief De-asserts the slave select signal.
+ * @brief Deasserts the slave select signal.
* @details The previously selected peripheral is unselected.
*
* @param[in] spip pointer to the @p SPIDriver object
diff --git a/os/io/templates/spi_lld.h b/os/io/templates/spi_lld.h index a8479c008..4017d2418 100644 --- a/os/io/templates/spi_lld.h +++ b/os/io/templates/spi_lld.h @@ -47,15 +47,6 @@ /*===========================================================================*/
/**
- * @brief Driver state machine possible states. - */
-typedef enum {
- SPI_UNINIT = 0,
- SPI_IDLE = 1,
- SPI_ACTIVE = 2
-} spistate_t;
-
-/**
* @brief Driver configuration structure. */
typedef struct {
@@ -99,7 +90,8 @@ typedef struct { extern "C" {
#endif
void spi_lld_init(void);
- void spi_lld_setup(SPIDriver *spip);
+ void spi_lld_start(SPIDriver *spip);
+ void spi_lld_stop(SPIDriver *spip);
void spi_lld_select(SPIDriver *spip);
void spi_lld_unselect(SPIDriver *spip);
msg_t spi_lld_exchange(SPIDriver *spip, size_t n, void *rxbuf, void *txbuf);
|