Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions | Variables
simulator Namespace Reference

Simulator dedicated namespace. More...

Namespaces

namespace  globals
 Define the global scope of the simulator.
 
namespace  mock_battery
 Encapsulate the mock battery signals.
 
namespace  mock_electrical
 Encapsulate the mock electrical simulation signals.
 
namespace  mock_gpios
 Encapsulate the mock GPIO signals.
 
namespace  mock_indicator
 Encapsulate the mock indicator signals.
 
namespace  mock_registers
 Encapsulate the mock board registers signals.
 
namespace  time_mocks
 Encapsulate the mock time signals.
 

Classes

class  AsyncGetline
 
class  BQ25713Mock
 
class  BQ76905Mock
 
struct  defaultSimulation
 
class  IntegratedCircuitMock_I
 
class  LevelRecorder
 
struct  simulator
 

Typedefs

using _LampTy = ::lampda::modes::hardware::LampTy
 

Functions

void read_and_update_parameters ()
 Read parameters from the parameter file, and update the simulation.
 
bool is_output_enabled ()
 
void elec_mock_loop ()
 
void start_electrical_mock ()
 
void stop_electrical_mock ()
 
void i2c_process_mock_loop ()
 
void print_mock_loop ()
 

Variables

static const char * fileName = "./simulator/resources/simulation_parameters.txt"
 
static const char * batteryVoltageKey = "batt_V"
 
static const char * vbusVoltageKey = "vbus_V"
 
static const char * cpuTemperatureKey = "cpu_temp"
 
static const char * addedAlgoDelayKey = "algo_del"
 
constexpr int ledW = _LampTy::maxWidth
 
constexpr int ledH = _LampTy::maxOverflowHeight
 
constexpr int ledCount = _LampTy::ledCount
 
constexpr float fLedW = _LampTy::maxWidthFloat
 
constexpr float fResidueW = 1 / (2 * fLedW - 2 * floor(fLedW) - 1)
 
float targetOTGVoltage = 0.0
 
std::array< uint8_t, 255 > pinOutputValue
 
static constexpr size_t numberOfMocks = 1
 
const std::array< std::unique_ptr< IntegratedCircuitMock_I >, numberOfMocks > icMocks
 
bool isI2cAvailable = false
 
std::unique_ptr< LevelRecorderrecorder
 
std::vector< std::string > inputCommands
 
AsyncGetline get_line_async
 
std::mutex mut
 
std::vector< std::thread > threadPool
 
bool isSuspended = false
 
static sf::Clock s_clock
 
static bool isClockReset = false
 

Detailed Description

Simulator dedicated namespace.

if defined, will display colors with the same brigthness to debug the color bending

This file defines the common interface for all IC mock. They should have access to the electrical simulator, and an I2C interface

Variable Documentation

◆ icMocks

const std::array<std::unique_ptr<IntegratedCircuitMock_I>, numberOfMocks> simulator::icMocks
Initial value:
= {
std::make_unique<BQ25713Mock>(),
}