-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy paste deletion
- Loading branch information
Showing
2 changed files
with
578 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* This file is part of the tumanako_vc project. | ||
* | ||
* Copyright (C) 2020 Johannes Huebner <[email protected]> | ||
* Damien Maguire <[email protected]> | ||
* Yes I'm really writing software now........run.....run away....... | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef CAN_OI_H | ||
#define CAN_OI_H | ||
|
||
#include "inverter.h" | ||
#include "canhardware.h" | ||
#include <stdint.h> | ||
|
||
#define NODEIDCANOI 1 | ||
|
||
class Can_OI: public Inverter | ||
{ | ||
public: | ||
void Task100Ms() override; | ||
void DecodeCAN(int, uint32_t*) override; | ||
void SetTorque(float torquePercent) override; | ||
float GetMotorTemperature() override | ||
{ | ||
return motor_temp; | ||
} | ||
float GetInverterTemperature() override | ||
{ | ||
return inv_temp; | ||
} | ||
float GetInverterVoltage() override | ||
{ | ||
return voltage; | ||
} | ||
float GetMotorSpeed() override | ||
{ | ||
return speed; | ||
} | ||
int GetInverterState() override; | ||
void SetCanInterface(CanHardware* c) override; | ||
void ConfigCan(); | ||
|
||
private: | ||
static int16_t speed; | ||
static int16_t inv_temp; | ||
static int16_t motor_temp; | ||
static uint16_t voltage; | ||
static int16_t final_torque_request; | ||
static void handleSDO(uint32_t data[2]); | ||
}; | ||
|
||
#endif // CAN_OI_H |
Oops, something went wrong.