aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/spi_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates/spi_lld.h')
-rw-r--r--os/hal/templates/spi_lld.h31
1 files changed, 13 insertions, 18 deletions
diff --git a/os/hal/templates/spi_lld.h b/os/hal/templates/spi_lld.h
index 690054f43..c5c69d3fc 100644
--- a/os/hal/templates/spi_lld.h
+++ b/os/hal/templates/spi_lld.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
+ ChibiOS/HAL - Copyright (C) 2006-2014 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
/**
- * @file templates/spi_lld.h
- * @brief SPI Driver subsystem low level driver header template.
+ * @file PLATFORM/spi_lld.h
+ * @brief PLATFORM SPI subsystem low level driver header.
*
* @addtogroup SPI
* @{
@@ -40,11 +40,10 @@
* @{
*/
/**
- * @brief SPI driver enable switch.
- * @details If set to @p TRUE the support for SPI1 is included.
+ * @brief SPI1 driver enable switch.
*/
#if !defined(PLATFORM_SPI_USE_SPI1) || defined(__DOXYGEN__)
-#define PLATFORM_SPI_USE_SPI1 FALSE
+#define PLATFORM_SPI_USE_SPI1 FALSE
#endif
/** @} */
@@ -76,9 +75,9 @@ typedef void (*spicallback_t)(SPIDriver *spip);
*/
typedef struct {
/**
- * @brief Operation complete callback.
+ * @brief Operation complete callback or @p NULL.
*/
- spicallback_t end_cb;
+ spicallback_t end_cb;
/* End of the mandatory fields.*/
} SPIConfig;
@@ -91,26 +90,22 @@ struct SPIDriver {
/**
* @brief Driver state.
*/
- spistate_t state;
+ spistate_t state;
/**
* @brief Current configuration data.
*/
- const SPIConfig *config;
+ const SPIConfig *config;
#if SPI_USE_WAIT || defined(__DOXYGEN__)
/**
- * @brief Waiting thread.
+ * @brief Waiting thread.
*/
- Thread *thread;
+ thread_reference_t thread;
#endif /* SPI_USE_WAIT */
#if SPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
-#if CH_USE_MUTEXES || defined(__DOXYGEN__)
/**
- * @brief Mutex protecting the bus.
+ * @brief Mutex protecting the peripheral.
*/
- Mutex mutex;
-#elif CH_USE_SEMAPHORES
- Semaphore semaphore;
-#endif
+ mutex_t mutex;
#endif /* SPI_USE_MUTUAL_EXCLUSION */
#if defined(SPI_DRIVER_EXT_FIELDS)
SPI_DRIVER_EXT_FIELDS