aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-29 11:12:05 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-29 11:12:05 +0000
commitfe24da9fcca4967e58b25a2698c46717995de0ad (patch)
treec65c37f80160846a873d1c0f3903666b3ad9cb71
parent2a05dca9157fe8ad58a873bd51b6115e4380e10a (diff)
downloadChibiOS-fe24da9fcca4967e58b25a2698c46717995de0ad.tar.gz
ChibiOS-fe24da9fcca4967e58b25a2698c46717995de0ad.tar.bz2
ChibiOS-fe24da9fcca4967e58b25a2698c46717995de0ad.zip
Reorganized sections in HAL files.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1473 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/include/adc.h24
-rw-r--r--os/hal/include/can.h30
-rw-r--r--os/hal/include/mac.h24
-rw-r--r--os/hal/include/mmc_spi.h44
-rw-r--r--os/hal/include/pal.h64
-rw-r--r--os/hal/include/pwm.h24
-rw-r--r--os/hal/include/serial.h54
-rw-r--r--os/hal/include/spi.h24
-rw-r--r--os/hal/platforms/STM32/spi_lld.h11
-rw-r--r--os/hal/src/adc.c16
-rw-r--r--os/hal/src/can.c16
-rw-r--r--os/hal/src/hal.c16
-rw-r--r--os/hal/src/mac.c20
-rw-r--r--os/hal/src/mmc_spi.c8
-rw-r--r--os/hal/src/pal.c16
-rw-r--r--os/hal/src/pwm.c16
-rw-r--r--os/hal/src/serial.c16
-rw-r--r--os/hal/src/spi.c18
-rw-r--r--os/hal/templates/adc_lld.c10
-rw-r--r--os/hal/templates/adc_lld.h4
-rw-r--r--os/hal/templates/can_lld.c10
-rw-r--r--os/hal/templates/can_lld.h4
-rw-r--r--os/hal/templates/hal_lld.c10
-rw-r--r--os/hal/templates/hal_lld.h4
-rw-r--r--os/hal/templates/mac_lld.c20
-rw-r--r--os/hal/templates/mac_lld.h4
-rw-r--r--os/hal/templates/meta/driver.c16
-rw-r--r--os/hal/templates/meta/driver.h24
-rw-r--r--os/hal/templates/meta/driver_lld.c10
-rw-r--r--os/hal/templates/meta/driver_lld.h4
-rw-r--r--os/hal/templates/pal_lld.c10
-rw-r--r--os/hal/templates/pwm_lld.c10
-rw-r--r--os/hal/templates/pwm_lld.h4
-rw-r--r--os/hal/templates/serial_lld.c18
-rw-r--r--os/hal/templates/serial_lld.h4
-rw-r--r--os/hal/templates/spi_lld.c10
-rw-r--r--os/hal/templates/spi_lld.h4
37 files changed, 509 insertions, 112 deletions
diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h
index 685c4049f..2aa0c41c5 100644
--- a/os/hal/include/adc.h
+++ b/os/hal/include/adc.h
@@ -29,10 +29,26 @@
#if CH_HAL_USE_ADC || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
#if !CH_USE_SEMAPHORES
#error "ADC driver requires CH_USE_SEMAPHORES"
#endif
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
/**
* @brief Driver state machine possible states.
*/
@@ -46,6 +62,14 @@ typedef enum {
#include "adc_lld.h"
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/include/can.h b/os/hal/include/can.h
index 8f2a7572d..2a0d1e4df 100644
--- a/os/hal/include/can.h
+++ b/os/hal/include/can.h
@@ -29,9 +29,9 @@
#if CH_HAL_USE_CAN || defined(__DOXYGEN__)
-#if !CH_USE_SEMAPHORES
-#error "CAN driver requires CH_USE_SEMAPHORES"
-#endif
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
/**
* @brief Errors rate warning.
@@ -54,6 +54,22 @@
*/
#define CAN_OVERFLOW_ERROR 16
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+#if !CH_USE_SEMAPHORES
+#error "CAN driver requires CH_USE_SEMAPHORES"
+#endif
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
/**
* @brief Driver state machine possible states.
*/
@@ -67,6 +83,10 @@ typedef enum {
#include "can_lld.h"
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
/**
* @brief Adds some flags to the CAN status mask.
*
@@ -75,6 +95,10 @@ typedef enum {
*/
#define canAddFlagsI(canp, mask) ((canp)->cd_status |= (mask))
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/include/mac.h b/os/hal/include/mac.h
index c07d6029d..0d7a3d76e 100644
--- a/os/hal/include/mac.h
+++ b/os/hal/include/mac.h
@@ -29,8 +29,28 @@
#if CH_HAL_USE_MAC || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
#include "mac_lld.h"
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
/**
* @brief Returns the received frames event source.
*
@@ -67,6 +87,10 @@
#define macReadReceiveDescriptor(rdp, buf, size) \
mac_lld_read_receive_descriptor(rdp, buf, size)
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/include/mmc_spi.h b/os/hal/include/mmc_spi.h
index 2a9fd0c53..da2ed573c 100644
--- a/os/hal/include/mmc_spi.h
+++ b/os/hal/include/mmc_spi.h
@@ -29,9 +29,23 @@
#if CH_HAL_USE_MMC_SPI || defined(__DOXYGEN__)
-#if !CH_USE_EVENTS
-#error "MMC_SPI driver requires CH_USE_EVENTS"
-#endif
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+#define MMC_CMD0_RETRY 10
+#define MMC_CMD1_RETRY 100
+#define MMC_WAIT_DATA 10000
+
+#define MMC_CMDGOIDLE 0
+#define MMC_CMDINIT 1
+#define MMC_CMDREADCSD 9
+#define MMC_CMDSTOP 12
+#define MMC_CMDSETBLOCKLEN 16
+#define MMC_CMDREAD 17
+#define MMC_CMDREADMULTIPLE 18
+#define MMC_CMDWRITE 24
+#define MMC_CMDWRITEMULTIPLE 25
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -72,22 +86,12 @@
#endif
/*===========================================================================*/
-/* Driver constants. */
+/* Derived constants and error checks. */
/*===========================================================================*/
-#define MMC_CMD0_RETRY 10
-#define MMC_CMD1_RETRY 100
-#define MMC_WAIT_DATA 10000
-
-#define MMC_CMDGOIDLE 0
-#define MMC_CMDINIT 1
-#define MMC_CMDREADCSD 9
-#define MMC_CMDSTOP 12
-#define MMC_CMDSETBLOCKLEN 16
-#define MMC_CMDREAD 17
-#define MMC_CMDREADMULTIPLE 18
-#define MMC_CMDWRITE 24
-#define MMC_CMDWRITEMULTIPLE 25
+#if !CH_USE_EVENTS
+#error "MMC_SPI driver requires CH_USE_EVENTS"
+#endif
/*===========================================================================*/
/* Driver data structures and types. */
@@ -171,7 +175,7 @@ typedef struct {
} MMCDriver;
/*===========================================================================*/
-/* External declarations. */
+/* Driver macros. */
/*===========================================================================*/
/**
@@ -184,6 +188,10 @@ typedef struct {
*/
#define mmcIsWriteProtected(mmcp) ((mmcp)->mmc_is_protected())
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/include/pal.h b/os/hal/include/pal.h
index 5b3e01214..ead0a4c33 100644
--- a/os/hal/include/pal.h
+++ b/os/hal/include/pal.h
@@ -29,6 +29,10 @@
#if CH_HAL_USE_PAL || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
/**
* @brief Bits in a mode word dedicated as mode selector.
* @details The other bits are not defined and may be used as device-specific
@@ -83,10 +87,8 @@
*/
#define PAL_MODE_OUTPUT_OPENDRAIN 7
-#include "pal_lld.h"
-
/**
- * @brief Logical low state.
+ * @brief Logical low state.
*/
#define PAL_LOW 0
@@ -95,6 +97,41 @@
*/
#define PAL_HIGH 1
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
+#include "pal_lld.h"
+
+/**
+ * @brief I/O bus descriptor.
+ * @details This structure describes a group of contiguous digital I/O lines
+ * that have to be handled as bus.
+ * @note I/O operations on a bus do not affect I/O lines on the same port but
+ * not belonging to the bus.
+ */
+typedef struct {
+ /** Port identifier.*/
+ ioportid_t bus_portid;
+ /** Bus mask aligned to port bit 0. The bus mask implicitly define the bus
+ width. A logical AND is performed on the bus data.*/
+ ioportmask_t bus_mask;
+ /** Offset, within the port, of the least significant bit of the bus.*/
+ uint_fast8_t bus_offset;
+} IOBus;
+
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
/**
* @brief Port bit helper macro.
* @details This macro calculates the mask of a bit within a port.
@@ -139,23 +176,6 @@
IOBus name = _IOBUS_DATA(name, port, width, offset)
/**
- * @brief I/O bus descriptor.
- * @details This structure describes a group of contiguous digital I/O lines
- * that have to be handled as bus.
- * @note I/O operations on a bus do not affect I/O lines on the same port but
- * not belonging to the bus.
- */
-typedef struct {
- /** Port identifier.*/
- ioportid_t bus_portid;
- /** Bus mask aligned to port bit 0. The bus mask implicitly define the bus
- width. A logical AND is performed on the bus data.*/
- ioportmask_t bus_mask;
- /** Offset, within the port, of the least significant bit of the bus.*/
- uint_fast8_t bus_offset;
-} IOBus;
-
-/**
* @brief PAL subsystem initialization.
*
* @param[in] config pointer to an architecture specific configuration
@@ -452,6 +472,10 @@ typedef struct {
#define palSetPadMode(port, pad, mode) pal_lld_setpadmode(port, pad, mode)
#endif
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h
index 9cb6ce4c4..64b563164 100644
--- a/os/hal/include/pwm.h
+++ b/os/hal/include/pwm.h
@@ -29,6 +29,22 @@
#if CH_HAL_USE_PWM || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
/**
* @brief Driver state machine possible states.
*/
@@ -57,6 +73,14 @@ typedef void (*pwmcallback_t)(void);
#include "pwm_lld.h"
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/include/serial.h b/os/hal/include/serial.h
index 3623fa7e5..6f80985ab 100644
--- a/os/hal/include/serial.h
+++ b/os/hal/include/serial.h
@@ -29,6 +29,10 @@
#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
/** No pending conditions.*/
#define SD_NO_ERROR 0
/** Connection happened.*/
@@ -44,6 +48,18 @@
/** Break detected.*/
#define SD_BREAK_DETECTED 32
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
/**
* @brief Structure representing a serial driver.
*/
@@ -101,23 +117,12 @@ struct _SerialDriver {
struct _serial_driver_data d2;
};
-#ifdef __cplusplus
-extern "C" {
-#endif
- void sdInit(void);
- void sdObjectInit(SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify);
- void sdStart(SerialDriver *sdp, const SerialDriverConfig *config);
- void sdStop(SerialDriver *sdp);
- void sdIncomingDataI(SerialDriver *sdp, uint8_t b);
- msg_t sdRequestDataI(SerialDriver *sdp);
- void sdAddFlagsI(SerialDriver *sdp, sdflags_t mask);
- sdflags_t sdGetAndClearFlags(SerialDriver *sdp);
-#ifdef __cplusplus
-}
-#endif
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
/**
- * @brief Direct output check on a @p SerialDriver.
+ * @brief Direct output check on a @p SerialDriver.
* @details This function bypasses the indirect access to the channel and
* checks directly the output queue. This is faster but cannot
* be used to check different channels implementations.
@@ -190,6 +195,25 @@ extern "C" {
*/
#define sdRead(sdp, b, n) chIQRead(&(sdp)->d2.iqueue, b, n)
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void sdInit(void);
+ void sdObjectInit(SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify);
+ void sdStart(SerialDriver *sdp, const SerialDriverConfig *config);
+ void sdStop(SerialDriver *sdp);
+ void sdIncomingDataI(SerialDriver *sdp, uint8_t b);
+ msg_t sdRequestDataI(SerialDriver *sdp);
+ void sdAddFlagsI(SerialDriver *sdp, sdflags_t mask);
+ sdflags_t sdGetAndClearFlags(SerialDriver *sdp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CH_HAL_USE_SERIAL */
#endif /* _SERIAL_H_ */
diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h
index 5d1355106..6e1df95bd 100644
--- a/os/hal/include/spi.h
+++ b/os/hal/include/spi.h
@@ -29,6 +29,14 @@
#if CH_HAL_USE_SPI || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
/**
* @brief Enables the mutual exclusion APIs on the SPI bus.
*/
@@ -36,10 +44,18 @@
#define SPI_USE_MUTUAL_EXCLUSION TRUE
#endif
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
#if SPI_USE_MUTUAL_EXCLUSION && !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
#error "SPI_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
#endif
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
/**
* @brief Driver state machine possible states.
*/
@@ -52,6 +68,14 @@ typedef enum {
#include "spi_lld.h"
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/platforms/STM32/spi_lld.h b/os/hal/platforms/STM32/spi_lld.h
index 72349d7ea..06fe3f67d 100644
--- a/os/hal/platforms/STM32/spi_lld.h
+++ b/os/hal/platforms/STM32/spi_lld.h
@@ -38,13 +38,6 @@
/*===========================================================================*/
/**
- * @brief Enables the mutual exclusion APIs on the SPI bus.
- */
-#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
-#define SPI_USE_MUTUAL_EXCLUSION TRUE
-#endif
-
-/**
* @brief SPI1 driver enable switch.
* @details If set to @p TRUE the support for SPI1 is included.
* @note The default is @p TRUE.
@@ -120,10 +113,6 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if SPI_USE_MUTUAL_EXCLUSION && !CH_USE_MUTEXES && !CH_USE_SEMAPHORES
-#error "SPI_USE_MUTUAL_EXCLUSION requires CH_USE_MUTEXES and/or CH_USE_SEMAPHORES"
-#endif
-
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
diff --git a/os/hal/src/adc.c b/os/hal/src/adc.c
index afa464212..16bdeac43 100644
--- a/os/hal/src/adc.c
+++ b/os/hal/src/adc.c
@@ -29,6 +29,22 @@
#if CH_HAL_USE_ADC || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief ADC Driver initialization.
*/
diff --git a/os/hal/src/can.c b/os/hal/src/can.c
index e48095bc0..e70c25617 100644
--- a/os/hal/src/can.c
+++ b/os/hal/src/can.c
@@ -29,6 +29,22 @@
#if CH_HAL_USE_CAN || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief CAN Driver initialization.
*/
diff --git a/os/hal/src/hal.c b/os/hal/src/hal.c
index 0f5bb9148..3631028e5 100644
--- a/os/hal/src/hal.c
+++ b/os/hal/src/hal.c
@@ -27,6 +27,22 @@
#include "ch.h"
#include "hal.h"
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief HAL initialization.
*/
diff --git a/os/hal/src/mac.c b/os/hal/src/mac.c
index a18d3e4df..6d31c7b9e 100644
--- a/os/hal/src/mac.c
+++ b/os/hal/src/mac.c
@@ -29,6 +29,26 @@
#if CH_HAL_USE_MAC || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver interrupt handlers. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief MAC Driver initialization.
*/
diff --git a/os/hal/src/mmc_spi.c b/os/hal/src/mmc_spi.c
index 24abf2a2b..f9f8eef5a 100644
--- a/os/hal/src/mmc_spi.c
+++ b/os/hal/src/mmc_spi.c
@@ -30,6 +30,14 @@
#if CH_HAL_USE_MMC_SPI || defined(__DOXYGEN__)
/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
diff --git a/os/hal/src/pal.c b/os/hal/src/pal.c
index a0f91b8d2..a04f4ed96 100644
--- a/os/hal/src/pal.c
+++ b/os/hal/src/pal.c
@@ -29,6 +29,22 @@
#if CH_HAL_USE_PAL || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief Read from an I/O bus.
*
diff --git a/os/hal/src/pwm.c b/os/hal/src/pwm.c
index f6164ea35..404f3d8a7 100644
--- a/os/hal/src/pwm.c
+++ b/os/hal/src/pwm.c
@@ -29,6 +29,22 @@
#if CH_HAL_USE_PWM || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief PWM Driver initialization.
*/
diff --git a/os/hal/src/serial.c b/os/hal/src/serial.c
index d2cb17c77..5df69d1a0 100644
--- a/os/hal/src/serial.c
+++ b/os/hal/src/serial.c
@@ -29,6 +29,18 @@
#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
/*
* Interface implementation, the following functions just invoke the equivalent
* queue-level function or macro.
@@ -69,6 +81,10 @@ static const struct SerialDriverVMT vmt = {
{}
};
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief Serial Driver initialization.
*/
diff --git a/os/hal/src/spi.c b/os/hal/src/spi.c
index 08113a000..36bde9a3a 100644
--- a/os/hal/src/spi.c
+++ b/os/hal/src/spi.c
@@ -29,6 +29,22 @@
#if CH_HAL_USE_SPI || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief SPI Driver initialization.
*/
@@ -255,7 +271,7 @@ void spiReleaseBus(SPIDriver *spip) {
chSemSignal(&spip->spd_semaphore);
#endif
}
-#endif /*SPI_USE_MUTUAL_EXCLUSION */
+#endif /* SPI_USE_MUTUAL_EXCLUSION */
#endif /* CH_HAL_USE_SPI */
diff --git a/os/hal/templates/adc_lld.c b/os/hal/templates/adc_lld.c
index 26c7f8945..3e6740c12 100644
--- a/os/hal/templates/adc_lld.c
+++ b/os/hal/templates/adc_lld.c
@@ -30,23 +30,23 @@
#if CH_HAL_USE_ADC || defined(__DOXYGEN__)
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/templates/adc_lld.h b/os/hal/templates/adc_lld.h
index 701ac14cd..2a9eca699 100644
--- a/os/hal/templates/adc_lld.h
+++ b/os/hal/templates/adc_lld.h
@@ -127,6 +127,10 @@ typedef struct {
} ADCDriver;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/templates/can_lld.c b/os/hal/templates/can_lld.c
index 8fd0cbc94..f1945c350 100644
--- a/os/hal/templates/can_lld.c
+++ b/os/hal/templates/can_lld.c
@@ -30,23 +30,23 @@
#if CH_HAL_USE_CAN || defined(__DOXYGEN__)
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/templates/can_lld.h b/os/hal/templates/can_lld.h
index b70c839be..c6f0de0cb 100644
--- a/os/hal/templates/can_lld.h
+++ b/os/hal/templates/can_lld.h
@@ -195,6 +195,10 @@ typedef struct {
} CANDriver;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/templates/hal_lld.c b/os/hal/templates/hal_lld.c
index f4ce6d740..75e58d988 100644
--- a/os/hal/templates/hal_lld.c
+++ b/os/hal/templates/hal_lld.c
@@ -28,23 +28,23 @@
#include "hal.h"
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/templates/hal_lld.h b/os/hal/templates/hal_lld.h
index 35e02490b..ee23d19df 100644
--- a/os/hal/templates/hal_lld.h
+++ b/os/hal/templates/hal_lld.h
@@ -44,6 +44,10 @@
/*===========================================================================*/
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/templates/mac_lld.c b/os/hal/templates/mac_lld.c
index 29d869a63..d65365fd5 100644
--- a/os/hal/templates/mac_lld.c
+++ b/os/hal/templates/mac_lld.c
@@ -29,6 +29,26 @@
#if CH_HAL_USE_MAC || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver interrupt handlers. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief Low level MAC initialization.
*/
diff --git a/os/hal/templates/mac_lld.h b/os/hal/templates/mac_lld.h
index 616b24512..74fde5f59 100644
--- a/os/hal/templates/mac_lld.h
+++ b/os/hal/templates/mac_lld.h
@@ -101,6 +101,10 @@ typedef struct {
} MACReceiveDescriptor;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/templates/meta/driver.c b/os/hal/templates/meta/driver.c
index 5618a6cb4..77b854bd8 100644
--- a/os/hal/templates/meta/driver.c
+++ b/os/hal/templates/meta/driver.c
@@ -29,6 +29,22 @@
#if CH_HAL_USE_XXX || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
/**
* @brief XXX Driver initialization.
*/
diff --git a/os/hal/templates/meta/driver.h b/os/hal/templates/meta/driver.h
index f9a1d52dd..7a54cfcb4 100644
--- a/os/hal/templates/meta/driver.h
+++ b/os/hal/templates/meta/driver.h
@@ -29,6 +29,22 @@
#if CH_HAL_USE_XXX || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
/**
* @brief Driver state machine possible states.
*/
@@ -40,6 +56,14 @@ typedef enum {
#include "xxx_lld.h"
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/hal/templates/meta/driver_lld.c b/os/hal/templates/meta/driver_lld.c
index 4cd5dc7c1..71f8911d0 100644
--- a/os/hal/templates/meta/driver_lld.c
+++ b/os/hal/templates/meta/driver_lld.c
@@ -30,23 +30,23 @@
#if CH_HAL_USE_XXX || defined(__DOXYGEN__)
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/templates/meta/driver_lld.h b/os/hal/templates/meta/driver_lld.h
index e066ce1a6..43824aa94 100644
--- a/os/hal/templates/meta/driver_lld.h
+++ b/os/hal/templates/meta/driver_lld.h
@@ -69,6 +69,10 @@ typedef struct {
} XXXDriver;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/templates/pal_lld.c b/os/hal/templates/pal_lld.c
index da94f8c3c..3a0747f8d 100644
--- a/os/hal/templates/pal_lld.c
+++ b/os/hal/templates/pal_lld.c
@@ -30,23 +30,23 @@
#if CH_HAL_USE_PAL || defined(__DOXYGEN__)
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
#endif /* CH_HAL_USE_PAL */
diff --git a/os/hal/templates/pwm_lld.c b/os/hal/templates/pwm_lld.c
index 2c1d26070..b132cf588 100644
--- a/os/hal/templates/pwm_lld.c
+++ b/os/hal/templates/pwm_lld.c
@@ -28,23 +28,23 @@
#include "hal.h"
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/templates/pwm_lld.h b/os/hal/templates/pwm_lld.h
index 0ee02824e..a07bed04f 100644
--- a/os/hal/templates/pwm_lld.h
+++ b/os/hal/templates/pwm_lld.h
@@ -84,6 +84,10 @@ typedef struct {
} PWMDriver;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/templates/serial_lld.c b/os/hal/templates/serial_lld.c
index bd1a416c6..63d1b09cf 100644
--- a/os/hal/templates/serial_lld.c
+++ b/os/hal/templates/serial_lld.c
@@ -29,28 +29,28 @@
#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
-/** @brief Driver default configuration.*/
-static const SerialDriverConfig default_config = {
-};
-
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
+/** @brief Driver default configuration.*/
+static const SerialDriverConfig default_config = {
+};
+
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/templates/serial_lld.h b/os/hal/templates/serial_lld.h
index 6457c240a..68d99c3e7 100644
--- a/os/hal/templates/serial_lld.h
+++ b/os/hal/templates/serial_lld.h
@@ -97,6 +97,10 @@ typedef struct {
} SerialDriverConfig;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/templates/spi_lld.c b/os/hal/templates/spi_lld.c
index f539a02f3..50f01b6de 100644
--- a/os/hal/templates/spi_lld.c
+++ b/os/hal/templates/spi_lld.c
@@ -30,23 +30,23 @@
#if CH_HAL_USE_SPI || defined(__DOXYGEN__)
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/templates/spi_lld.h b/os/hal/templates/spi_lld.h
index af992b554..34145ed70 100644
--- a/os/hal/templates/spi_lld.h
+++ b/os/hal/templates/spi_lld.h
@@ -78,6 +78,10 @@ typedef struct {
} SPIDriver;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/