Simple simulation code
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.
This commit is contained in:
parent
c9123b746f
commit
266b3334cb
30 changed files with 8532 additions and 0 deletions
38
simulation/include/Wire.h
Normal file
38
simulation/include/Wire.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue