aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/hal.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-04-02 07:43:00 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-04-02 07:43:00 +0000
commit972107af04d60d05666bdc5b36ff537cc44511af (patch)
tree0bbbc822e3bc575e068d7a058dbf921e84d0020e /os/hal/src/hal.c
parent32868225ce0e9ca493c79fd802ff633d00ceb24a (diff)
downloadChibiOS-972107af04d60d05666bdc5b36ff537cc44511af.tar.gz
ChibiOS-972107af04d60d05666bdc5b36ff537cc44511af.tar.bz2
ChibiOS-972107af04d60d05666bdc5b36ff537cc44511af.zip
Adjusted HAL file names.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9204 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/hal.c')
-rw-r--r--os/hal/src/hal.c144
1 files changed, 144 insertions, 0 deletions
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
+}
+
+/** @} */