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.
121 lines
2.9 KiB
C
121 lines
2.9 KiB
C
4 weeks ago
|
/*
|
||
|
* SYSCore.h
|
||
|
*
|
||
|
* Author: Aleksey Gerasimenko
|
||
|
* gerasimenko.aleksey.n@gmail.com
|
||
|
*/
|
||
|
|
||
|
#include "F28335/DSP28x_Project.h"
|
||
|
|
||
|
#include "DSP28335/ADC.h"
|
||
|
#include "DSP28335/CPUTimers.h"
|
||
|
#include "DSP28335/DiscreteOutputs.h"
|
||
|
#include "DSP28335/ECANA.h"
|
||
|
#include "DSP28335/ECANB.h"
|
||
|
#include "DSP28335/EPWM.h"
|
||
|
#include "DSP28335/EQEP1.h"
|
||
|
#include "DSP28335/GPIO.h"
|
||
|
#include "DSP28335/CPUBase.h"
|
||
|
#include "DSP28335/MeasureTimeInterval.h"
|
||
|
#include "DSP28335/MeasureTimePeriod.h"
|
||
|
#include "DSP28335/MemoryZone.h"
|
||
|
#include "DSP28335/MemoryZone0.h"
|
||
|
#include "DSP28335/MemoryZone7.h"
|
||
|
#include "DSP28335/SCIA.h"
|
||
|
#include "DSP28335/SCIB.h"
|
||
|
#include "DSP28335/SCIBase.h"
|
||
|
#include "DSP28335/SCIC.h"
|
||
|
#include "DSP28335/SPIBase.h"
|
||
|
#include "DSP28335/SPIA.h"
|
||
|
#include "DSP28335/XINTF.h"
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#ifndef DSP28335_CPUCORE_H_
|
||
|
#define DSP28335_CPUCORE_H_
|
||
|
|
||
|
namespace DSP28335
|
||
|
{
|
||
|
|
||
|
|
||
|
struct CPUSetup
|
||
|
{
|
||
|
DSP28335::SCISetup scib;
|
||
|
DSP28335::SCISetup scic;
|
||
|
DSP28335::CPUTimersSetup timers;
|
||
|
DSP28335::EPWMSetup epwm;
|
||
|
DSP28335::XINTFSetup xintf;
|
||
|
// DSP28335::ECANASetup ecana;
|
||
|
// DSP28335::ECANBSetup ecanb;
|
||
|
// DSP28335::EQEP1Setup eqep1;
|
||
|
// DSP28335::DiscreteOutputsSetup dout;
|
||
|
// Uint16 period_sync;
|
||
|
// Uint16 startup_period;
|
||
|
CPUSetup():
|
||
|
scib(),
|
||
|
scic(),
|
||
|
timers(),
|
||
|
epwm(),
|
||
|
xintf()
|
||
|
// ecana(),
|
||
|
// ecanb(),
|
||
|
// eqep1(),
|
||
|
// dout(),
|
||
|
// period_sync(0),
|
||
|
// startup_period(0)
|
||
|
{}
|
||
|
};//end SYSCoreSetup
|
||
|
|
||
|
|
||
|
struct CPUConfiguration
|
||
|
{
|
||
|
DSP28335::SCIConfiguration scib;
|
||
|
DSP28335::SCIConfiguration scic;
|
||
|
DSP28335::EPWMConfiguration epwm;
|
||
|
CPUConfiguration():
|
||
|
scib(),
|
||
|
scic(),
|
||
|
epwm()
|
||
|
{}
|
||
|
};//CPUConfiguration
|
||
|
|
||
|
|
||
|
class CPU: public DSP28335::CPUBase
|
||
|
{
|
||
|
public:
|
||
|
// DSP28335::GPIO gpio;
|
||
|
DSP28335::SCIB scib;
|
||
|
// DSP28335::SCIC scic;
|
||
|
// DSP28335::CPUTimers cpu_timers;
|
||
|
// DSP28335::EPWM epwm;
|
||
|
// DSP28335::MeasureTimePeriod period_measure;
|
||
|
DSP28335::MeasureTimeInterval interval_measure;
|
||
|
// DSP28335::XINTF xintf;
|
||
|
// DSP28335::ECANA ecana;
|
||
|
// DSP28335::ECANB ecanb;
|
||
|
// DSP28335::EQEP1 eqep1;
|
||
|
// DSP28335::DiscreteOutputs dout;
|
||
|
private:
|
||
|
// Uint16 m_counter_startup;
|
||
|
// Uint16 m_counter_sync;
|
||
|
public:
|
||
|
CPU();
|
||
|
public:
|
||
|
void setup(DSP28335::CPUSetup& setup);
|
||
|
void get_hard_code_setup(DSP28335::CPUSetup& hsetup);
|
||
|
public:
|
||
|
void execute();
|
||
|
private:
|
||
|
void (CPU::*_execute)();
|
||
|
void _execute_undef();
|
||
|
void _execute_mode_i();
|
||
|
void _execute_mode_ii();
|
||
|
void _execute_mode_iii();
|
||
|
//
|
||
|
};// CPU
|
||
|
|
||
|
} /* namespace DSP28335 */
|
||
|
|
||
|
#endif /* DSP28335_CPUCORE_H_ */
|