From c0c85df36f78e3a34b471512bca59412f078242f Mon Sep 17 00:00:00 2001 From: Vasily Davydov Date: Mon, 17 Oct 2022 08:55:48 +0300 Subject: [PATCH] switch-controller: init empty class This class is meant for controlling switch behaviour, such as button hold etc --- SwitchController/.cproject | 262 ++++++++++++++++++++++ SwitchController/.project | 31 +++ SwitchController/inc/SwitchController.h | 31 +++ SwitchController/liblinks.xml | 32 +++ SwitchController/src/SwitchController.cpp | 24 ++ 5 files changed, 380 insertions(+) create mode 100644 SwitchController/.cproject create mode 100644 SwitchController/.project create mode 100644 SwitchController/inc/SwitchController.h create mode 100644 SwitchController/liblinks.xml create mode 100644 SwitchController/src/SwitchController.cpp diff --git a/SwitchController/.cproject b/SwitchController/.cproject new file mode 100644 index 0000000..ecc1363 --- /dev/null +++ b/SwitchController/.cproject @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <?xml version="1.0" encoding="UTF-8"?> +<TargetConfig> +<Properties property_2="LPC15xx_256K.cfx" property_3="NXP" property_4="LPC1549" property_count="5" version="100300"/> +<infoList vendor="NXP"> +<info chip="LPC1549" connectscript="LPC15RunBootRomConnect.scp" flash_driver="LPC15xx_256K.cfx" match_id="0x0" name="LPC1549" resetscript="LPC15RunBootRomReset.scp" stub="crt_emu_cm3_gen"> +<chip> +<name>LPC1549</name> +<family>LPC15xx</family> +<vendor>NXP (formerly Philips)</vendor> +<reset board="None" core="Real" sys="Real"/> +<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/> +<memory can_program="true" id="Flash" is_ro="true" type="Flash"/> +<memory id="RAM" type="RAM"/> +<memory id="Periph" is_volatile="true" type="Peripheral"/> +<memoryInstance derived_from="Flash" id="MFlash256" location="0x0" size="0x40000"/> +<memoryInstance derived_from="RAM" id="Ram0_16" location="0x2000000" size="0x4000"/> +<memoryInstance derived_from="RAM" id="Ram1_16" location="0x2004000" size="0x4000"/> +<memoryInstance derived_from="RAM" id="Ram2_4" location="0x2008000" size="0x1000"/> +</chip> +<processor> +<name gcc_name="cortex-m3">Cortex-M3</name> +<family>Cortex-M</family> +</processor> +</info> +</infoList> +</TargetConfig> + + + + LPCXpresso1549 + + + \ No newline at end of file diff --git a/SwitchController/.project b/SwitchController/.project new file mode 100644 index 0000000..17e1cd4 --- /dev/null +++ b/SwitchController/.project @@ -0,0 +1,31 @@ + + + SwitchController + + + lpc_chip_15xx + DigitalIoPin + Timer + StateHandler + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/SwitchController/inc/SwitchController.h b/SwitchController/inc/SwitchController.h new file mode 100644 index 0000000..e5ba894 --- /dev/null +++ b/SwitchController/inc/SwitchController.h @@ -0,0 +1,31 @@ +/* + * SwitchController.h + * + * Created on: Oct 17, 2022 + * Author: tylen + */ + +#ifndef SWITCHCONTROLLER_H_ +#define SWITCHCONTROLLER_H_ + +#include "DigitalIoPin.h" +#include "StateHandler.h" +#include "Timer.h" + +class SwitchController +{ +public: + SwitchController (DigitalIoPin *button, Timer *timer, StateHandler *handler); + virtual ~SwitchController (); + /** Listen to switch button + */ + void listen (); + +private: + DigitalIoPin *b; + Timer *t; + StateHandler *h; + bool b_state; +}; + +#endif /* SWITCHCONTROLLER_H_ */ diff --git a/SwitchController/liblinks.xml b/SwitchController/liblinks.xml new file mode 100644 index 0000000..1dc1803 --- /dev/null +++ b/SwitchController/liblinks.xml @@ -0,0 +1,32 @@ + + + + + ${MacroStart}workspace_loc:/${ProjName}/inc${MacroEnd} + + + ${MacroStart}workspace_loc:/${ProjName}/inc${MacroEnd} + + + ${ProjName} + + + ${MacroStart}workspace_loc:/${ProjName}/Debug${MacroEnd} + + + ${MacroStart}workspace_loc:/${ProjName}/Release${MacroEnd} + + + ${ProjName} + + + diff --git a/SwitchController/src/SwitchController.cpp b/SwitchController/src/SwitchController.cpp new file mode 100644 index 0000000..c0fab75 --- /dev/null +++ b/SwitchController/src/SwitchController.cpp @@ -0,0 +1,24 @@ +/* + * SwitchController.cpp + * + * Created on: Oct 17, 2022 + * Author: tylen + */ + +#include + +SwitchController::SwitchController (DigitalIoPin *button, Timer *timer, + StateHandler *handler) +{ + // TODO Auto-generated constructor stub +} + +SwitchController::~SwitchController () +{ + // TODO Auto-generated destructor stub +} + +void +SwitchController::listen () +{ +} \ No newline at end of file