You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.2 KiB
C++
65 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "DSP28x_Project.h"
|
|
#include "DSP2833x_Device.h"
|
|
#include "Protocol/CAN.h"
|
|
#include "Protocol/CAN_data.h"
|
|
#include "Protocol/DigitalIO.h"
|
|
#include "Protocol/MemoryMap.h"
|
|
|
|
#include "DSP28335/SCIBase.h"
|
|
#include "DSP28335/SCIB.h"
|
|
|
|
#include "ModbusRTU.h"
|
|
|
|
|
|
struct SoftwareVersion{
|
|
Uint16 DSP;
|
|
Uint16 CPLD;
|
|
};
|
|
|
|
class Periphery{
|
|
public:
|
|
Periphery();
|
|
void config();
|
|
Uint16 getVersionFPGA();
|
|
void updateVersionFPGA();
|
|
|
|
void receiveModbusParameters();
|
|
void getModbusConfiguration();
|
|
void initModbusTable(); // TODO Must be outside periphery!
|
|
|
|
void processDigitalInput();
|
|
void processDigitalOutput();
|
|
|
|
void sendModbusDataToCPU();
|
|
void receiveCpuModbusData();
|
|
|
|
private:
|
|
canSpace::CAN _canb;
|
|
interface::DigitalIO _digitalIO;
|
|
Uint16* _zone6_ptr;
|
|
|
|
DSP28335::SCIB _scib;
|
|
|
|
SoftwareVersion _softVersion;
|
|
canSpace::CANMessage _message;
|
|
bool _modbusInitFlag;
|
|
bool _error;
|
|
uint16_t _modbusRegCounter;
|
|
|
|
float test_hmi_float_reg_400_test;
|
|
float test_hmi_float_reg_401_test;
|
|
float test_hmi_float_reg_402_test;
|
|
float test_hmi_float_reg_403_test;
|
|
float test_hmi_float_reg_404_test;
|
|
|
|
public:
|
|
MODBUSRTU::ModbusRTU modbusRTU;
|
|
};
|
|
|
|
|
|
|