From fe24da9fcca4967e58b25a2698c46717995de0ad Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 29 Dec 2009 11:12:05 +0000 Subject: Reorganized sections in HAL files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1473 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/adc.h | 24 ++++++++++++++ os/hal/include/can.h | 30 ++++++++++++++++-- os/hal/include/mac.h | 24 ++++++++++++++ os/hal/include/mmc_spi.h | 44 +++++++++++++++----------- os/hal/include/pal.h | 64 ++++++++++++++++++++++++++------------ os/hal/include/pwm.h | 24 ++++++++++++++ os/hal/include/serial.h | 54 +++++++++++++++++++++++--------- os/hal/include/spi.h | 24 ++++++++++++++ os/hal/platforms/STM32/spi_lld.h | 11 ------- os/hal/src/adc.c | 16 ++++++++++ os/hal/src/can.c | 16 ++++++++++ os/hal/src/hal.c | 16 ++++++++++ os/hal/src/mac.c | 20 ++++++++++++ os/hal/src/mmc_spi.c | 8 +++++ os/hal/src/pal.c | 16 ++++++++++ os/hal/src/pwm.c | 16 ++++++++++ os/hal/src/serial.c | 16 ++++++++++ os/hal/src/spi.c | 18 ++++++++++- os/hal/templates/adc_lld.c | 10 +++--- os/hal/templates/adc_lld.h | 4 +++ os/hal/templates/can_lld.c | 10 +++--- os/hal/templates/can_lld.h | 4 +++ os/hal/templates/hal_lld.c | 10 +++--- os/hal/templates/hal_lld.h | 4 +++ os/hal/templates/mac_lld.c | 20 ++++++++++++ os/hal/templates/mac_lld.h | 4 +++ os/hal/templates/meta/driver.c | 16 ++++++++++ os/hal/templates/meta/driver.h | 24 ++++++++++++++ os/hal/templates/meta/driver_lld.c | 10 +++--- os/hal/templates/meta/driver_lld.h | 4 +++ os/hal/templates/pal_lld.c | 10 +++--- os/hal/templates/pwm_lld.c | 10 +++--- os/hal/templates/pwm_lld.h | 4 +++ os/hal/templates/serial_lld.c | 18 +++++------ os/hal/templates/serial_lld.h | 4 +++ os/hal/templates/spi_lld.c | 10 +++--- os/hal/templates/spi_lld.h | 4 +++ 37 files changed, 509 insertions(+), 112 deletions(-) (limited to 'os') 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. @@ -138,23 +175,6 @@ #define IOBUS_DECL(name, port, width, offset) \ 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. * @@ -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 @@ -37,13 +37,6 @@ /* Driver pre-compile time settings. */ /*===========================================================================*/ -/** - * @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. @@ -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 @@ -29,6 +29,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 @@ -126,6 +126,10 @@ typedef struct { /* End of the mandatory fields.*/ } 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 @@ -194,6 +194,10 @@ typedef struct { /* End of the mandatory fields.*/ } 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 @@ -43,6 +43,10 @@ /* Driver data structures and types. */ /*===========================================================================*/ +/*===========================================================================*/ +/* 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 @@ -100,6 +100,10 @@ typedef struct { /* End of the mandatory fields.*/ } 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 @@ -68,6 +68,10 @@ typedef struct { /* End of the mandatory fields.*/ } 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 @@ -83,6 +83,10 @@ typedef struct { /* End of the mandatory fields.*/ } 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 @@ -96,6 +96,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 @@ -77,6 +77,10 @@ typedef struct { /* End of the mandatory fields.*/ } SPIDriver; +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ -- cgit v1.2.3