From d8be44136c1e6d02ee105ac0791f9e6732551fec Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 1 Nov 2010 17:29:56 +0000 Subject: [PATCH] Fixed bug 3100946, renamed HAL switches removing the CH_ part. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2326 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h | 280 ++++++++++++------ demos/ARM7-AT91SAM7S-GCC/halconf.h | 280 ++++++++++++------ demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h | 280 ++++++++++++------ demos/ARM7-AT91SAM7X-GCC/halconf.h | 280 ++++++++++++------ demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 280 ++++++++++++------ demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h | 280 ++++++++++++------ demos/ARM7-LPC214x-FATFS-GCC/halconf.h | 280 ++++++++++++------ demos/ARM7-LPC214x-G++/halconf.h | 280 ++++++++++++------ demos/ARM7-LPC214x-GCC/halconf.h | 280 ++++++++++++------ demos/ARMCM0-LPC1114-GCC/halconf.h | 280 ++++++++++++------ demos/ARMCM3-LPC1343-GCC/halconf.h | 280 ++++++++++++------ demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h | 280 ++++++++++++------ demos/ARMCM3-STM32F103-GCC/halconf.h | 238 ++++++++++----- demos/ARMCM3-STM32F107-GCC/halconf.h | 280 ++++++++++++------ demos/AVR-AT90CANx-GCC/halconf.h | 236 ++++++++++----- demos/AVR-ATmega128-GCC/halconf.h | 236 ++++++++++----- demos/MSP430-MSP430x1611-GCC/halconf.h | 280 ++++++++++++------ demos/PPC-SPC563-GCC/halconf.h | 280 ++++++++++++------ demos/Posix-GCC/halconf.h | 280 ++++++++++++------ .../cosmic/vectors.c | 6 +- .../demo/halconf.h | 280 ++++++++++++------ demos/STM8S-STM8S208-RC/halconf.h | 280 ++++++++++++------ demos/Win32-MinGW/halconf.h | 280 ++++++++++++------ os/hal/include/adc.h | 4 +- os/hal/include/can.h | 4 +- os/hal/include/i2c.h | 4 +- os/hal/include/mac.h | 4 +- os/hal/include/mmc_spi.h | 8 +- os/hal/include/pal.h | 4 +- os/hal/include/pwm.h | 4 +- os/hal/include/serial.h | 4 +- os/hal/include/spi.h | 4 +- os/hal/include/uart.h | 4 +- os/hal/platforms/AT91SAM7/at91sam7_mii.c | 4 +- os/hal/platforms/AT91SAM7/at91sam7_mii.h | 4 +- os/hal/platforms/AT91SAM7/mac_lld.c | 4 +- os/hal/platforms/AT91SAM7/mac_lld.h | 4 +- os/hal/platforms/AT91SAM7/pal_lld.c | 4 +- os/hal/platforms/AT91SAM7/pal_lld.h | 4 +- os/hal/platforms/AT91SAM7/serial_lld.c | 4 +- os/hal/platforms/AT91SAM7/serial_lld.h | 4 +- os/hal/platforms/AT91SAM7/spi_lld.c | 4 +- os/hal/platforms/AT91SAM7/spi_lld.h | 4 +- os/hal/platforms/AVR/serial_lld.c | 4 +- os/hal/platforms/AVR/serial_lld.h | 4 +- os/hal/platforms/LPC11xx/pal_lld.c | 4 +- os/hal/platforms/LPC11xx/pal_lld.h | 4 +- os/hal/platforms/LPC11xx/serial_lld.c | 4 +- os/hal/platforms/LPC11xx/serial_lld.h | 4 +- os/hal/platforms/LPC11xx/spi_lld.c | 4 +- os/hal/platforms/LPC11xx/spi_lld.h | 4 +- os/hal/platforms/LPC13xx/pal_lld.c | 4 +- os/hal/platforms/LPC13xx/pal_lld.h | 4 +- os/hal/platforms/LPC13xx/serial_lld.c | 4 +- os/hal/platforms/LPC13xx/serial_lld.h | 4 +- os/hal/platforms/LPC13xx/spi_lld.c | 4 +- os/hal/platforms/LPC13xx/spi_lld.h | 4 +- os/hal/platforms/LPC214x/pal_lld.c | 4 +- os/hal/platforms/LPC214x/pal_lld.h | 4 +- os/hal/platforms/LPC214x/serial_lld.c | 4 +- os/hal/platforms/LPC214x/serial_lld.h | 4 +- os/hal/platforms/LPC214x/spi_lld.c | 4 +- os/hal/platforms/LPC214x/spi_lld.h | 4 +- os/hal/platforms/MSP430/pal_lld.c | 4 +- os/hal/platforms/MSP430/pal_lld.h | 4 +- os/hal/platforms/MSP430/serial_lld.c | 4 +- os/hal/platforms/MSP430/serial_lld.h | 4 +- os/hal/platforms/Posix/hal_lld.c | 4 +- os/hal/platforms/Posix/pal_lld.c | 4 +- os/hal/platforms/Posix/pal_lld.h | 4 +- os/hal/platforms/Posix/serial_lld.c | 4 +- os/hal/platforms/Posix/serial_lld.h | 4 +- os/hal/platforms/SPC56x/serial_lld.c | 4 +- os/hal/platforms/SPC56x/serial_lld.h | 4 +- os/hal/platforms/STM32/adc_lld.c | 4 +- os/hal/platforms/STM32/adc_lld.h | 4 +- os/hal/platforms/STM32/can_lld.c | 4 +- os/hal/platforms/STM32/can_lld.h | 4 +- os/hal/platforms/STM32/hal_lld.c | 2 +- os/hal/platforms/STM32/pal_lld.c | 4 +- os/hal/platforms/STM32/pal_lld.h | 4 +- os/hal/platforms/STM32/pwm_lld.c | 4 +- os/hal/platforms/STM32/pwm_lld.h | 4 +- os/hal/platforms/STM32/serial_lld.c | 4 +- os/hal/platforms/STM32/serial_lld.h | 4 +- os/hal/platforms/STM32/spi_lld.c | 4 +- os/hal/platforms/STM32/spi_lld.h | 4 +- os/hal/platforms/STM32/uart_lld.c | 4 +- os/hal/platforms/STM32/uart_lld.h | 8 +- os/hal/platforms/STM8/pal_lld.c | 4 +- os/hal/platforms/STM8/pal_lld.h | 4 +- os/hal/platforms/STM8/serial_lld.c | 4 +- os/hal/platforms/STM8/serial_lld.h | 4 +- os/hal/platforms/STM8/spi_lld.c | 4 +- os/hal/platforms/STM8/spi_lld.h | 4 +- os/hal/platforms/Win32/hal_lld.c | 4 +- os/hal/platforms/Win32/pal_lld.c | 4 +- os/hal/platforms/Win32/pal_lld.h | 4 +- os/hal/platforms/Win32/serial_lld.c | 4 +- os/hal/platforms/Win32/serial_lld.h | 4 +- os/hal/src/adc.c | 4 +- os/hal/src/can.c | 4 +- os/hal/src/hal.c | 20 +- os/hal/src/i2c.c | 4 +- os/hal/src/mac.c | 4 +- os/hal/src/mmc_spi.c | 4 +- os/hal/src/pal.c | 4 +- os/hal/src/pwm.c | 4 +- os/hal/src/serial.c | 4 +- os/hal/src/spi.c | 4 +- os/hal/src/uart.c | 4 +- os/hal/templates/adc_lld.c | 4 +- os/hal/templates/adc_lld.h | 4 +- os/hal/templates/can_lld.c | 4 +- os/hal/templates/can_lld.h | 4 +- os/hal/templates/halconf.h | 40 +-- os/hal/templates/i2c_lld.c | 4 +- os/hal/templates/i2c_lld.h | 4 +- os/hal/templates/mac_lld.c | 4 +- os/hal/templates/mac_lld.h | 4 +- os/hal/templates/meta/driver.c | 4 +- os/hal/templates/meta/driver.h | 4 +- os/hal/templates/meta/driver_lld.c | 4 +- os/hal/templates/meta/driver_lld.h | 4 +- os/hal/templates/pal_lld.c | 4 +- os/hal/templates/pal_lld.h | 4 +- os/hal/templates/pwm_lld.c | 4 + os/hal/templates/pwm_lld.h | 4 + os/hal/templates/serial_lld.c | 4 +- os/hal/templates/serial_lld.h | 4 +- os/hal/templates/spi_lld.c | 4 +- os/hal/templates/spi_lld.h | 4 +- os/hal/templates/uart_lld.c | 4 +- os/hal/templates/uart_lld.h | 8 +- readme.txt | 7 +- test/coverage/halconf.h | 280 ++++++++++++------ testhal/STM32/ADC/halconf.h | 280 ++++++++++++------ testhal/STM32/CAN/halconf.h | 280 ++++++++++++------ testhal/STM32/PWM/halconf.h | 280 ++++++++++++------ testhal/STM32/SPI/halconf.h | 280 ++++++++++++------ testhal/STM32/UART/halconf.h | 280 ++++++++++++------ testhal/STM8/SPI/cosmic/vectors.c | 6 +- testhal/STM8/SPI/demo/halconf.h | 280 ++++++++++++------ 143 files changed, 5583 insertions(+), 2932 deletions(-) diff --git a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h index c65522e3a..bc6c3b8d2 100644 --- a/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-FATFS-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI TRUE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI TRUE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARM7-AT91SAM7S-GCC/halconf.h b/demos/ARM7-AT91SAM7S-GCC/halconf.h index 87d0f835d..3186be527 100644 --- a/demos/ARM7-AT91SAM7S-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7S-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h index c65522e3a..bc6c3b8d2 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI TRUE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI TRUE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARM7-AT91SAM7X-GCC/halconf.h b/demos/ARM7-AT91SAM7X-GCC/halconf.h index 87d0f835d..3186be527 100644 --- a/demos/ARM7-AT91SAM7X-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index 0fdc6cf1c..3ccb9a219 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC TRUE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC TRUE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h index 0fdc6cf1c..3ccb9a219 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC TRUE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC TRUE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h index c65522e3a..bc6c3b8d2 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/halconf.h +++ b/demos/ARM7-LPC214x-FATFS-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI TRUE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI TRUE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h index 87d0f835d..3186be527 100644 --- a/demos/ARM7-LPC214x-G++/halconf.h +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h index 87d0f835d..3186be527 100644 --- a/demos/ARM7-LPC214x-GCC/halconf.h +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARMCM0-LPC1114-GCC/halconf.h b/demos/ARMCM0-LPC1114-GCC/halconf.h index 2c3afda84..9ed9ce905 100644 --- a/demos/ARMCM0-LPC1114-GCC/halconf.h +++ b/demos/ARMCM0-LPC1114-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARMCM3-LPC1343-GCC/halconf.h b/demos/ARMCM3-LPC1343-GCC/halconf.h index 2c3afda84..9ed9ce905 100644 --- a/demos/ARMCM3-LPC1343-GCC/halconf.h +++ b/demos/ARMCM3-LPC1343-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h index c65522e3a..bc6c3b8d2 100644 --- a/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-FATFS-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI TRUE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI TRUE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARMCM3-STM32F103-GCC/halconf.h b/demos/ARMCM3-STM32F103-GCC/halconf.h index a9d7369b9..3186be527 100644 --- a/demos/ARMCM3-STM32F103-GCC/halconf.h +++ b/demos/ARMCM3-STM32F103-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,10 +112,19 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ @@ -67,97 +132,132 @@ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + /** - * @brief Enables the MAC subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + /*===========================================================================*/ /* PWM driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the SERIAL subsystem. + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 #endif -/* - * Default SERIAL settings overrides (uncomment to override). +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif /*===========================================================================*/ /* SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the SPI subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE #endif -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - /** - * @brief Enables the MMC_SPI subsystem. + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). - */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ - /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/ARMCM3-STM32F107-GCC/halconf.h b/demos/ARMCM3-STM32F107-GCC/halconf.h index 87d0f835d..3186be527 100644 --- a/demos/ARMCM3-STM32F107-GCC/halconf.h +++ b/demos/ARMCM3-STM32F107-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index de9c05fdf..2eea483f4 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL FALSE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL FALSE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,10 +112,19 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ @@ -67,97 +132,132 @@ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + /** - * @brief Enables the MAC subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + /*===========================================================================*/ /* PWM driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the SERIAL subsystem. + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 #endif -/* - * Default SERIAL settings overrides (uncomment to override). +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) #define SERIAL_BUFFERS_SIZE 16 +#endif /*===========================================================================*/ /* SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the SPI subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE #endif -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - /** - * @brief Enables the MMC_SPI subsystem. + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). - */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ - /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index de9c05fdf..2eea483f4 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL FALSE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL FALSE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,10 +112,19 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ @@ -67,97 +132,132 @@ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + /** - * @brief Enables the MAC subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + /*===========================================================================*/ /* PWM driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the SERIAL subsystem. + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 #endif -/* - * Default SERIAL settings overrides (uncomment to override). +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) #define SERIAL_BUFFERS_SIZE 16 +#endif /*===========================================================================*/ /* SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the SPI subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE #endif -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - /** - * @brief Enables the MMC_SPI subsystem. + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). - */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ - /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/MSP430-MSP430x1611-GCC/halconf.h b/demos/MSP430-MSP430x1611-GCC/halconf.h index 87d0f835d..3186be527 100644 --- a/demos/MSP430-MSP430x1611-GCC/halconf.h +++ b/demos/MSP430-MSP430x1611-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/PPC-SPC563-GCC/halconf.h b/demos/PPC-SPC563-GCC/halconf.h index 6e16e85a6..64a634d85 100644 --- a/demos/PPC-SPC563-GCC/halconf.h +++ b/demos/PPC-SPC563-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ /*#include "mcuconf.h"*/ -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL FALSE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL FALSE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/Posix-GCC/halconf.h b/demos/Posix-GCC/halconf.h index 6976d598e..acc98744c 100644 --- a/demos/Posix-GCC/halconf.h +++ b/demos/Posix-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ /*#include "mcuconf.h"*/ -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c b/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c index e9a5ad450..76ebd1736 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/cosmic/vectors.c @@ -69,7 +69,7 @@ exception_vector_t const _vectab[] = { {0x82, vector}, /* vector7 */ {0x82, vector}, /* vector8 */ {0x82, vector}, /* vector9 */ -#if CH_HAL_USE_SPI && STM8_SPI_USE_SPI +#if HAL_USE_SPI && STM8_SPI_USE_SPI {0x82, vector10}, #else {0x82, vector}, /* vector10 */ @@ -80,7 +80,7 @@ exception_vector_t const _vectab[] = { {0x82, vector}, /* vector14 */ {0x82, vector}, /* vector15 */ {0x82, vector}, /* vector16 */ -#if CH_HAL_USE_SERIAL && STM8_SERIAL_USE_UART1 +#if HAL_USE_SERIAL && STM8_SERIAL_USE_UART1 {0x82, vector17}, /* vector17 */ {0x82, vector18}, /* vector18 */ #else @@ -88,7 +88,7 @@ exception_vector_t const _vectab[] = { {0x82, vector}, /* vector18 */ #endif {0x82, vector}, /* vector19 */ -#if CH_HAL_USE_SERIAL && (STM8_SERIAL_USE_UART2 || STM8_SERIAL_USE_UART3) +#if HAL_USE_SERIAL && (STM8_SERIAL_USE_UART2 || STM8_SERIAL_USE_UART3) {0x82, vector20}, /* vector20 */ {0x82, vector21}, /* vector21 */ #else diff --git a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h index b0b87601a..3186be527 100644 --- a/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8S-STM8S105-DISCOVERY-STVD/demo/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -#define SERIAL_BUFFERS_SIZE 16 - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/STM8S-STM8S208-RC/halconf.h b/demos/STM8S-STM8S208-RC/halconf.h index 87d0f835d..3186be527 100644 --- a/demos/STM8S-STM8S208-RC/halconf.h +++ b/demos/STM8S-STM8S208-RC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/demos/Win32-MinGW/halconf.h b/demos/Win32-MinGW/halconf.h index 6976d598e..acc98744c 100644 --- a/demos/Win32-MinGW/halconf.h +++ b/demos/Win32-MinGW/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ /*#include "mcuconf.h"*/ -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h index 3a4a08de0..df019fd27 100644 --- a/os/hal/include/adc.h +++ b/os/hal/include/adc.h @@ -28,7 +28,7 @@ #ifndef _ADC_H_ #define _ADC_H_ -#if CH_HAL_USE_ADC || defined(__DOXYGEN__) +#if HAL_USE_ADC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -250,7 +250,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_ADC */ +#endif /* HAL_USE_ADC */ #endif /* _ADC_H_ */ diff --git a/os/hal/include/can.h b/os/hal/include/can.h index bf0caabed..dc258193a 100644 --- a/os/hal/include/can.h +++ b/os/hal/include/can.h @@ -28,7 +28,7 @@ #ifndef _CAN_H_ #define _CAN_H_ -#if CH_HAL_USE_CAN || defined(__DOXYGEN__) +#if HAL_USE_CAN || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -127,7 +127,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_CAN */ +#endif /* HAL_USE_CAN */ #endif /* _CAN_H_ */ diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h index ef8e93f40..b95aa6bf9 100644 --- a/os/hal/include/i2c.h +++ b/os/hal/include/i2c.h @@ -28,7 +28,7 @@ #ifndef _I2C_H_ #define _I2C_H_ -#if CH_HAL_USE_I2C || defined(__DOXYGEN__) +#if HAL_USE_I2C || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -137,7 +137,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_I2C */ +#endif /* HAL_USE_I2C */ #endif /* _I2C_H_ */ diff --git a/os/hal/include/mac.h b/os/hal/include/mac.h index ce6ca0add..8978f007e 100644 --- a/os/hal/include/mac.h +++ b/os/hal/include/mac.h @@ -27,7 +27,7 @@ #ifndef _MAC_H_ #define _MAC_H_ -#if CH_HAL_USE_MAC || defined(__DOXYGEN__) +#if HAL_USE_MAC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -121,7 +121,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_MAC */ +#endif /* HAL_USE_MAC */ #endif /* _MAC_H_ */ diff --git a/os/hal/include/mmc_spi.h b/os/hal/include/mmc_spi.h index 582ed1653..f413e3c15 100644 --- a/os/hal/include/mmc_spi.h +++ b/os/hal/include/mmc_spi.h @@ -28,7 +28,7 @@ #ifndef _MMC_SPI_H_ #define _MMC_SPI_H_ -#if CH_HAL_USE_MMC_SPI || defined(__DOXYGEN__) +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -90,8 +90,8 @@ /* Derived constants and error checks. */ /*===========================================================================*/ -#if !CH_HAL_USE_SPI || !CH_USE_EVENTS -#error "MMC_SPI driver requires CH_HAL_USE_SPI and CH_USE_EVENTS" +#if !HAL_USE_SPI || !CH_USE_EVENTS +#error "MMC_SPI driver requires HAL_USE_SPI and CH_USE_EVENTS" #endif /*===========================================================================*/ @@ -226,7 +226,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_MMC_SPI */ +#endif /* HAL_USE_MMC_SPI */ #endif /* _MMC_SPI_H_ */ diff --git a/os/hal/include/pal.h b/os/hal/include/pal.h index 8e66eb522..211a2538f 100644 --- a/os/hal/include/pal.h +++ b/os/hal/include/pal.h @@ -28,7 +28,7 @@ #ifndef _PAL_H_ #define _PAL_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -525,6 +525,6 @@ extern "C" { #endif /* _PAL_H_ */ -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h index d37e449aa..867cc1de6 100644 --- a/os/hal/include/pwm.h +++ b/os/hal/include/pwm.h @@ -28,7 +28,7 @@ #ifndef _PWM_H_ #define _PWM_H_ -#if CH_HAL_USE_PWM || defined(__DOXYGEN__) +#if HAL_USE_PWM || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -119,7 +119,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PWM */ +#endif /* HAL_USE_PWM */ #endif /* _PWM_H_ */ diff --git a/os/hal/include/serial.h b/os/hal/include/serial.h index d14a47805..2ad454e86 100644 --- a/os/hal/include/serial.h +++ b/os/hal/include/serial.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_H_ #define _SERIAL_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -317,7 +317,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_H_ */ diff --git a/os/hal/include/spi.h b/os/hal/include/spi.h index d7a5c6ecd..93aba4980 100644 --- a/os/hal/include/spi.h +++ b/os/hal/include/spi.h @@ -28,7 +28,7 @@ #ifndef _SPI_H_ #define _SPI_H_ -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -301,7 +301,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ #endif /* _SPI_H_ */ diff --git a/os/hal/include/uart.h b/os/hal/include/uart.h index 7d707d4d0..2ea69309f 100644 --- a/os/hal/include/uart.h +++ b/os/hal/include/uart.h @@ -28,7 +28,7 @@ #ifndef _UART_H_ #define _UART_H_ -#if CH_HAL_USE_UART || defined(__DOXYGEN__) +#if HAL_USE_UART || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -115,7 +115,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_UART */ +#endif /* HAL_USE_UART */ #endif /* _UART_H_ */ diff --git a/os/hal/platforms/AT91SAM7/at91sam7_mii.c b/os/hal/platforms/AT91SAM7/at91sam7_mii.c index 2f1665847..54f1b8d57 100644 --- a/os/hal/platforms/AT91SAM7/at91sam7_mii.c +++ b/os/hal/platforms/AT91SAM7/at91sam7_mii.c @@ -29,7 +29,7 @@ #include "hal.h" #include "at91sam7_mii.h" -#if CH_HAL_USE_MAC || defined(__DOXYGEN__) +#if HAL_USE_MAC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -142,6 +142,6 @@ void miiPut(MACDriver *macp, phyaddr_t addr, phyreg_t value) { ; } -#endif /* CH_HAL_USE_MAC */ +#endif /* HAL_USE_MAC */ /** @} */ diff --git a/os/hal/platforms/AT91SAM7/at91sam7_mii.h b/os/hal/platforms/AT91SAM7/at91sam7_mii.h index a02ca90c9..c417a0d15 100644 --- a/os/hal/platforms/AT91SAM7/at91sam7_mii.h +++ b/os/hal/platforms/AT91SAM7/at91sam7_mii.h @@ -28,7 +28,7 @@ #ifndef _AT91SAM7_MII_H_ #define _AT91SAM7_MII_H_ -#if CH_HAL_USE_MAC || defined(__DOXYGEN__) +#if HAL_USE_MAC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -107,7 +107,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_MAC */ +#endif /* HAL_USE_MAC */ #endif /* _AT91SAM7_MII_H_ */ diff --git a/os/hal/platforms/AT91SAM7/mac_lld.c b/os/hal/platforms/AT91SAM7/mac_lld.c index 089554c6c..ee71b2e23 100644 --- a/os/hal/platforms/AT91SAM7/mac_lld.c +++ b/os/hal/platforms/AT91SAM7/mac_lld.c @@ -32,7 +32,7 @@ #include "mii.h" #include "at91sam7_mii.h" -#if CH_HAL_USE_MAC || defined(__DOXYGEN__) +#if HAL_USE_MAC || defined(__DOXYGEN__) #define EMAC_PIN_MASK (AT91C_PB0_ETXCK_EREFCK | AT91C_PB1_ETXEN | \ AT91C_PB2_ETX0 | AT91C_PB3_ETX1 | \ @@ -527,6 +527,6 @@ bool_t mac_lld_poll_link_status(MACDriver *macp) { return link_up = TRUE; } -#endif /* CH_HAL_USE_MAC */ +#endif /* HAL_USE_MAC */ /** @} */ diff --git a/os/hal/platforms/AT91SAM7/mac_lld.h b/os/hal/platforms/AT91SAM7/mac_lld.h index 1535b06f4..21503dd53 100644 --- a/os/hal/platforms/AT91SAM7/mac_lld.h +++ b/os/hal/platforms/AT91SAM7/mac_lld.h @@ -28,7 +28,7 @@ #ifndef _MAC_LLD_H_ #define _MAC_LLD_H_ -#if CH_HAL_USE_MAC || defined(__DOXYGEN__) +#if HAL_USE_MAC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -194,7 +194,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_MAC */ +#endif /* HAL_USE_MAC */ #endif /* _MAC_LLD_H_ */ diff --git a/os/hal/platforms/AT91SAM7/pal_lld.c b/os/hal/platforms/AT91SAM7/pal_lld.c index ffbe05578..4b43cd8d6 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.c +++ b/os/hal/platforms/AT91SAM7/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -148,6 +148,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/AT91SAM7/pal_lld.h b/os/hal/platforms/AT91SAM7/pal_lld.h index 1fe386068..afcc7c238 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.h +++ b/os/hal/platforms/AT91SAM7/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -247,7 +247,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/platforms/AT91SAM7/serial_lld.c b/os/hal/platforms/AT91SAM7/serial_lld.c index 72207a249..fa3b15226 100644 --- a/os/hal/platforms/AT91SAM7/serial_lld.c +++ b/os/hal/platforms/AT91SAM7/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) #if SAM7_PLATFORM == SAM7S256 @@ -370,6 +370,6 @@ void sd_lld_stop(SerialDriver *sdp) { } } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/AT91SAM7/serial_lld.h b/os/hal/platforms/AT91SAM7/serial_lld.h index 0b9b1973e..027cf90cd 100644 --- a/os/hal/platforms/AT91SAM7/serial_lld.h +++ b/os/hal/platforms/AT91SAM7/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -171,7 +171,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/AT91SAM7/spi_lld.c b/os/hal/platforms/AT91SAM7/spi_lld.c index 2cd552ebf..316ff65c9 100644 --- a/os/hal/platforms/AT91SAM7/spi_lld.c +++ b/os/hal/platforms/AT91SAM7/spi_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -395,6 +395,6 @@ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { return spip->spd_spi->SPI_RDR; } -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ /** @} */ diff --git a/os/hal/platforms/AT91SAM7/spi_lld.h b/os/hal/platforms/AT91SAM7/spi_lld.h index 2b5ec2acb..6243e66fa 100644 --- a/os/hal/platforms/AT91SAM7/spi_lld.h +++ b/os/hal/platforms/AT91SAM7/spi_lld.h @@ -28,7 +28,7 @@ #ifndef _SPI_LLD_H_ #define _SPI_LLD_H_ -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Device compatibility.. */ @@ -218,7 +218,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ #endif /* _SPI_LLD_H_ */ diff --git a/os/hal/platforms/AVR/serial_lld.c b/os/hal/platforms/AVR/serial_lld.c index 8fc091bed..3e32f3105 100644 --- a/os/hal/platforms/AVR/serial_lld.c +++ b/os/hal/platforms/AVR/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -303,6 +303,6 @@ void sd_lld_stop(SerialDriver *sdp) { #endif } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/AVR/serial_lld.h b/os/hal/platforms/AVR/serial_lld.h index 0c558ab34..15d3352b1 100644 --- a/os/hal/platforms/AVR/serial_lld.h +++ b/os/hal/platforms/AVR/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -137,7 +137,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/LPC11xx/pal_lld.c b/os/hal/platforms/LPC11xx/pal_lld.c index f48ae8529..c8d831a82 100644 --- a/os/hal/platforms/LPC11xx/pal_lld.c +++ b/os/hal/platforms/LPC11xx/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -101,6 +101,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/LPC11xx/pal_lld.h b/os/hal/platforms/LPC11xx/pal_lld.h index 83605cb65..4201f5114 100644 --- a/os/hal/platforms/LPC11xx/pal_lld.h +++ b/os/hal/platforms/LPC11xx/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -326,7 +326,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/platforms/LPC11xx/serial_lld.c b/os/hal/platforms/LPC11xx/serial_lld.c index 563c5bcf7..b39eff70e 100644 --- a/os/hal/platforms/LPC11xx/serial_lld.c +++ b/os/hal/platforms/LPC11xx/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -295,6 +295,6 @@ void sd_lld_stop(SerialDriver *sdp) { } } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/LPC11xx/serial_lld.h b/os/hal/platforms/LPC11xx/serial_lld.h index aae1e423c..37c2afbb7 100644 --- a/os/hal/platforms/LPC11xx/serial_lld.h +++ b/os/hal/platforms/LPC11xx/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -211,7 +211,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/LPC11xx/spi_lld.c b/os/hal/platforms/LPC11xx/spi_lld.c index 8b0081b5e..8c826cf9e 100644 --- a/os/hal/platforms/LPC11xx/spi_lld.c +++ b/os/hal/platforms/LPC11xx/spi_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -390,6 +390,6 @@ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { return (uint16_t)spip->spd_ssp->DR; } -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ /** @} */ diff --git a/os/hal/platforms/LPC11xx/spi_lld.h b/os/hal/platforms/LPC11xx/spi_lld.h index b3f38056f..c7af31697 100644 --- a/os/hal/platforms/LPC11xx/spi_lld.h +++ b/os/hal/platforms/LPC11xx/spi_lld.h @@ -28,7 +28,7 @@ #ifndef _SPI_LLD_H_ #define _SPI_LLD_H_ -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -339,7 +339,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ #endif /* _SPI_LLD_H_ */ diff --git a/os/hal/platforms/LPC13xx/pal_lld.c b/os/hal/platforms/LPC13xx/pal_lld.c index 9a0a7fa91..f80faaa24 100644 --- a/os/hal/platforms/LPC13xx/pal_lld.c +++ b/os/hal/platforms/LPC13xx/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -101,6 +101,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/LPC13xx/pal_lld.h b/os/hal/platforms/LPC13xx/pal_lld.h index eec4a5596..2c5a1d118 100644 --- a/os/hal/platforms/LPC13xx/pal_lld.h +++ b/os/hal/platforms/LPC13xx/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -326,7 +326,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/platforms/LPC13xx/serial_lld.c b/os/hal/platforms/LPC13xx/serial_lld.c index 2284a1646..ab62d746b 100644 --- a/os/hal/platforms/LPC13xx/serial_lld.c +++ b/os/hal/platforms/LPC13xx/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -295,6 +295,6 @@ void sd_lld_stop(SerialDriver *sdp) { } } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/LPC13xx/serial_lld.h b/os/hal/platforms/LPC13xx/serial_lld.h index 04eedb3e2..7a7f88c54 100644 --- a/os/hal/platforms/LPC13xx/serial_lld.h +++ b/os/hal/platforms/LPC13xx/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -211,7 +211,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/LPC13xx/spi_lld.c b/os/hal/platforms/LPC13xx/spi_lld.c index ee6a71c8f..d7dd8f17f 100644 --- a/os/hal/platforms/LPC13xx/spi_lld.c +++ b/os/hal/platforms/LPC13xx/spi_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -344,6 +344,6 @@ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { return (uint16_t)spip->spd_ssp->DR; } -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ /** @} */ diff --git a/os/hal/platforms/LPC13xx/spi_lld.h b/os/hal/platforms/LPC13xx/spi_lld.h index add7c3323..bf94a824e 100644 --- a/os/hal/platforms/LPC13xx/spi_lld.h +++ b/os/hal/platforms/LPC13xx/spi_lld.h @@ -28,7 +28,7 @@ #ifndef _SPI_LLD_H_ #define _SPI_LLD_H_ -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -339,7 +339,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ #endif /* _SPI_LLD_H_ */ diff --git a/os/hal/platforms/LPC214x/pal_lld.c b/os/hal/platforms/LPC214x/pal_lld.c index f860bfb9f..4d6f14fa9 100644 --- a/os/hal/platforms/LPC214x/pal_lld.c +++ b/os/hal/platforms/LPC214x/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -110,6 +110,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/LPC214x/pal_lld.h b/os/hal/platforms/LPC214x/pal_lld.h index 4137f19f9..8f9d3a457 100644 --- a/os/hal/platforms/LPC214x/pal_lld.h +++ b/os/hal/platforms/LPC214x/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -252,7 +252,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/platforms/LPC214x/serial_lld.c b/os/hal/platforms/LPC214x/serial_lld.c index 4390941c1..135ce9f93 100644 --- a/os/hal/platforms/LPC214x/serial_lld.c +++ b/os/hal/platforms/LPC214x/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -343,6 +343,6 @@ void sd_lld_stop(SerialDriver *sdp) { } } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/LPC214x/serial_lld.h b/os/hal/platforms/LPC214x/serial_lld.h index b41845624..6398e9483 100644 --- a/os/hal/platforms/LPC214x/serial_lld.h +++ b/os/hal/platforms/LPC214x/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -168,7 +168,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/LPC214x/spi_lld.c b/os/hal/platforms/LPC214x/spi_lld.c index 6df0106b2..f920ecf87 100644 --- a/os/hal/platforms/LPC214x/spi_lld.c +++ b/os/hal/platforms/LPC214x/spi_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -337,6 +337,6 @@ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { return (uint16_t)spip->spd_ssp->SSP_DR; } -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ /** @} */ diff --git a/os/hal/platforms/LPC214x/spi_lld.h b/os/hal/platforms/LPC214x/spi_lld.h index a4b16f76a..5f5d45823 100644 --- a/os/hal/platforms/LPC214x/spi_lld.h +++ b/os/hal/platforms/LPC214x/spi_lld.h @@ -28,7 +28,7 @@ #ifndef _SPI_LLD_H_ #define _SPI_LLD_H_ -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -206,7 +206,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ #endif /* _SPI_LLD_H_ */ diff --git a/os/hal/platforms/MSP430/pal_lld.c b/os/hal/platforms/MSP430/pal_lld.c index 767692efa..5ea89254e 100644 --- a/os/hal/platforms/MSP430/pal_lld.c +++ b/os/hal/platforms/MSP430/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -135,6 +135,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/MSP430/pal_lld.h b/os/hal/platforms/MSP430/pal_lld.h index 3d2f0905d..ce5d47dce 100644 --- a/os/hal/platforms/MSP430/pal_lld.h +++ b/os/hal/platforms/MSP430/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -291,6 +291,6 @@ extern "C" { #endif /* _PAL_LLD_H_ */ -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/MSP430/serial_lld.c b/os/hal/platforms/MSP430/serial_lld.c index 4b5dcf1ee..35ecc4b44 100644 --- a/os/hal/platforms/MSP430/serial_lld.c +++ b/os/hal/platforms/MSP430/serial_lld.c @@ -30,7 +30,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -330,6 +330,6 @@ void sd_lld_stop(SerialDriver *sdp) { #endif } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/MSP430/serial_lld.h b/os/hal/platforms/MSP430/serial_lld.h index c6205f64b..4803ace6e 100644 --- a/os/hal/platforms/MSP430/serial_lld.h +++ b/os/hal/platforms/MSP430/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -141,7 +141,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/Posix/hal_lld.c b/os/hal/platforms/Posix/hal_lld.c index 6d25f7aea..dfc4702ca 100644 --- a/os/hal/platforms/Posix/hal_lld.c +++ b/os/hal/platforms/Posix/hal_lld.c @@ -47,7 +47,7 @@ static struct timeval tick = {0, 1000000 / CH_FREQUENCY}; * @brief PAL setup. * @details Digital I/O ports static configuration as defined in @p board.h. */ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) const PALConfig pal_default_config = { {0, 0, 0}, {0, 0, 0} @@ -86,7 +86,7 @@ void hal_lld_init(void) { void ChkIntSources(void) { struct timeval tv; -#if CH_HAL_USE_SERIAL +#if HAL_USE_SERIAL if (sd_lld_interrupt_pending()) { if (chSchIsRescRequiredExI()) chSchDoRescheduleI(); diff --git a/os/hal/platforms/Posix/pal_lld.c b/os/hal/platforms/Posix/pal_lld.c index f5e409b8a..3dc664878 100644 --- a/os/hal/platforms/Posix/pal_lld.c +++ b/os/hal/platforms/Posix/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -93,6 +93,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/Posix/pal_lld.h b/os/hal/platforms/Posix/pal_lld.h index 07de81c65..3612e4498 100644 --- a/os/hal/platforms/Posix/pal_lld.h +++ b/os/hal/platforms/Posix/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -196,7 +196,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/platforms/Posix/serial_lld.c b/os/hal/platforms/Posix/serial_lld.c index 290e39c8f..95b654f17 100644 --- a/os/hal/platforms/Posix/serial_lld.c +++ b/os/hal/platforms/Posix/serial_lld.c @@ -35,7 +35,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -261,6 +261,6 @@ bool_t sd_lld_interrupt_pending(void) { outint(&SD1) || outint(&SD2); } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/Posix/serial_lld.h b/os/hal/platforms/Posix/serial_lld.h index 4ffa0c544..996af333e 100644 --- a/os/hal/platforms/Posix/serial_lld.h +++ b/os/hal/platforms/Posix/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -156,7 +156,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/SPC56x/serial_lld.c b/os/hal/platforms/SPC56x/serial_lld.c index 74b7da68a..0645d20c1 100644 --- a/os/hal/platforms/SPC56x/serial_lld.c +++ b/os/hal/platforms/SPC56x/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -300,6 +300,6 @@ void sd_lld_stop(SerialDriver *sdp) { esci_deinit(sdp->escip); } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/SPC56x/serial_lld.h b/os/hal/platforms/SPC56x/serial_lld.h index 3fd61ef1d..fdfe37c49 100644 --- a/os/hal/platforms/SPC56x/serial_lld.h +++ b/os/hal/platforms/SPC56x/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -158,7 +158,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/STM32/adc_lld.c b/os/hal/platforms/STM32/adc_lld.c index b1257c194..ae983e7bf 100644 --- a/os/hal/platforms/STM32/adc_lld.c +++ b/os/hal/platforms/STM32/adc_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_ADC || defined(__DOXYGEN__) +#if HAL_USE_ADC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -228,6 +228,6 @@ void adc_lld_stop_conversion(ADCDriver *adcp) { adcp->ad_adc->CR2 = 0; } -#endif /* CH_HAL_USE_ADC */ +#endif /* HAL_USE_ADC */ /** @} */ diff --git a/os/hal/platforms/STM32/adc_lld.h b/os/hal/platforms/STM32/adc_lld.h index cb425f326..ba353c76e 100644 --- a/os/hal/platforms/STM32/adc_lld.h +++ b/os/hal/platforms/STM32/adc_lld.h @@ -28,7 +28,7 @@ #ifndef _ADC_LLD_H_ #define _ADC_LLD_H_ -#if CH_HAL_USE_ADC || defined(__DOXYGEN__) +#if HAL_USE_ADC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -299,7 +299,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_ADC */ +#endif /* HAL_USE_ADC */ #endif /* _ADC_LLD_H_ */ diff --git a/os/hal/platforms/STM32/can_lld.c b/os/hal/platforms/STM32/can_lld.c index 4a00aa9e7..0d9d173db 100644 --- a/os/hal/platforms/STM32/can_lld.c +++ b/os/hal/platforms/STM32/can_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_CAN || defined(__DOXYGEN__) +#if HAL_USE_CAN || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -405,6 +405,6 @@ void can_lld_wakeup(CANDriver *canp) { } #endif /* CAN_USE_SLEEP_MODE */ -#endif /* CH_HAL_USE_CAN */ +#endif /* HAL_USE_CAN */ /** @} */ diff --git a/os/hal/platforms/STM32/can_lld.h b/os/hal/platforms/STM32/can_lld.h index 6d4067d9a..871ab7adf 100644 --- a/os/hal/platforms/STM32/can_lld.h +++ b/os/hal/platforms/STM32/can_lld.h @@ -28,7 +28,7 @@ #ifndef _CAN_LLD_H_ #define _CAN_LLD_H_ -#if CH_HAL_USE_CAN || defined(__DOXYGEN__) +#if HAL_USE_CAN || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -318,7 +318,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_CAN */ +#endif /* HAL_USE_CAN */ #endif /* _CAN_LLD_H_ */ diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index f099be983..a46a5c65f 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -83,7 +83,7 @@ void hal_lld_init(void) { SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk; -#if CH_HAL_USE_ADC || CH_HAL_USE_SPI || CH_HAL_USE_UART +#if HAL_USE_ADC || HAL_USE_SPI || HAL_USE_UART dmaInit(); #endif } diff --git a/os/hal/platforms/STM32/pal_lld.c b/os/hal/platforms/STM32/pal_lld.c index 49bfadf14..6e2346000 100644 --- a/os/hal/platforms/STM32/pal_lld.c +++ b/os/hal/platforms/STM32/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) #if defined(STM32F10X_LD) #define APB2_RST_MASK (RCC_APB2RSTR_IOPARST | RCC_APB2RSTR_IOPBRST | \ @@ -192,6 +192,6 @@ void _pal_lld_setgroupmode(ioportid_t port, port->CRL = (port->CRL & ml) | crl; } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/STM32/pal_lld.h b/os/hal/platforms/STM32/pal_lld.h index 31364cae8..017f140da 100644 --- a/os/hal/platforms/STM32/pal_lld.h +++ b/os/hal/platforms/STM32/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -320,7 +320,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index 20ab05211..249de1651 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PWM || defined(__DOXYGEN__) +#if HAL_USE_PWM || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -525,6 +525,6 @@ void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel) { } } -#endif /* CH_HAL_USE_PWM */ +#endif /* HAL_USE_PWM */ /** @} */ diff --git a/os/hal/platforms/STM32/pwm_lld.h b/os/hal/platforms/STM32/pwm_lld.h index f512f08d6..d8440e361 100644 --- a/os/hal/platforms/STM32/pwm_lld.h +++ b/os/hal/platforms/STM32/pwm_lld.h @@ -28,7 +28,7 @@ #ifndef _PWM_LLD_H_ #define _PWM_LLD_H_ -#if CH_HAL_USE_PWM || defined(__DOXYGEN__) +#if HAL_USE_PWM || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -324,7 +324,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PWM */ +#endif /* HAL_USE_PWM */ #endif /* _PWM_LLD_H_ */ diff --git a/os/hal/platforms/STM32/serial_lld.c b/os/hal/platforms/STM32/serial_lld.c index 71fd20372..43fb6229a 100644 --- a/os/hal/platforms/STM32/serial_lld.c +++ b/os/hal/platforms/STM32/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -444,6 +444,6 @@ void sd_lld_stop(SerialDriver *sdp) { } } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/STM32/serial_lld.h b/os/hal/platforms/STM32/serial_lld.h index ef9e4598a..00617a98a 100644 --- a/os/hal/platforms/STM32/serial_lld.h +++ b/os/hal/platforms/STM32/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -239,7 +239,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index 7d4d182bb..d9abd5ba1 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -486,6 +486,6 @@ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { return spip->spd_spi->DR; } -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ /** @} */ diff --git a/os/hal/platforms/STM32/spi_lld.h b/os/hal/platforms/STM32/spi_lld.h index 54b995a02..592a904f0 100644 --- a/os/hal/platforms/STM32/spi_lld.h +++ b/os/hal/platforms/STM32/spi_lld.h @@ -28,7 +28,7 @@ #ifndef _SPI_LLD_H_ #define _SPI_LLD_H_ -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -287,7 +287,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ #endif /* _SPI_LLD_H_ */ diff --git a/os/hal/platforms/STM32/uart_lld.c b/os/hal/platforms/STM32/uart_lld.c index b08c0015d..2b30ce6a3 100644 --- a/os/hal/platforms/STM32/uart_lld.c +++ b/os/hal/platforms/STM32/uart_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_UART || defined(__DOXYGEN__) +#if HAL_USE_UART || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -667,6 +667,6 @@ size_t uart_lld_stop_receive(UARTDriver *uartp) { return n; } -#endif /* CH_HAL_USE_UART */ +#endif /* HAL_USE_UART */ /** @} */ diff --git a/os/hal/platforms/STM32/uart_lld.h b/os/hal/platforms/STM32/uart_lld.h index e18a21b97..a1c6235ee 100644 --- a/os/hal/platforms/STM32/uart_lld.h +++ b/os/hal/platforms/STM32/uart_lld.h @@ -28,7 +28,7 @@ #ifndef _UART_LLD_H_ #define _UART_LLD_H_ -#if CH_HAL_USE_UART || defined(__DOXYGEN__) +#if HAL_USE_UART || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -213,11 +213,11 @@ typedef struct { /** * @brief Character received while out if the @p UART_RECEIVE state. */ - uartcb_t uc_rxchar; + uartccb_t uc_rxchar; /** * @brief Receive error callback. */ - uartcb_t uc_rxerr; + uartecb_t uc_rxerr; /* End of the mandatory fields.*/ /** * @brief Bit rate. @@ -321,7 +321,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_UART */ +#endif /* HAL_USE_UART */ #endif /* _UART_LLD_H_ */ diff --git a/os/hal/platforms/STM8/pal_lld.c b/os/hal/platforms/STM8/pal_lld.c index 56bae5cc3..3296022e7 100644 --- a/os/hal/platforms/STM8/pal_lld.c +++ b/os/hal/platforms/STM8/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -105,6 +105,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/STM8/pal_lld.h b/os/hal/platforms/STM8/pal_lld.h index 8fb511cf1..c8e572d42 100644 --- a/os/hal/platforms/STM8/pal_lld.h +++ b/os/hal/platforms/STM8/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -229,7 +229,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/platforms/STM8/serial_lld.c b/os/hal/platforms/STM8/serial_lld.c index 13c9c2f24..06f2f482b 100644 --- a/os/hal/platforms/STM8/serial_lld.c +++ b/os/hal/platforms/STM8/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -441,6 +441,6 @@ void sd_lld_stop(SerialDriver *sdp) { #endif } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/STM8/serial_lld.h b/os/hal/platforms/STM8/serial_lld.h index fc1e03c54..fe6b9bcaa 100644 --- a/os/hal/platforms/STM8/serial_lld.h +++ b/os/hal/platforms/STM8/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -166,7 +166,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/STM8/spi_lld.c b/os/hal/platforms/STM8/spi_lld.c index e929f4b69..4accd6cd0 100644 --- a/os/hal/platforms/STM8/spi_lld.c +++ b/os/hal/platforms/STM8/spi_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -285,6 +285,6 @@ uint8_t spi_lld_polled_exchange(SPIDriver *spip, uint8_t frame) { return (uint16_t)SPI->DR; } -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ /** @} */ diff --git a/os/hal/platforms/STM8/spi_lld.h b/os/hal/platforms/STM8/spi_lld.h index f84f4a9a0..a1b56694e 100644 --- a/os/hal/platforms/STM8/spi_lld.h +++ b/os/hal/platforms/STM8/spi_lld.h @@ -28,7 +28,7 @@ #ifndef _SPI_LLD_H_ #define _SPI_LLD_H_ -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -186,7 +186,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ #endif /* _SPI_LLD_H_ */ diff --git a/os/hal/platforms/Win32/hal_lld.c b/os/hal/platforms/Win32/hal_lld.c index afbbae39e..51781b94c 100644 --- a/os/hal/platforms/Win32/hal_lld.c +++ b/os/hal/platforms/Win32/hal_lld.c @@ -42,7 +42,7 @@ static LARGE_INTEGER slice; * @brief PAL setup. * @details Digital I/O ports static configuration as defined in @p board.h. */ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) const PALConfig pal_default_config = { {0, 0, 0}, {0, 0, 0} @@ -91,7 +91,7 @@ void hal_lld_init(void) { void ChkIntSources(void) { LARGE_INTEGER n; -#if CH_HAL_USE_SERIAL +#if HAL_USE_SERIAL if (sd_lld_interrupt_pending()) { if (chSchIsRescRequiredExI()) chSchDoRescheduleI(); diff --git a/os/hal/platforms/Win32/pal_lld.c b/os/hal/platforms/Win32/pal_lld.c index 378557780..54ff76100 100644 --- a/os/hal/platforms/Win32/pal_lld.c +++ b/os/hal/platforms/Win32/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -93,6 +93,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/platforms/Win32/pal_lld.h b/os/hal/platforms/Win32/pal_lld.h index 2c1955766..b353f2a52 100644 --- a/os/hal/platforms/Win32/pal_lld.h +++ b/os/hal/platforms/Win32/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -196,7 +196,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/platforms/Win32/serial_lld.c b/os/hal/platforms/Win32/serial_lld.c index 43c7b331a..30e479055 100644 --- a/os/hal/platforms/Win32/serial_lld.c +++ b/os/hal/platforms/Win32/serial_lld.c @@ -27,7 +27,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -258,6 +258,6 @@ bool_t sd_lld_interrupt_pending(void) { outint(&SD1) || outint(&SD2); } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/Win32/serial_lld.h b/os/hal/platforms/Win32/serial_lld.h index 37f96e13b..79a5994f2 100644 --- a/os/hal/platforms/Win32/serial_lld.h +++ b/os/hal/platforms/Win32/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver pre-compile time settings. */ @@ -148,7 +148,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/src/adc.c b/os/hal/src/adc.c index e18995089..2af890b63 100644 --- a/os/hal/src/adc.c +++ b/os/hal/src/adc.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_ADC || defined(__DOXYGEN__) +#if HAL_USE_ADC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -323,6 +323,6 @@ void adcReleaseBus(ADCDriver *adcp) { } #endif /* ADC_USE_MUTUAL_EXCLUSION */ -#endif /* CH_HAL_USE_ADC */ +#endif /* HAL_USE_ADC */ /** @} */ diff --git a/os/hal/src/can.c b/os/hal/src/can.c index ec907de97..59a7b5dbf 100644 --- a/os/hal/src/can.c +++ b/os/hal/src/can.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_CAN || defined(__DOXYGEN__) +#if HAL_USE_CAN || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -282,6 +282,6 @@ void canWakeup(CANDriver *canp) { } #endif /* CAN_USE_SLEEP_MODE */ -#endif /* CH_HAL_USE_CAN */ +#endif /* HAL_USE_CAN */ /** @} */ diff --git a/os/hal/src/hal.c b/os/hal/src/hal.c index c0e3d2c28..4cf145059 100644 --- a/os/hal/src/hal.c +++ b/os/hal/src/hal.c @@ -53,34 +53,34 @@ void halInit(void) { hal_lld_init(); -#if CH_HAL_USE_PAL +#if HAL_USE_PAL palInit(&pal_default_config); #endif -#if CH_HAL_USE_ADC +#if HAL_USE_ADC adcInit(); #endif -#if CH_HAL_USE_CAN +#if HAL_USE_CAN canInit(); #endif -#if CH_HAL_USE_I2C +#if HAL_USE_I2C i2cInit(); #endif -#if CH_HAL_USE_MAC +#if HAL_USE_MAC macInit(); #endif -#if CH_HAL_USE_PWM +#if HAL_USE_PWM pwmInit(); #endif -#if CH_HAL_USE_SERIAL +#if HAL_USE_SERIAL sdInit(); #endif -#if CH_HAL_USE_SPI +#if HAL_USE_SPI spiInit(); #endif -#if CH_HAL_USE_MMC_SPI +#if HAL_USE_MMC_SPI mmcInit(); #endif -#if CH_HAL_USE_UART +#if HAL_USE_UART uartInit(); #endif } diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c index 7558d6741..b432fa89f 100644 --- a/os/hal/src/i2c.c +++ b/os/hal/src/i2c.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_I2C || defined(__DOXYGEN__) +#if HAL_USE_I2C || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -265,6 +265,6 @@ void i2cReleaseBus(I2CDriver *i2cp) { } #endif /* I2C_USE_MUTUAL_EXCLUSION */ -#endif /* CH_HAL_USE_I2C */ +#endif /* HAL_USE_I2C */ /** @} */ diff --git a/os/hal/src/mac.c b/os/hal/src/mac.c index 62340dc31..bed07fbbb 100644 --- a/os/hal/src/mac.c +++ b/os/hal/src/mac.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_MAC || defined(__DOXYGEN__) +#if HAL_USE_MAC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -209,6 +209,6 @@ bool_t macPollLinkStatus(MACDriver *macp) { return mac_lld_poll_link_status(macp); } -#endif /* CH_HAL_USE_MAC */ +#endif /* HAL_USE_MAC */ /** @} */ diff --git a/os/hal/src/mmc_spi.c b/os/hal/src/mmc_spi.c index 49f75c3cc..813ed9de1 100644 --- a/os/hal/src/mmc_spi.c +++ b/os/hal/src/mmc_spi.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_MMC_SPI || defined(__DOXYGEN__) +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -621,6 +621,6 @@ bool_t mmcStopSequentialWrite(MMCDriver *mmcp) { return TRUE; } -#endif /* CH_HAL_USE_MMC_SPI */ +#endif /* HAL_USE_MMC_SPI */ /** @} */ diff --git a/os/hal/src/pal.c b/os/hal/src/pal.c index 824ebae0d..ce7c226e9 100644 --- a/os/hal/src/pal.c +++ b/os/hal/src/pal.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -117,6 +117,6 @@ void palSetBusMode(IOBus *bus, uint_fast8_t mode) { palSetGroupMode(bus->bus_portid, bus->bus_mask, mode); } -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/src/pwm.c b/os/hal/src/pwm.c index 13c77bfc6..95c3f4750 100644 --- a/os/hal/src/pwm.c +++ b/os/hal/src/pwm.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PWM || defined(__DOXYGEN__) +#if HAL_USE_PWM || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -158,6 +158,6 @@ void pwmDisableChannel(PWMDriver *pwmp, pwmchannel_t channel) { chSysUnlock(); } -#endif /* CH_HAL_USE_PWM */ +#endif /* HAL_USE_PWM */ /** @} */ diff --git a/os/hal/src/serial.c b/os/hal/src/serial.c index 6c47d7fc3..8ec75d000 100644 --- a/os/hal/src/serial.c +++ b/os/hal/src/serial.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -273,6 +273,6 @@ sdflags_t sdGetAndClearFlags(SerialDriver *sdp) { return mask; } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/src/spi.c b/os/hal/src/spi.c index be5cf9452..4d9749962 100644 --- a/os/hal/src/spi.c +++ b/os/hal/src/spi.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -441,6 +441,6 @@ void spiReleaseBus(SPIDriver *spip) { } #endif /* SPI_USE_MUTUAL_EXCLUSION */ -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ /** @} */ diff --git a/os/hal/src/uart.c b/os/hal/src/uart.c index a2b21f6c8..eb771bb7b 100644 --- a/os/hal/src/uart.c +++ b/os/hal/src/uart.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_UART || defined(__DOXYGEN__) +#if HAL_USE_UART || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -349,6 +349,6 @@ size_t uartStopReceiveI(UARTDriver *uartp) { return 0; } -#endif /* CH_HAL_USE_UART */ +#endif /* HAL_USE_UART */ /** @} */ diff --git a/os/hal/templates/adc_lld.c b/os/hal/templates/adc_lld.c index 5ea8e9585..54622beb7 100644 --- a/os/hal/templates/adc_lld.c +++ b/os/hal/templates/adc_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_ADC || defined(__DOXYGEN__) +#if HAL_USE_ADC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -107,6 +107,6 @@ void adc_lld_stop_conversion(ADCDriver *adcp) { } -#endif /* CH_HAL_USE_ADC */ +#endif /* HAL_USE_ADC */ /** @} */ diff --git a/os/hal/templates/adc_lld.h b/os/hal/templates/adc_lld.h index dc2c76f07..c85a1bd77 100644 --- a/os/hal/templates/adc_lld.h +++ b/os/hal/templates/adc_lld.h @@ -28,7 +28,7 @@ #ifndef _ADC_LLD_H_ #define _ADC_LLD_H_ -#if CH_HAL_USE_ADC || defined(__DOXYGEN__) +#if HAL_USE_ADC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -179,7 +179,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_ADC */ +#endif /* HAL_USE_ADC */ #endif /* _ADC_LLD_H_ */ diff --git a/os/hal/templates/can_lld.c b/os/hal/templates/can_lld.c index ae5fab9d7..2dc92f169 100644 --- a/os/hal/templates/can_lld.c +++ b/os/hal/templates/can_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_CAN || defined(__DOXYGEN__) +#if HAL_USE_CAN || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -164,6 +164,6 @@ void can_lld_wakeup(CANDriver *canp) { } #endif /* CAN_USE_SLEEP_MODE */ -#endif /* CH_HAL_USE_CAN */ +#endif /* HAL_USE_CAN */ /** @} */ diff --git a/os/hal/templates/can_lld.h b/os/hal/templates/can_lld.h index 312a664f6..37ce7f157 100644 --- a/os/hal/templates/can_lld.h +++ b/os/hal/templates/can_lld.h @@ -28,7 +28,7 @@ #ifndef _CAN_LLD_H_ #define _CAN_LLD_H_ -#if CH_HAL_USE_CAN || defined(__DOXYGEN__) +#if HAL_USE_CAN || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -229,7 +229,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_CAN */ +#endif /* HAL_USE_CAN */ #endif /* _CAN_LLD_H_ */ diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h index 74234dfa0..71f21c206 100644 --- a/os/hal/templates/halconf.h +++ b/os/hal/templates/halconf.h @@ -40,71 +40,71 @@ /** * @brief Enables the PAL subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE #endif /** * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC TRUE #endif /** * @brief Enables the CAN subsystem. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN TRUE +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN TRUE #endif /** * @brief Enables the I2C subsystem. */ -#if !defined(CH_HAL_USE_I2C) || defined(__DOXYGEN__) -#define CH_HAL_USE_I2C FALSE +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE #endif /** * @brief Enables the MAC subsystem. */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC TRUE +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC TRUE #endif /** * @brief Enables the MMC_SPI subsystem. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI TRUE +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI TRUE #endif /** * @brief Enables the PWM subsystem. */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM TRUE +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE #endif /** * @brief Enables the SERIAL subsystem. */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE #endif /** * @brief Enables the SPI subsystem. */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE #endif /** * @brief Enables the UART subsystem. */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART TRUE +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART TRUE #endif /*===========================================================================*/ diff --git a/os/hal/templates/i2c_lld.c b/os/hal/templates/i2c_lld.c index 8c8e47b76..d41f693ab 100644 --- a/os/hal/templates/i2c_lld.c +++ b/os/hal/templates/i2c_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_I2C || defined(__DOXYGEN__) +#if HAL_USE_I2C || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -149,6 +149,6 @@ void i2c_lld_master_receive(I2CDriver *i2cp, size_t n, uint8_t *rxbuf) { } -#endif /* CH_HAL_USE_I2C */ +#endif /* HAL_USE_I2C */ /** @} */ diff --git a/os/hal/templates/i2c_lld.h b/os/hal/templates/i2c_lld.h index 29914705d..ea2b1a61e 100644 --- a/os/hal/templates/i2c_lld.h +++ b/os/hal/templates/i2c_lld.h @@ -28,7 +28,7 @@ #ifndef _I2C_LLD_H_ #define _I2C_LLD_H_ -#if CH_HAL_USE_I2C || defined(__DOXYGEN__) +#if HAL_USE_I2C || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -113,7 +113,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_I2C */ +#endif /* HAL_USE_I2C */ #endif /* _I2C_LLD_H_ */ diff --git a/os/hal/templates/mac_lld.c b/os/hal/templates/mac_lld.c index b1fb040e6..8049f29ec 100644 --- a/os/hal/templates/mac_lld.c +++ b/os/hal/templates/mac_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_MAC || defined(__DOXYGEN__) +#if HAL_USE_MAC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -189,6 +189,6 @@ bool_t mac_lld_poll_link_status(MACDriver *macp) { return FALSE; } -#endif /* CH_HAL_USE_MAC */ +#endif /* HAL_USE_MAC */ /** @} */ diff --git a/os/hal/templates/mac_lld.h b/os/hal/templates/mac_lld.h index 0d3a68696..869fa5db8 100644 --- a/os/hal/templates/mac_lld.h +++ b/os/hal/templates/mac_lld.h @@ -28,7 +28,7 @@ #ifndef _MAC_LLD_H_ #define _MAC_LLD_H_ -#if CH_HAL_USE_MAC || defined(__DOXYGEN__) +#if HAL_USE_MAC || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -133,7 +133,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_MAC */ +#endif /* HAL_USE_MAC */ #endif /* _MAC_LLD_H_ */ diff --git a/os/hal/templates/meta/driver.c b/os/hal/templates/meta/driver.c index d006d0fda..234f70e09 100644 --- a/os/hal/templates/meta/driver.c +++ b/os/hal/templates/meta/driver.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_XXX || defined(__DOXYGEN__) +#if HAL_USE_XXX || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -111,6 +111,6 @@ void xxxStop(XXXDriver *xxxp) { chSysUnlock(); } -#endif /* CH_HAL_USE_XXX */ +#endif /* HAL_USE_XXX */ /** @} */ diff --git a/os/hal/templates/meta/driver.h b/os/hal/templates/meta/driver.h index a19406719..1014e871c 100644 --- a/os/hal/templates/meta/driver.h +++ b/os/hal/templates/meta/driver.h @@ -28,7 +28,7 @@ #ifndef _XXX_H_ #define _XXX_H_ -#if CH_HAL_USE_XXX || defined(__DOXYGEN__) +#if HAL_USE_XXX || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -76,7 +76,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_XXX */ +#endif /* HAL_USE_XXX */ #endif /* _XXX_H_ */ diff --git a/os/hal/templates/meta/driver_lld.c b/os/hal/templates/meta/driver_lld.c index bbac5511e..051dfac03 100644 --- a/os/hal/templates/meta/driver_lld.c +++ b/os/hal/templates/meta/driver_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_XXX || defined(__DOXYGEN__) +#if HAL_USE_XXX || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -85,6 +85,6 @@ void xxx_lld_stop(XXXDriver *xxxp) { } -#endif /* CH_HAL_USE_XXX */ +#endif /* HAL_USE_XXX */ /** @} */ diff --git a/os/hal/templates/meta/driver_lld.h b/os/hal/templates/meta/driver_lld.h index 1392954a5..7d75bbaea 100644 --- a/os/hal/templates/meta/driver_lld.h +++ b/os/hal/templates/meta/driver_lld.h @@ -28,7 +28,7 @@ #ifndef _XXX_LLD_H_ #define _XXX_LLD_H_ -#if CH_HAL_USE_XXX || defined(__DOXYGEN__) +#if HAL_USE_XXX || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -93,7 +93,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_XXX */ +#endif /* HAL_USE_XXX */ #endif /* _XXX_LLD_H_ */ diff --git a/os/hal/templates/pal_lld.c b/os/hal/templates/pal_lld.c index 2b2d17459..583b39236 100644 --- a/os/hal/templates/pal_lld.c +++ b/os/hal/templates/pal_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -50,6 +50,6 @@ /* Driver exported functions. */ /*===========================================================================*/ -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ /** @} */ diff --git a/os/hal/templates/pal_lld.h b/os/hal/templates/pal_lld.h index 38990ddd9..d2e151018 100644 --- a/os/hal/templates/pal_lld.h +++ b/os/hal/templates/pal_lld.h @@ -28,7 +28,7 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ -#if CH_HAL_USE_PAL || defined(__DOXYGEN__) +#if HAL_USE_PAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Unsupported modes and specific modes */ @@ -332,7 +332,7 @@ typedef uint32_t ioportid_t; */ #define pal_lld_setpadmode(port, pad, mode) -#endif /* CH_HAL_USE_PAL */ +#endif /* HAL_USE_PAL */ #endif /* _PAL_LLD_H_ */ diff --git a/os/hal/templates/pwm_lld.c b/os/hal/templates/pwm_lld.c index 2fa907ec1..02de6b17c 100644 --- a/os/hal/templates/pwm_lld.c +++ b/os/hal/templates/pwm_lld.c @@ -28,6 +28,8 @@ #include "ch.h" #include "hal.h" +#if HAL_USE_PWM || defined(__DOXYGEN__) + /*===========================================================================*/ /* Driver exported variables. */ /*===========================================================================*/ @@ -144,4 +146,6 @@ void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel) { } +#endif /* HAL_USE_PWM */ + /** @} */ diff --git a/os/hal/templates/pwm_lld.h b/os/hal/templates/pwm_lld.h index 499d6e11c..1b0b38f75 100644 --- a/os/hal/templates/pwm_lld.h +++ b/os/hal/templates/pwm_lld.h @@ -28,6 +28,8 @@ #ifndef _PWM_LLD_H_ #define _PWM_LLD_H_ +#if HAL_USE_PWM || defined(__DOXYGEN__) + /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ @@ -184,6 +186,8 @@ extern "C" { } #endif +#endif /* HAL_USE_PWM */ + #endif /* _PWM_LLD_H_ */ /** @} */ diff --git a/os/hal/templates/serial_lld.c b/os/hal/templates/serial_lld.c index 6bb863362..406235767 100644 --- a/os/hal/templates/serial_lld.c +++ b/os/hal/templates/serial_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -95,6 +95,6 @@ void sd_lld_stop(SerialDriver *sdp) { } -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/templates/serial_lld.h b/os/hal/templates/serial_lld.h index 5e225f962..f33c2062b 100644 --- a/os/hal/templates/serial_lld.h +++ b/os/hal/templates/serial_lld.h @@ -28,7 +28,7 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ -#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +#if HAL_USE_SERIAL || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -101,7 +101,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SERIAL */ +#endif /* HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/templates/spi_lld.c b/os/hal/templates/spi_lld.c index f3053f725..5b76e3bdf 100644 --- a/os/hal/templates/spi_lld.c +++ b/os/hal/templates/spi_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -193,6 +193,6 @@ uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) { } -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ /** @} */ diff --git a/os/hal/templates/spi_lld.h b/os/hal/templates/spi_lld.h index acc6a699f..4e7d7b81b 100644 --- a/os/hal/templates/spi_lld.h +++ b/os/hal/templates/spi_lld.h @@ -28,7 +28,7 @@ #ifndef _SPI_LLD_H_ #define _SPI_LLD_H_ -#if CH_HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -137,7 +137,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_SPI */ +#endif /* HAL_USE_SPI */ #endif /* _SPI_LLD_H_ */ diff --git a/os/hal/templates/uart_lld.c b/os/hal/templates/uart_lld.c index 2c317b677..264446369 100644 --- a/os/hal/templates/uart_lld.c +++ b/os/hal/templates/uart_lld.c @@ -28,7 +28,7 @@ #include "ch.h" #include "hal.h" -#if CH_HAL_USE_UART || defined(__DOXYGEN__) +#if HAL_USE_UART || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver exported variables. */ @@ -145,6 +145,6 @@ size_t uart_lld_stop_receive(UARTDriver *uartp) { } -#endif /* CH_HAL_USE_UART */ +#endif /* HAL_USE_UART */ /** @} */ diff --git a/os/hal/templates/uart_lld.h b/os/hal/templates/uart_lld.h index 617c56166..531e7f3ab 100644 --- a/os/hal/templates/uart_lld.h +++ b/os/hal/templates/uart_lld.h @@ -28,7 +28,7 @@ #ifndef _UART_LLD_H_ #define _UART_LLD_H_ -#if CH_HAL_USE_UART || defined(__DOXYGEN__) +#if HAL_USE_UART || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -102,11 +102,11 @@ typedef struct { /** * @brief Character received while out if the @p UART_RECEIVE state. */ - uartcb_t uc_rxchar; + uartccb_t uc_rxchar; /** * @brief Receive error callback. */ - uartcb_t uc_rxerr; + uartecb_t uc_rxerr; /* End of the mandatory fields.*/ } UARTConfig; @@ -160,7 +160,7 @@ extern "C" { } #endif -#endif /* CH_HAL_USE_UART */ +#endif /* HAL_USE_UART */ #endif /* _UART_LLD_H_ */ diff --git a/readme.txt b/readme.txt index 499120652..839798157 100644 --- a/readme.txt +++ b/readme.txt @@ -65,11 +65,14 @@ ***************************************************************************** *** 2.1.3 *** +- FIX: Fixed broken STM32 synchronous UART driver (bug 3100946). +- FIX: Broken C++ wrapper (bug 3100925). +- FIX: Broken lwIP/uIP demos (bug 3100901). - FIX: DMA not initialized under some conditions (bug 3099701). - NEW: Added an SPI driver to the STM8 platform support. - NEW: Added a simple STM8 SPI demo under ./testhal/STM8/SPI. -- CHANGE: Renamed most of the STM8 HAL settings macro names in order to - make names more consistent. +- CHANGE: Renamed the HAL settings macro names, removed the CH_ prefix + because it is reserved as kernel namespace. NOTE: ****** Make sure to use a mcuconf.h file taken from ****** ****** this version in your project. ****** diff --git a/test/coverage/halconf.h b/test/coverage/halconf.h index 3e4b15d2d..437b67a6c 100644 --- a/test/coverage/halconf.h +++ b/test/coverage/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ /*#include "mcuconf.h"*/ -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL FALSE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL FALSE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL FALSE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/testhal/STM32/ADC/halconf.h b/testhal/STM32/ADC/halconf.h index f294f3337..42091b4f7 100644 --- a/testhal/STM32/ADC/halconf.h +++ b/testhal/STM32/ADC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC TRUE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC TRUE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL FALSE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/testhal/STM32/CAN/halconf.h b/testhal/STM32/CAN/halconf.h index 3f39e210a..ce54171c8 100644 --- a/testhal/STM32/CAN/halconf.h +++ b/testhal/STM32/CAN/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN TRUE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL FALSE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/testhal/STM32/PWM/halconf.h b/testhal/STM32/PWM/halconf.h index f986170cf..6c9542a44 100644 --- a/testhal/STM32/PWM/halconf.h +++ b/testhal/STM32/PWM/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL FALSE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/testhal/STM32/SPI/halconf.h b/testhal/STM32/SPI/halconf.h index 598a2d7ac..7f00e53fb 100644 --- a/testhal/STM32/SPI/halconf.h +++ b/testhal/STM32/SPI/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL FALSE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/testhal/STM32/UART/halconf.h b/testhal/STM32/UART/halconf.h index 00efb23b2..0825207e3 100644 --- a/testhal/STM32/UART/halconf.h +++ b/testhal/STM32/UART/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART TRUE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL FALSE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART TRUE -#endif - #endif /* _HALCONF_H_ */ /** @} */ diff --git a/testhal/STM8/SPI/cosmic/vectors.c b/testhal/STM8/SPI/cosmic/vectors.c index e9a5ad450..76ebd1736 100644 --- a/testhal/STM8/SPI/cosmic/vectors.c +++ b/testhal/STM8/SPI/cosmic/vectors.c @@ -69,7 +69,7 @@ exception_vector_t const _vectab[] = { {0x82, vector}, /* vector7 */ {0x82, vector}, /* vector8 */ {0x82, vector}, /* vector9 */ -#if CH_HAL_USE_SPI && STM8_SPI_USE_SPI +#if HAL_USE_SPI && STM8_SPI_USE_SPI {0x82, vector10}, #else {0x82, vector}, /* vector10 */ @@ -80,7 +80,7 @@ exception_vector_t const _vectab[] = { {0x82, vector}, /* vector14 */ {0x82, vector}, /* vector15 */ {0x82, vector}, /* vector16 */ -#if CH_HAL_USE_SERIAL && STM8_SERIAL_USE_UART1 +#if HAL_USE_SERIAL && STM8_SERIAL_USE_UART1 {0x82, vector17}, /* vector17 */ {0x82, vector18}, /* vector18 */ #else @@ -88,7 +88,7 @@ exception_vector_t const _vectab[] = { {0x82, vector}, /* vector18 */ #endif {0x82, vector}, /* vector19 */ -#if CH_HAL_USE_SERIAL && (STM8_SERIAL_USE_UART2 || STM8_SERIAL_USE_UART3) +#if HAL_USE_SERIAL && (STM8_SERIAL_USE_UART2 || STM8_SERIAL_USE_UART3) {0x82, vector20}, /* vector20 */ {0x82, vector21}, /* vector21 */ #else diff --git a/testhal/STM8/SPI/demo/halconf.h b/testhal/STM8/SPI/demo/halconf.h index 2783110fc..7f00e53fb 100644 --- a/testhal/STM8/SPI/demo/halconf.h +++ b/testhal/STM8/SPI/demo/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the ADC subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,118 +112,152 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE #endif -/* - * Default ADC settings overrides (uncomment to override). +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define ADC_USE_WAIT TRUE*/ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif -/* - * Default CAN settings overrides (uncomment to override). +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE -#endif - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL FALSE -#endif - -/* - * Default SERIAL settings overrides (uncomment to override). - */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -#define SERIAL_BUFFERS_SIZE 16 - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI TRUE -#endif - -/* - * Default SPI settings overrides (uncomment to override). - */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ - /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/** + * @brief Number of positive insertion queries before generating the + * insertion event. + */ +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 +#endif + +/** + * @brief Interval, in milliseconds, between insertion queries. + */ +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */