From 972107af04d60d05666bdc5b36ff537cc44511af Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 2 Apr 2016 07:43:00 +0000 Subject: Adjusted HAL file names. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9204 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/hal.c | 144 ++++++++++++++++++++++++++++++++++++++++++++ os/hal/src/hal_adc.c | 2 +- os/hal/src/hal_can.c | 2 +- os/hal/src/hal_dac.c | 2 +- os/hal/src/hal_ext.c | 2 +- os/hal/src/hal_gpt.c | 2 +- os/hal/src/hal_hal.c | 144 -------------------------------------------- os/hal/src/hal_i2c.c | 2 +- os/hal/src/hal_i2s.c | 2 +- os/hal/src/hal_icu.c | 2 +- os/hal/src/hal_mac.c | 2 +- os/hal/src/hal_mmc_spi.c | 2 +- os/hal/src/hal_pal.c | 2 +- os/hal/src/hal_pwm.c | 2 +- os/hal/src/hal_rtc.c | 2 +- os/hal/src/hal_sdc.c | 2 +- os/hal/src/hal_serial.c | 2 +- os/hal/src/hal_serial_usb.c | 2 +- os/hal/src/hal_spi.c | 2 +- os/hal/src/hal_st.c | 2 +- os/hal/src/hal_uart.c | 2 +- os/hal/src/hal_usb.c | 2 +- os/hal/src/hal_wdg.c | 2 +- 23 files changed, 165 insertions(+), 165 deletions(-) create mode 100644 os/hal/src/hal.c delete mode 100644 os/hal/src/hal_hal.c (limited to 'os/hal/src') diff --git a/os/hal/src/hal.c b/os/hal/src/hal.c new file mode 100644 index 000000000..04cd0b2c5 --- /dev/null +++ b/os/hal/src/hal.c @@ -0,0 +1,144 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file hal.c + * @brief HAL subsystem code. + * + * @addtogroup HAL + * @{ + */ + +#include "hal.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables and types. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/** + * @brief HAL initialization. + * @details This function invokes the low level initialization code then + * initializes all the drivers enabled in the HAL. Finally the + * board-specific initialization is performed by invoking + * @p boardInit() (usually defined in @p board.c). + * + * @init + */ +void halInit(void) { + + /* Initializes the OS Abstraction Layer.*/ + osalInit(); + + /* Platform low level initializations.*/ + hal_lld_init(); + +#if (HAL_USE_PAL == TRUE) || defined(__DOXYGEN__) + palInit(&pal_default_config); +#endif +#if (HAL_USE_ADC == TRUE) || defined(__DOXYGEN__) + adcInit(); +#endif +#if (HAL_USE_CAN == TRUE) || defined(__DOXYGEN__) + canInit(); +#endif +#if (HAL_USE_DAC == TRUE) || defined(__DOXYGEN__) + dacInit(); +#endif +#if (HAL_USE_EXT == TRUE) || defined(__DOXYGEN__) + extInit(); +#endif +#if (HAL_USE_GPT == TRUE) || defined(__DOXYGEN__) + gptInit(); +#endif +#if (HAL_USE_I2C == TRUE) || defined(__DOXYGEN__) + i2cInit(); +#endif +#if (HAL_USE_I2S == TRUE) || defined(__DOXYGEN__) + i2sInit(); +#endif +#if (HAL_USE_ICU == TRUE) || defined(__DOXYGEN__) + icuInit(); +#endif +#if (HAL_USE_MAC == TRUE) || defined(__DOXYGEN__) + macInit(); +#endif +#if (HAL_USE_PWM == TRUE) || defined(__DOXYGEN__) + pwmInit(); +#endif +#if (HAL_USE_SERIAL == TRUE) || defined(__DOXYGEN__) + sdInit(); +#endif +#if (HAL_USE_SDC == TRUE) || defined(__DOXYGEN__) + sdcInit(); +#endif +#if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__) + spiInit(); +#endif +#if (HAL_USE_UART == TRUE) || defined(__DOXYGEN__) + uartInit(); +#endif +#if (HAL_USE_USB == TRUE) || defined(__DOXYGEN__) + usbInit(); +#endif +#if (HAL_USE_MMC_SPI == TRUE) || defined(__DOXYGEN__) + mmcInit(); +#endif +#if (HAL_USE_SERIAL_USB == TRUE) || defined(__DOXYGEN__) + sduInit(); +#endif +#if (HAL_USE_RTC == TRUE) || defined(__DOXYGEN__) + rtcInit(); +#endif +#if (HAL_USE_WDG == TRUE) || defined(__DOXYGEN__) + wdgInit(); +#endif + + /* Community driver overlay initialization.*/ +#if defined(HAL_USE_COMMUNITY) || defined(__DOXYGEN__) +#if (HAL_USE_COMMUNITY == TRUE) || defined(__DOXYGEN__) + halCommunityInit(); +#endif +#endif + + /* Board specific initialization.*/ + boardInit(); + +/* + * The ST driver is a special case, it is only initialized if the OSAL is + * configured to require it. + */ +#if OSAL_ST_MODE != OSAL_ST_MODE_NONE + stInit(); +#endif +} + +/** @} */ diff --git a/os/hal/src/hal_adc.c b/os/hal/src/hal_adc.c index 9bfb1b0d0..0945ea9f2 100644 --- a/os/hal/src/hal_adc.c +++ b/os/hal/src/hal_adc.c @@ -15,7 +15,7 @@ */ /** - * @file adc.c + * @file hal_adc.c * @brief ADC Driver code. * * @addtogroup ADC diff --git a/os/hal/src/hal_can.c b/os/hal/src/hal_can.c index eecfdb7ce..173700afd 100644 --- a/os/hal/src/hal_can.c +++ b/os/hal/src/hal_can.c @@ -15,7 +15,7 @@ */ /** - * @file can.c + * @file hal_can.c * @brief CAN Driver code. * * @addtogroup CAN diff --git a/os/hal/src/hal_dac.c b/os/hal/src/hal_dac.c index 0feb4308f..3496bead5 100644 --- a/os/hal/src/hal_dac.c +++ b/os/hal/src/hal_dac.c @@ -15,7 +15,7 @@ */ /** - * @file dac.c + * @file hal_dac.c * @brief DAC Driver code. * * @addtogroup DAC diff --git a/os/hal/src/hal_ext.c b/os/hal/src/hal_ext.c index fa25e41a4..9d0c6ff33 100644 --- a/os/hal/src/hal_ext.c +++ b/os/hal/src/hal_ext.c @@ -15,7 +15,7 @@ */ /** - * @file ext.c + * @file hal_ext.c * @brief EXT Driver code. * * @addtogroup EXT diff --git a/os/hal/src/hal_gpt.c b/os/hal/src/hal_gpt.c index b83ffa1c1..cd08a2779 100644 --- a/os/hal/src/hal_gpt.c +++ b/os/hal/src/hal_gpt.c @@ -15,7 +15,7 @@ */ /** - * @file gpt.c + * @file hal_gpt.c * @brief GPT Driver code. * * @addtogroup GPT diff --git a/os/hal/src/hal_hal.c b/os/hal/src/hal_hal.c deleted file mode 100644 index 04cd0b2c5..000000000 --- a/os/hal/src/hal_hal.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file hal.c - * @brief HAL subsystem code. - * - * @addtogroup HAL - * @{ - */ - -#include "hal.h" - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver exported variables. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver local variables and types. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -/** - * @brief HAL initialization. - * @details This function invokes the low level initialization code then - * initializes all the drivers enabled in the HAL. Finally the - * board-specific initialization is performed by invoking - * @p boardInit() (usually defined in @p board.c). - * - * @init - */ -void halInit(void) { - - /* Initializes the OS Abstraction Layer.*/ - osalInit(); - - /* Platform low level initializations.*/ - hal_lld_init(); - -#if (HAL_USE_PAL == TRUE) || defined(__DOXYGEN__) - palInit(&pal_default_config); -#endif -#if (HAL_USE_ADC == TRUE) || defined(__DOXYGEN__) - adcInit(); -#endif -#if (HAL_USE_CAN == TRUE) || defined(__DOXYGEN__) - canInit(); -#endif -#if (HAL_USE_DAC == TRUE) || defined(__DOXYGEN__) - dacInit(); -#endif -#if (HAL_USE_EXT == TRUE) || defined(__DOXYGEN__) - extInit(); -#endif -#if (HAL_USE_GPT == TRUE) || defined(__DOXYGEN__) - gptInit(); -#endif -#if (HAL_USE_I2C == TRUE) || defined(__DOXYGEN__) - i2cInit(); -#endif -#if (HAL_USE_I2S == TRUE) || defined(__DOXYGEN__) - i2sInit(); -#endif -#if (HAL_USE_ICU == TRUE) || defined(__DOXYGEN__) - icuInit(); -#endif -#if (HAL_USE_MAC == TRUE) || defined(__DOXYGEN__) - macInit(); -#endif -#if (HAL_USE_PWM == TRUE) || defined(__DOXYGEN__) - pwmInit(); -#endif -#if (HAL_USE_SERIAL == TRUE) || defined(__DOXYGEN__) - sdInit(); -#endif -#if (HAL_USE_SDC == TRUE) || defined(__DOXYGEN__) - sdcInit(); -#endif -#if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__) - spiInit(); -#endif -#if (HAL_USE_UART == TRUE) || defined(__DOXYGEN__) - uartInit(); -#endif -#if (HAL_USE_USB == TRUE) || defined(__DOXYGEN__) - usbInit(); -#endif -#if (HAL_USE_MMC_SPI == TRUE) || defined(__DOXYGEN__) - mmcInit(); -#endif -#if (HAL_USE_SERIAL_USB == TRUE) || defined(__DOXYGEN__) - sduInit(); -#endif -#if (HAL_USE_RTC == TRUE) || defined(__DOXYGEN__) - rtcInit(); -#endif -#if (HAL_USE_WDG == TRUE) || defined(__DOXYGEN__) - wdgInit(); -#endif - - /* Community driver overlay initialization.*/ -#if defined(HAL_USE_COMMUNITY) || defined(__DOXYGEN__) -#if (HAL_USE_COMMUNITY == TRUE) || defined(__DOXYGEN__) - halCommunityInit(); -#endif -#endif - - /* Board specific initialization.*/ - boardInit(); - -/* - * The ST driver is a special case, it is only initialized if the OSAL is - * configured to require it. - */ -#if OSAL_ST_MODE != OSAL_ST_MODE_NONE - stInit(); -#endif -} - -/** @} */ diff --git a/os/hal/src/hal_i2c.c b/os/hal/src/hal_i2c.c index 0ed77eeaf..30e8809a1 100644 --- a/os/hal/src/hal_i2c.c +++ b/os/hal/src/hal_i2c.c @@ -19,7 +19,7 @@ */ /** - * @file i2c.c + * @file hal_i2c.c * @brief I2C Driver code. * * @addtogroup I2C diff --git a/os/hal/src/hal_i2s.c b/os/hal/src/hal_i2s.c index 57a43a7e3..2434e8477 100644 --- a/os/hal/src/hal_i2s.c +++ b/os/hal/src/hal_i2s.c @@ -15,7 +15,7 @@ */ /** - * @file i2s.c + * @file hal_i2s.c * @brief I2S Driver code. * * @addtogroup I2S diff --git a/os/hal/src/hal_icu.c b/os/hal/src/hal_icu.c index ab42dc8ce..8ee4ed8cd 100644 --- a/os/hal/src/hal_icu.c +++ b/os/hal/src/hal_icu.c @@ -15,7 +15,7 @@ */ /** - * @file icu.c + * @file hal_icu.c * @brief ICU Driver code. * * @addtogroup ICU diff --git a/os/hal/src/hal_mac.c b/os/hal/src/hal_mac.c index 18add7560..c4027f500 100644 --- a/os/hal/src/hal_mac.c +++ b/os/hal/src/hal_mac.c @@ -15,7 +15,7 @@ */ /** - * @file mac.c + * @file hal_mac.c * @brief MAC Driver code. * * @addtogroup MAC diff --git a/os/hal/src/hal_mmc_spi.c b/os/hal/src/hal_mmc_spi.c index acb0d6d2e..19c794501 100644 --- a/os/hal/src/hal_mmc_spi.c +++ b/os/hal/src/hal_mmc_spi.c @@ -18,7 +18,7 @@ */ /** - * @file mmc_spi.c + * @file hal_mmc_spi.c * @brief MMC over SPI driver code. * * @addtogroup MMC_SPI diff --git a/os/hal/src/hal_pal.c b/os/hal/src/hal_pal.c index f75e8d481..0be77ad70 100644 --- a/os/hal/src/hal_pal.c +++ b/os/hal/src/hal_pal.c @@ -15,7 +15,7 @@ */ /** - * @file pal.c + * @file hal_pal.c * @brief I/O Ports Abstraction Layer code. * * @addtogroup PAL diff --git a/os/hal/src/hal_pwm.c b/os/hal/src/hal_pwm.c index f74bf534c..e11011248 100644 --- a/os/hal/src/hal_pwm.c +++ b/os/hal/src/hal_pwm.c @@ -15,7 +15,7 @@ */ /** - * @file pwm.c + * @file hal_pwm.c * @brief PWM Driver code. * * @addtogroup PWM diff --git a/os/hal/src/hal_rtc.c b/os/hal/src/hal_rtc.c index 252bb7ab1..53ceb46fd 100644 --- a/os/hal/src/hal_rtc.c +++ b/os/hal/src/hal_rtc.c @@ -19,7 +19,7 @@ */ /** - * @file rtc.c + * @file hal_rtc.c * @brief RTC Driver code. * * @addtogroup RTC diff --git a/os/hal/src/hal_sdc.c b/os/hal/src/hal_sdc.c index bd2c0bef6..654f179e4 100644 --- a/os/hal/src/hal_sdc.c +++ b/os/hal/src/hal_sdc.c @@ -15,7 +15,7 @@ */ /** - * @file sdc.c + * @file hal_sdc.c * @brief SDC Driver code. * * @addtogroup SDC diff --git a/os/hal/src/hal_serial.c b/os/hal/src/hal_serial.c index a0956ba9a..0b578fdc4 100644 --- a/os/hal/src/hal_serial.c +++ b/os/hal/src/hal_serial.c @@ -15,7 +15,7 @@ */ /** - * @file serial.c + * @file hal_serial.c * @brief Serial Driver code. * * @addtogroup SERIAL diff --git a/os/hal/src/hal_serial_usb.c b/os/hal/src/hal_serial_usb.c index 9c21f7b56..adf5856c4 100644 --- a/os/hal/src/hal_serial_usb.c +++ b/os/hal/src/hal_serial_usb.c @@ -15,7 +15,7 @@ */ /** - * @file serial_usb.c + * @file hal_serial_usb.c * @brief Serial over USB Driver code. * * @addtogroup SERIAL_USB diff --git a/os/hal/src/hal_spi.c b/os/hal/src/hal_spi.c index 90907e8f4..86bd78677 100644 --- a/os/hal/src/hal_spi.c +++ b/os/hal/src/hal_spi.c @@ -15,7 +15,7 @@ */ /** - * @file spi.c + * @file hal_spi.c * @brief SPI Driver code. * * @addtogroup SPI diff --git a/os/hal/src/hal_st.c b/os/hal/src/hal_st.c index cf654f882..0a8b6e987 100644 --- a/os/hal/src/hal_st.c +++ b/os/hal/src/hal_st.c @@ -15,7 +15,7 @@ */ /** - * @file st.c + * @file hal_st.c * @brief ST Driver code. * * @addtogroup ST diff --git a/os/hal/src/hal_uart.c b/os/hal/src/hal_uart.c index 7bf0e5d74..8db39deb9 100644 --- a/os/hal/src/hal_uart.c +++ b/os/hal/src/hal_uart.c @@ -15,7 +15,7 @@ */ /** - * @file uart.c + * @file hal_uart.c * @brief UART Driver code. * * @addtogroup UART diff --git a/os/hal/src/hal_usb.c b/os/hal/src/hal_usb.c index d9fbc091a..bc0cf088b 100644 --- a/os/hal/src/hal_usb.c +++ b/os/hal/src/hal_usb.c @@ -15,7 +15,7 @@ */ /** - * @file usb.c + * @file hal_usb.c * @brief USB Driver code. * * @addtogroup USB diff --git a/os/hal/src/hal_wdg.c b/os/hal/src/hal_wdg.c index a764864a4..1b3ec70c6 100644 --- a/os/hal/src/hal_wdg.c +++ b/os/hal/src/hal_wdg.c @@ -15,7 +15,7 @@ */ /** - * @file wdg.c + * @file hal_wdg.c * @brief WDG Driver code. * * @addtogroup WDG -- cgit v1.2.3