Commit 5391fc2b authored by virtualabs's avatar virtualabs
Browse files

Added HAL init routine.

parent 11103978
#include "hal/hal.h"
/**
* twatch_hal_init()
*
* @brief Initialize hardware abstraction layer
**/
bool twatch_hal_init(void)
{
/* Initialize I2C */
twatch_i2c_init();
/* Initialize Power Management Unit. */
if (twatch_pmu_init() != ESP_OK)
{
return false;
}
/* Initialize screen. */
if (twatch_screen_init() != ESP_OK)
{
return false;
}
/* Initialize touch screen. */
if (twatch_touch_init() != ESP_OK)
{
return false;
}
#ifdef CONFIG_TWATCH_V1
/* Initialize vibrate */
if (twatch_vibrate_init() != ESP_OK)
{
return false;
}
/* Initialize audio. */
if (twatch_audio_init() != ESP_OK)
{
return false;
}
#endif
/* Success ! */
return true;
}
\ No newline at end of file
#ifndef __INC_TWATCH_HAL_H
#define __INC_TWATCH_HAL_H
#include "drivers/i2c.h"
#include "hal/pmu.h"
#include "hal/screen.h"
#include "hal/rtc.h"
#include "hal/touch.h"
#include "hal/vibrate.h"
#include "hal/audio.h"
bool twatch_hal_init(void);
#endif /* __INC_TWATCH_HAL_H */
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment