Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
drivers.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_DRIVERS_HPP_
25#define TAPROOT_DRIVERS_HPP_
26
27#if defined(PLATFORM_HOSTED) && defined(ENV_UNIT_TESTS)
29#include "tap/mock/analog_mock.hpp"
30#include "tap/mock/bmi088_mock.hpp"
31#include "tap/mock/can_mock.hpp"
32#include "tap/mock/can_rx_handler_mock.hpp"
33#include "tap/mock/command_mapper_mock.hpp"
34#include "tap/mock/digital_mock.hpp"
35#include "tap/mock/dji_motor_terminal_serial_handler_mock.hpp"
36#include "tap/mock/dji_motor_tx_handler_mock.hpp"
37#include "tap/mock/error_controller_mock.hpp"
38#include "tap/mock/leds_mock.hpp"
39#include "tap/mock/pwm_mock.hpp"
40#include "tap/mock/ref_serial_mock.hpp"
41#include "tap/mock/remote_mock.hpp"
42#include "tap/mock/scheduler_terminal_handler_mock.hpp"
43#include "tap/mock/terminal_serial_mock.hpp"
44#include "tap/mock/uart_mock.hpp"
45#include "tap/mock/command_scheduler_mock.hpp"
46#else
65#endif
66
67namespace tap
68{
70{
71 friend class DriversSingleton;
72
73#ifdef ENV_UNIT_TESTS
74public:
75#else
76protected:
77#endif
79 : profiler(this),
80 analog(),
81 can(),
82 canRxHandler(this),
83 digital(),
84 leds(),
85 pwm(),
86 refSerial(this),
87 remote(this),
88 uart(),
89 terminalSerial(this),
90 commandMapper(this),
92 errorController(this),
95 bmi088(this),
96#ifdef ENV_UNIT_TESTS
98#else
99 commandScheduler(this, true)
100#endif
101 {}
102
103#if defined(PLATFORM_HOSTED) && defined(ENV_UNIT_TESTS)
105 testing::NiceMock<mock::AnalogMock> analog;
106 testing::NiceMock<mock::CanMock> can;
107 testing::NiceMock<mock::CanRxHandlerMock> canRxHandler;
108 testing::NiceMock<mock::DigitalMock> digital;
109 testing::NiceMock<mock::LedsMock> leds;
110 testing::NiceMock<mock::PwmMock> pwm;
111 testing::NiceMock<mock::RefSerialMock> refSerial;
112 testing::NiceMock<mock::RemoteMock> remote;
113 testing::NiceMock<mock::UartMock> uart;
114 testing::NiceMock<mock::TerminalSerialMock> terminalSerial;
115 testing::NiceMock<mock::CommandMapperMock> commandMapper;
116 testing::NiceMock<mock::SchedulerTerminalHandlerMock> schedulerTerminalHandler;
117 testing::StrictMock<mock::ErrorControllerMock> errorController;
118 testing::NiceMock<mock::DjiMotorTerminalSerialHandlerMock> djiMotorTerminalSerialHandler;
119 testing::NiceMock<mock::DjiMotorTxHandlerMock> djiMotorTxHandler;
120 testing::NiceMock<mock::Bmi088Mock> bmi088;
121 testing::NiceMock<mock::CommandSchedulerMock> commandScheduler;
122#else
123public:
140 communication::sensors::imu::bmi088::Bmi088 bmi088;
142#endif
143}; // class Drivers
144
145} // namespace tap
146
147#endif // TAPROOT_DRIVERS_HPP_
Definition drivers.hpp:70
can::Can can
Definition drivers.hpp:126
can::CanRxHandler canRxHandler
Definition drivers.hpp:127
errors::ErrorController errorController
Definition drivers.hpp:137
gpio::Leds leds
Definition drivers.hpp:129
gpio::Analog analog
Definition drivers.hpp:125
motor::DjiMotorTerminalSerialHandler djiMotorTerminalSerialHandler
Definition drivers.hpp:138
motor::DjiMotorTxHandler djiMotorTxHandler
Definition drivers.hpp:139
communication::serial::TerminalSerial terminalSerial
Definition drivers.hpp:134
communication::serial::Remote remote
Definition drivers.hpp:132
communication::serial::RefSerial refSerial
Definition drivers.hpp:131
gpio::Digital digital
Definition drivers.hpp:128
control::CommandMapper commandMapper
Definition drivers.hpp:135
communication::serial::Uart uart
Definition drivers.hpp:133
arch::Profiler profiler
Definition drivers.hpp:124
friend class DriversSingleton
Definition drivers.hpp:71
control::CommandScheduler commandScheduler
Definition drivers.hpp:141
gpio::Pwm pwm
Definition drivers.hpp:130
Drivers()
Definition drivers.hpp:78
communication::sensors::imu::bmi088::Bmi088 bmi088
Definition drivers.hpp:140
control::SchedulerTerminalHandler schedulerTerminalHandler
Definition drivers.hpp:136
Definition profiler.hpp:99
Definition can_rx_handler.hpp:79
Definition can.hpp:44
Definition ref_serial.hpp:63
Definition remote.hpp:51
Definition terminal_serial.hpp:104
Definition uart.hpp:48
Definition command_mapper.hpp:68
Definition command_scheduler.hpp:118
Definition scheduler_terminal_handler.hpp:36
Definition error_controller.hpp:49
Definition analog.hpp:44
Definition digital.hpp:48
Definition leds.hpp:40
Definition pwm.hpp:43
Definition dji_motor_terminal_serial_handler.hpp:40
Definition dji_motor_tx_handler.hpp:74
Definition ballistics.cpp:29