summaryrefslogtreecommitdiff
path: root/src/components/motor/MotorController.h
blob: d3b96b07c289c24b9b376a93bf554b3fa12f6c71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <cstdint>
#include "app_timer.h"
#include "components/settings/Settings.h"

namespace Pinetime {
  namespace Controllers {
    static constexpr uint8_t pinMotor = 16;

    class MotorController {
    public:
      MotorController(Controllers::Settings& settingsController);
      void Init();
      void RunForDuration(uint8_t motorDuration);
      void StartRinging();
      static void StopRinging();
      void StartRingingDisregardSettings();

    private:
      static void Ring(void* p_context);
      Controllers::Settings& settingsController;
      static void StopMotor(void* p_context);
    };
  }
}