diff options
author | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2022-04-08 09:54:53 +0100 |
---|---|---|
committer | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2022-04-08 12:30:28 +0100 |
commit | 4cc4021d356c174f780be2b7ef96910e36c8dd7b (patch) | |
tree | c2a790b914577873a368982a07a9491f6743443e /source/hal/include/hal.h | |
parent | 11b75cc7dc140119dee490f425e25a004122703b (diff) | |
download | ml-embedded-evaluation-kit-4cc4021d356c174f780be2b7ef96910e36c8dd7b.tar.gz |
MLECO-3070: Further HAL cleanup.
Cleaning up HAL sources by removing unnecessary redirections
with function pointers. The "platform packages" under HAL are
now streamlined enough to not need any major HAL wrapping (as
was the case before).
This allows us to have a very thin HAL layer that sits on top
of the platform and compnent packs. Also helps in getting rid
of "hal platform" pointer being passed around in the code to
use any HAL functionality.
Change-Id: I04b2057f972aad7a5cfb4a396bcdf147c9f9ef1c
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'source/hal/include/hal.h')
-rw-r--r-- | source/hal/include/hal.h | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/source/hal/include/hal.h b/source/hal/include/hal.h index 25ea1e2..5d1964d 100644 --- a/source/hal/include/hal.h +++ b/source/hal/include/hal.h @@ -29,47 +29,25 @@ extern "C" { #endif #include "platform_drivers.h" /* Platform drivers */ -#include "timer.h" /* Timer/profiler API */ +#include "hal_pmu.h" /* Timer/profiler API */ #include "hal_lcd.h" /* LCD functions */ #include <inttypes.h> #include <stdbool.h> -/* Structure to define a platform context to be used by the application */ -typedef struct hal_platform_context { - int inited; /**< initialised */ - char plat_name[64]; /**< name of this platform */ - platform_timer* timer; /**< timer */ - int (* platform_init)(); /**< pointer to platform initialisation function */ - void (* platform_release)(); /**< pointer to platform release function */ -} hal_platform; - -/** - * @brief Initialise the HAL structure based on compile time config. This - * should be called before any other function in this API. - * @param[in,out] platform Pointer to a pre-allocated platform struct. - * @param[in,out] timer Pointer to a pre-allocated timer module. - * @return 0 if successful, error code otherwise. - **/ -int hal_init(hal_platform* platform, platform_timer* timer); - - /** * @brief Initialise the HAL platform. This will go and initialise all the * modules on the platform the application requires to run. - * @param[in] platform Pointer to a pre-allocated and initialised - * platform structure. - * @return 0 if successful, error code otherwise. + * @return True if successful, false otherwise. **/ -int hal_platform_init(hal_platform* platform); +bool hal_platform_init(void); /** * @brief Release the HAL platform. This should release resources acquired. - * @param[in] platform pointer to a pre-allocated and initialised * platform structure. **/ -void hal_platform_release(hal_platform* platform); +void hal_platform_release(void); /** * @brief Gets user input from the stdin interface. |