This simulation will be similar to our past project, MPXE.
It will log GPIO states, I2C transactions, SPI transactions, and CAN data. This includes mocking our LTC6811 ICs, current sense IC, and motor current/voltage.
DESIGN CHOICES:
The server and client interface will be done in C++ using TCP/IP sockets to maintain communication.
Everything will be modular to support scalable development. I have made it so the simulation framework can easily be ported to other chip families with varying GPIOs, I2C interfaces, etc.
Log data into a single JSON file, containing each project's info. (Could be transitioned to multiple JSON files per project, as a single file can become very large).
Currently, the C++ terminal is the user interface, but this can easily be transitioned to a more user-friendly GUI.
The mock drivers supported by the simulation are in the following list:
GPIO
I2C
SPI
CAN
Flash
CRC
ADC
LTC6811
MAX17261
Wavesculptor motor controller
DESIGN IMPROVEMENTS/THOUGHTS
We could use UDP rather than TCP since everything will be running locally. This reduces message overhead. This would modify the base server/client classes. Everything is built on top of these base classes.
We could run the client projects on an external server like the Bay PC. This could be integrated into the CI/CD where the simulation can be used to verify the vehicle is functioning as expected (no faults/unexpected readings).
We could transition message structures to Protobufs to standardize everything.