24#ifndef TAPROOT_DJI_MOTOR_TX_HANDLER_HPP_
25#define TAPROOT_DJI_MOTOR_TX_HANDLER_HPP_
31#include "modm/architecture/interface/can_message.hpp"
50#define DJI_MOTOR_TO_NORMALIZED_ID(id) \
51 static_cast<uint32_t>( \
52 (id < tap::motor::MOTOR1) ? (tap::motor::DjiMotorTxHandler::DJI_MOTORS_PER_CAN) \
53 : (id - tap::motor::MOTOR1))
60#define NORMALIZED_ID_TO_DJI_MOTOR(idx) \
61 static_cast<tap::motor::MotorId>(idx + static_cast<int32_t>(tap::motor::MotorId::MOTOR1))
123 modm::can::Message* messageLow,
124 modm::can::Message* messageHigh,
125 modm::can::Message* message6020Current,
126 bool* validMotorMessageLow,
127 bool* validMotorMessageHigh,
128 bool* validMotorMessage6020Current);
Definition drivers.hpp:70
Definition dji_motor_tx_handler.hpp:74
mockable void addMotorToManager(DjiMotor *motor)
Definition dji_motor_tx_handler.cpp:49
DjiMotor * can1MotorStore[DJI_MOTORS_PER_CAN]
Definition dji_motor_tx_handler.hpp:116
static constexpr int DJI_MOTORS_PER_CAN
Definition dji_motor_tx_handler.hpp:77
static constexpr uint32_t CAN_DJI_6020_CURRENT_IDENTIFIER
Definition dji_motor_tx_handler.hpp:85
mockable void removeFromMotorManager(const DjiMotor &motor)
Definition dji_motor_tx_handler.cpp:198
static constexpr uint32_t CAN_DJI_HIGH_IDENTIFIER
Definition dji_motor_tx_handler.hpp:83
mockable void encodeAndSendCanData()
Definition dji_motor_tx_handler.cpp:64
mockable DjiMotor const * getCan1Motor(MotorId motorId)
Definition dji_motor_tx_handler.cpp:221
mockable ~DjiMotorTxHandler()=default
static constexpr uint32_t CAN_DJI_LOW_IDENTIFIER
Definition dji_motor_tx_handler.hpp:81
void serializeMotorStoreSendData(DjiMotor **canMotorStore, modm::can::Message *messageLow, modm::can::Message *messageHigh, modm::can::Message *message6020Current, bool *validMotorMessageLow, bool *validMotorMessageHigh, bool *validMotorMessage6020Current)
Definition dji_motor_tx_handler.cpp:164
static constexpr int CAN_DJI_MESSAGE_SEND_LENGTH
Definition dji_motor_tx_handler.hpp:79
DjiMotorTxHandler(Drivers *drivers)
Definition dji_motor_tx_handler.hpp:87
DjiMotor * can2MotorStore[DJI_MOTORS_PER_CAN]
Definition dji_motor_tx_handler.hpp:117
mockable DjiMotor const * getCan2Motor(MotorId motorId)
Definition dji_motor_tx_handler.cpp:227
Drivers * drivers
Definition dji_motor_tx_handler.hpp:114
Definition dji_motor.hpp:71
Definition brushlessutils.cpp:4
Definition dji_motor.cpp:41
MotorId
Definition dji_motor_ids.hpp:38
Definition ballistics.cpp:29
tap::Drivers Drivers
Definition drivers.hpp:11
#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