~aleteoryx/muditaos

ref: 441b9b4667d284698f585f9302eace456861a73f muditaos/module-bsp/hal/key_input/AbstractKeyInput.hpp -rw-r--r-- 921 bytes
441b9b46 — Maciej Janicki [BH-715] Add switches handling 4 years ago
                                                                                
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
27
28
29
30
31
32
33
34
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "KeyEventDefinitions.hpp"

#include <FreeRTOS.h>
#include <queue.h>

#include <memory>
#include <vector>

namespace hal::key_input
{
    class AbstractKeyInput
    {
      public:
        struct Factory
        {
            static std::shared_ptr<AbstractKeyInput> create();
        };

        virtual ~AbstractKeyInput() = default;

        virtual void init(xQueueHandle)                                        = 0;
        virtual void deinit()                                                  = 0;
        virtual std::vector<bsp::KeyEvent> getKeyEvents(KeyNotificationSource) = 0;
    };

    BaseType_t generalIRQHandler(std::uint32_t irqMask);
    BaseType_t rightFunctionalIRQHandler();
    BaseType_t wakeupIRQHandler();
} // namespace hal::key_input