blob: 1a1a0448d73baf5f27581291c3d71df20d224e45 [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
Richard Burtonf32a86a2022-11-15 11:46:11 +00002 * SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
alexander3c798932021-03-26 21:42:19 +00003 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef PLATFORM_HAL_H
18#define PLATFORM_HAL_H
19
20/**
21 * This file should present a C API for the main application logic to use
22 * and be indifferent to the lower level platform. In addition to this it
23 * will also need to be aware of the API exposed by data acquisition and
24 * data presentation modules.
25 */
alexander3c798932021-03-26 21:42:19 +000026
27#ifdef __cplusplus
28extern "C" {
29#endif
30
Kshitij Sisodia68fdd112022-04-06 13:03:20 +010031#include "platform_drivers.h" /* Platform drivers */
Kshitij Sisodia4cc40212022-04-08 09:54:53 +010032#include "hal_pmu.h" /* Timer/profiler API */
Kshitij Sisodia68fdd112022-04-06 13:03:20 +010033#include "hal_lcd.h" /* LCD functions */
alexander3c798932021-03-26 21:42:19 +000034
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010035#include <inttypes.h>
Kshitij Sisodia68fdd112022-04-06 13:03:20 +010036#include <stdbool.h>
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010037
alexander3c798932021-03-26 21:42:19 +000038/**
39 * @brief Initialise the HAL platform. This will go and initialise all the
40 * modules on the platform the application requires to run.
Kshitij Sisodia4cc40212022-04-08 09:54:53 +010041 * @return True if successful, false otherwise.
alexander3c798932021-03-26 21:42:19 +000042 **/
Kshitij Sisodia4cc40212022-04-08 09:54:53 +010043bool hal_platform_init(void);
alexander3c798932021-03-26 21:42:19 +000044
45
46/**
47 * @brief Release the HAL platform. This should release resources acquired.
alexander3c798932021-03-26 21:42:19 +000048 * platform structure.
49 **/
Kshitij Sisodia4cc40212022-04-08 09:54:53 +010050void hal_platform_release(void);
Kshitij Sisodia68fdd112022-04-06 13:03:20 +010051
52/**
53 * @brief Gets user input from the stdin interface.
54 * @param[out] user_input Pointer to a buffer where the input will be stored.
55 * @param[in] size Buffer size in bytes.
56 * @return True if successful, false otherwise.
57 */
58bool hal_get_user_input(char* user_input, int size);
alexander3c798932021-03-26 21:42:19 +000059
60#ifdef __cplusplus
61}
62#endif
63
64#endif /* PLATFORM_HAL_H */