OMOTE/Platformio/HAL/Targets/Simulator/HardwareSimulator.hpp

48 lines
1.2 KiB
C++
Raw Normal View History

Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
#pragma once
#include "HardwareAbstract.hpp"
Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
2023-10-22 14:35:49 -04:00
#include "KeyPressSim.hpp"
#include "SDLDisplay.hpp"
2023-10-22 14:35:49 -04:00
#include "batterySimulator.hpp"
#include "wifiHandlerSim.hpp"
Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
#include <thread>
Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
class HardwareSimulator : public HardwareAbstract {
public:
HardwareSimulator();
Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
2023-10-22 14:35:49 -04:00
void init() override{};
void loopHandler() override{};
void debugPrint(const char *fmt, ...) override {
va_list arguments;
va_start(arguments, fmt);
vprintf(fmt, arguments);
va_end(arguments);
}
Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
2023-10-22 14:35:49 -04:00
std::shared_ptr<BatteryInterface> battery() override;
std::shared_ptr<DisplayAbstract> display() override;
std::shared_ptr<wifiHandlerInterface> wifi() override;
std::shared_ptr<KeyPressAbstract> keys() override;
Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
2023-10-22 14:35:49 -04:00
char getCurrentDevice() override;
void setCurrentDevice(char currentDevice) override;
2023-10-22 14:35:49 -04:00
bool getWakeupByIMUEnabled() override;
void setWakeupByIMUEnabled(bool wakeupByIMUEnabled) override;
2023-10-22 14:35:49 -04:00
uint16_t getSleepTimeout() override;
void setSleepTimeout(uint16_t sleepTimeout) override;
private:
std::thread mTickThread;
std::thread mHardwareStatusTitleUpdate;
Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
std::shared_ptr<BatterySimulator> mBattery;
std::shared_ptr<SDLDisplay> mDisplay;
std::shared_ptr<wifiHandlerSim> mWifiHandler;
2023-10-22 14:35:49 -04:00
std::shared_ptr<KeyPressSim> mKeys;
Add platform io sim (#31) * Lower default SPI Clock Lowered the default SPI clock as some displays might show glitches with the SPI frequency set above 40MHz. * Added missing library components Added the missing library symbols, footprints and 3D-models. These are all in a project-specific library called "omoteLib" (#19) * Implement MQTT publish in HardwareRevX Change-Id: I7b6955a662716f83dd8daf34128a353efa26bf80 * add batteryStatus info and allow access to it through the interface. Change-Id: Ieb748b1478d532f52ffff9edc783de3cbcf9f303 * rename hardwareAbstractionInterface Change-Id: I39a9bcd7fc4d92b271a40a869faae7870d6d88a1 * rename HardwareAbstractionInterface files Change-Id: Ifb6a96c38da61cb80aabc6c929e392a2fc91cf29 * fixed a typo * Re work directory structure to support new architecture Still need to get the Sim building * lvgl simulator working. * put init code into HardwareSimulator Class * ensure all targets build remove unused assets.c add new github actions that reflect new simulator * clean up build defines by using platform.ini to override default lv_config. remove unneeded include directory. Change-Id: Id63baa80dae89977d239a539b5db9ff67266e1d6 * Fix ESP32 Windows build after battling escape characters. Add esp32 Windows target to Actions. * Fixed screen height - corrected the SCREEN_HEIGHT - small graphical changes in OmoteUI to make it look like in the main branch --------- Co-authored-by: Max <Max-MKA@web.de> Co-authored-by: Matthew Colvin <Matthew.Colvin@garmin.com> Co-authored-by: Matthew Colvin <35540398+Mc067415@users.noreply.github.com>
2023-08-11 18:16:48 -04:00
};