saleae-iec-analyser/source/C64SerialAnalyzer.h

58 lines
1.5 KiB
C++

#ifndef C64SERIAL_ANALYZER_H
#define C64SERIAL_ANALYZER_H
#include "C64SerialAnalyzerResults.h"
#include "C64SerialSimulationDataGenerator.h"
#include <Analyzer.h>
class C64SerialAnalyzerSettings;
class ANALYZER_EXPORT C64SerialAnalyzer : public Analyzer2 {
public:
C64SerialAnalyzer();
virtual ~C64SerialAnalyzer();
virtual void SetupResults();
virtual void WorkerThread();
virtual U32
GenerateSimulationData(U64 newest_sample_requested, U32 sample_rate,
SimulationChannelDescriptor **simulation_channels);
virtual U32 GetMinimumSampleRateHz();
virtual const char *GetAnalyzerName() const;
virtual bool NeedsRerun();
enum class State : U8 {
Idle,
Attention,
Talking,
TurnAround,
} mState;
protected:
void Update();
bool ReceiveByte();
U64 AdvanceTo(U64 sample);
std::auto_ptr<C64SerialAnalyzerSettings> mSettings;
std::auto_ptr<C64SerialAnalyzerResults> mResults;
AnalyzerChannelData *mAttention;
AnalyzerChannelData *mData;
AnalyzerChannelData *mClock;
C64SerialSimulationDataGenerator mSimulationDataGenerator;
bool mSimulationInitilized;
// Serial analysis vars:
U32 mSampleRateHz;
U32 mStartOfStopBitOffset;
U32 mEndOfStopBitOffset;
};
extern "C" ANALYZER_EXPORT const char *__cdecl GetAnalyzerName();
extern "C" ANALYZER_EXPORT Analyzer *__cdecl CreateAnalyzer();
extern "C" ANALYZER_EXPORT void __cdecl DestroyAnalyzer(Analyzer *analyzer);
#endif // C64SERIAL_ANALYZER_H