fork/GramFirmware

git clone https://git.julia.blue/fork/GramFirmware

CarVacrebase to configurator818d962

gram
670 B29 linesraw
1#ifndef _INPUT_GPIOBUTTONINPUT_HPP
2#define _INPUT_GPIOBUTTONINPUT_HPP
3
4#include "core/InputSource.hpp"
5#include "core/state.hpp"
6#include "stdlib.hpp"
7
8#include <config.pb.h>
9
10typedef struct {
11    Button button;
12    uint pin;
13} GpioButtonMapping;
14
15class GpioButtonInput : public InputSource {
16  public:
17    GpioButtonInput(const GpioButtonMapping *button_mappings, size_t button_count);
18    InputScanSpeed ScanSpeed();
19    void UpdateInputs(InputState &inputs);
20
21  protected:
22    const GpioButtonMapping *_button_mappings;
23    size_t _button_count;
24
25  private:
26    virtual void UpdateButtonState(InputState &inputs, size_t button_mapping_index, bool pressed);
27};
28
29#endif