diff options
Diffstat (limited to 'source/hal/include')
-rw-r--r-- | source/hal/include/hal.h | 30 | ||||
-rw-r--r-- | source/hal/include/hal_pmu.h (renamed from source/hal/include/timer.h) | 28 |
2 files changed, 19 insertions, 39 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. diff --git a/source/hal/include/timer.h b/source/hal/include/hal_pmu.h index 9910fcf..5bfe517 100644 --- a/source/hal/include/timer.h +++ b/source/hal/include/hal_pmu.h @@ -14,23 +14,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef HAL_TIMER_H -#define HAL_TIMER_H +#ifndef HAL_PMU_H +#define HAL_PMU_H -#include "platform_drivers.h" /* Platform package API */ -#include "user_input.h" /* PMU structs and API */ +#include "platform_pmu.h" -/* Structure to hold a platform specific timer implementation */ -typedef struct _platform_timer { - int inited; /**< Initialised or not. */ - void (* reset)(void); /**< Reset the timer. */ - pmu_counters (* get_counters)(void); /**< Gets the current time counter. */ +/** + * @brief Initialise the PMU available for the platform. + **/ +void hal_pmu_init(void); -} platform_timer; +/** + * @brief Resets the counters. + */ +void hal_pmu_reset(void); /** - * @brief Initialise the timer available for the platform. + * @brief Gets the current counter values. + * @param[out] Pointer to a pmu_counters object. **/ -void init_timer(platform_timer* timer); +void hal_pmu_get_counters(pmu_counters* counters); -#endif /* HAL_TIMER_H */ +#endif /* HAL_PMU_H */ |