/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : hal.h
  * @brief          : Hardware Abstraction Layer common header file
  ******************************************************************************
  */
/* USER CODE END Header */

#ifndef HAL_H
#define HAL_H

/* Define supported architectures */
#define HAL_ARCH_STM32F1 0
#define HAL_ARCH_STM32F4 1
#define HAL_ARCH_STM32F7 2
#define HAL_ARCH_STM32L4 3

/* Select target architecture */
#ifndef HAL_TARGET_ARCH
#define HAL_TARGET_ARCH HAL_ARCH_STM32F4
#endif

/* Include architecture specific headers */
#if HAL_TARGET_ARCH == HAL_ARCH_STM32F1
#include "arch/stm32f1/hal_stm32f1.h"
#elif HAL_TARGET_ARCH == HAL_ARCH_STM32F4
#include "arch/stm32f4/hal_stm32f4.h"
#elif HAL_TARGET_ARCH == HAL_ARCH_STM32F7
#include "arch/stm32f7/hal_stm32f7.h"
#elif HAL_TARGET_ARCH == HAL_ARCH_STM32L4
#include "arch/stm32l4/hal_stm32l4.h"
#else
#error "Unsupported HAL architecture: " #HAL_TARGET_ARCH
#endif

/* Architecture compatibility check */
#if HAL_TARGET_ARCH < HAL_ARCH_STM32F1 || HAL_TARGET_ARCH > HAL_ARCH_STM32L4
#error "Invalid HAL architecture selection"
#endif

/**
 * @brief HAL module initialization
 */
void hal_init(void);

#endif /* HAL_H */
