2021-01-16 04:11:53 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
2021-01-25 18:44:58 +01:00
|
|
|
#include "app_timer.h"
|
2021-04-04 04:08:51 +02:00
|
|
|
#include "components/settings/Settings.h"
|
2021-01-16 04:11:53 +01:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
static constexpr uint8_t pinMotor = 16;
|
|
|
|
|
|
|
|
class MotorController {
|
2021-04-24 11:00:45 +02:00
|
|
|
public:
|
2021-04-18 19:28:14 +02:00
|
|
|
MotorController(Controllers::Settings& settingsController);
|
|
|
|
void Init();
|
2021-08-01 12:05:48 +02:00
|
|
|
void RunForDuration(uint8_t motorDuration);
|
|
|
|
void StartRinging();
|
|
|
|
static void StopRinging();
|
2021-01-16 04:49:37 +01:00
|
|
|
|
2021-04-24 11:00:45 +02:00
|
|
|
private:
|
2021-08-01 12:05:48 +02:00
|
|
|
static void Ring(void* p_context);
|
2021-04-18 19:28:14 +02:00
|
|
|
Controllers::Settings& settingsController;
|
2021-08-01 12:05:48 +02:00
|
|
|
static void StopMotor(void* p_context);
|
|
|
|
};
|
2021-01-16 04:11:53 +01:00
|
|
|
}
|
2021-01-25 18:44:58 +01:00
|
|
|
}
|