Commit 1e0ff9f1 authored by virtualabs's avatar virtualabs
Browse files

Added support for DRV2605L into PMU.

parent 8d44d2c3
......@@ -352,3 +352,23 @@ int twatch_pmu_get_battery_level(void)
return level;
}
/**
* twatch_pmu_vibration()
*
* @brief Set DRV2605L EN pin to high (enabled) or low (disabled)
* @param enable: enable DRV2605L
* @return: ESP_OK on success, ESP_FAIL otherwise
**/
esp_err_t twatch_pmu_vibration(bool enable)
{
/* Only for T-Watch 2020 v2. */
#ifdef CONFIG_TWATCH_V2
return (axpxx_setGPIOMode(
AXP_GPIO_0,
enable ? AXP_IO_OUTPUT_HIGH_MODE : AXP_IO_OUTPUT_LOW_MODE
) == AXP_PASS);
#endif
}
\ No newline at end of file
......@@ -14,11 +14,13 @@ void twatch_pmu_reset_touchscreen(void);
esp_err_t twatch_pmu_audio_power(bool enable);
esp_err_t twatch_pmu_screen_power(bool enable);
/* DRV2605 management. */
esp_err_t twatch_pmu_vibration(bool enable);
/* User button. */
void twatch_pmu_read_irq(void);
bool twatch_pmu_is_userbtn_pressed(void);
/* Deep sleep */
void twatch_pmu_deepsleep(void);
......
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