
Builds a native program on MacOS that runs the NuEVI firmware compiled for x86_64. Only input is arrow keys for menu buttons for now. Only output is console and display. Copied some more library files into the simulation folder, and renamed the modified *.cpp files from the libraries to *_sim.cpp.
38 lines
861 B
C++
38 lines
861 B
C++
#ifndef __WIRE_H__
|
|
#define __WIRE_H__
|
|
|
|
#include <cstdint>
|
|
#define TwoWire SimWire
|
|
|
|
class SimWire
|
|
{
|
|
public:
|
|
SimWire(bool verbose = false);
|
|
|
|
void begin();
|
|
void begin( uint8_t address ); // For slaves.
|
|
void end();
|
|
void setClock(uint32_t);
|
|
void beginTransmission(uint8_t address);
|
|
void beginTransmission(int);
|
|
uint8_t endTransmission();
|
|
uint8_t endTransmission(uint8_t);
|
|
uint8_t requestFrom(uint8_t address, uint8_t count);
|
|
uint8_t requestFrom(uint8_t, uint8_t, uint8_t);
|
|
uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t);
|
|
size_t write(uint8_t);
|
|
size_t write(const uint8_t *, size_t);
|
|
int available();
|
|
int read();
|
|
int peek();
|
|
void flush();
|
|
void onReceive( void (*)(int) );
|
|
void onRequest( void (*)(void) );
|
|
private:
|
|
bool verbose_;
|
|
};
|
|
|
|
extern SimWire Wire;
|
|
|
|
|
|
#endif
|