commit f10ee8bcbdabc2289dfe8a22b6779a6da95a7b6a Author: cfif Date: Wed Dec 17 16:17:49 2025 +0300 Обновление diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..9589ff8 --- /dev/null +++ b/modular.json @@ -0,0 +1,13 @@ +{ + "dep": [ + + ], + "cmake": { + "inc_dirs": [ + "./" + ], + "srcs": [ + "./**.c" + ] + } +} \ No newline at end of file diff --git a/standby.c b/standby.c new file mode 100644 index 0000000..e919d8d --- /dev/null +++ b/standby.c @@ -0,0 +1,34 @@ +// +// Created by cfif on 17.12.2025. +// + +#include "standby.h" + + +static void Bsp_GpioFInt_CallbackFunction(void) { + SMC_SetSystemMode(SMC_MODE_RUN); +} + +void StandBy_Init(tStandBy *env) { + PORT_InitType tInitStruct = {0}; + PORT_InterruptType tIntStruct = {0}; + + // wakeup source: Key1/PortA9; MUX = GPIO input + tInitStruct.u32PortPins = PORT_PIN_9; + tInitStruct.uPortPinMux.u32PortPinMode = PORT_GPIO_MODE; + tInitStruct.bPullEn = true; + tInitStruct.ePullSel = PORT_PULL_UP; + PORT_InitPins(PORT_A, &tInitStruct); + + // enable PortA9 interrupt + tIntStruct.u32PortPins = PORT_PIN_9; + tIntStruct.ePortIsrMode = PORT_IRQ_BOTH_EDGE; + tIntStruct.pIsrNotify = Bsp_GpioFInt_CallbackFunction; + PORT_InitInterrupt(PORT_A, &tIntStruct); + + WKU_EnableWakeupSource(WKU_INPUT_GPIOA); + + NVIC_SetPriority(PORTA_IRQn, 0xFF); + NVIC_EnableIRQ(PORTA_IRQn); + +} \ No newline at end of file diff --git a/standby.h b/standby.h new file mode 100644 index 0000000..9683c0c --- /dev/null +++ b/standby.h @@ -0,0 +1,23 @@ +// +// Created by cfif on 17.12.2025. +// + +#ifndef HVAC_M7_STANDBY_H +#define HVAC_M7_STANDBY_H + +#include "fc7xxx_driver_scm.h" +#include "fc7xxx_driver_port.h" +#include "fc7xxx_driver_wku.h" +#include "fc7xxx_driver_smc.h" +#include "fc7xxx_driver_gpio.h" +#include "fc7xxx_driver_tstmp.h" + +typedef struct { + + +} tStandBy; + + +void StandBy_Init(tStandBy *env); + +#endif //HVAC_M7_STANDBY_H