Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
digital.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_DIGITAL_HPP_
25#define TAPROOT_DIGITAL_HPP_
26
27#ifndef PLATFORM_HOSTED
28#include "modm/platform.hpp"
29#endif
30
31#include <cstdint>
32
33#include "tap/util_macros.hpp"
34
35namespace tap
36{
37namespace gpio
38{
48{
49public:
50 Digital() = default;
52 mockable ~Digital() = default;
53
58 {
62 };
63
68 {
73 };
74
75#ifdef PLATFORM_HOSTED
76 enum InputPullMode
77 {
78 Floating,
79 PullUp,
80 PullDown
81 };
82#else
86 using InputPullMode = modm::platform::Gpio::InputType;
87#endif
88
93 mockable void init();
94
103
110 mockable void set(OutputPin pin, bool isSet);
111
118 mockable bool read(InputPin pin) const;
119}; // class Digital
120
121} // namespace gpio
122
123} // namespace tap
124
125#endif // TAPROOT_DIGITAL_HPP_
Definition digital.hpp:48
InputPin
Definition digital.hpp:58
@ PF1
Definition digital.hpp:59
@ PF0
Definition digital.hpp:60
@ B12
Definition digital.hpp:61
mockable void configureInputPullMode(InputPin pin, InputPullMode mode)
Definition digital.cpp:46
mockable void init()
Definition digital.cpp:35
mockable void set(OutputPin pin, bool isSet)
Definition digital.cpp:67
modm::platform::Gpio::InputType InputPullMode
Definition digital.hpp:86
mockable bool read(InputPin pin) const
Definition digital.cpp:91
OutputPin
Definition digital.hpp:68
@ Laser
Definition digital.hpp:72
@ B15
Definition digital.hpp:71
@ B14
Definition digital.hpp:70
@ B13
Definition digital.hpp:69
Definition ballistics.cpp:29
#define mockable
Wrap class functions that are not already virtual in this function if you wish to mock them.
Definition util_macros.hpp:38
#define DISALLOW_COPY_AND_ASSIGN(Typename)
Definition util_macros.hpp:27