UveosOnNation_VEGA_MainMode.../MainModesArbiter.h

107 lines
2.1 KiB
C

//
// Created by xemon on 19.09.22.
//
#ifndef UVEOS_ON_NATION_MMA_H
#define UVEOS_ON_NATION_MMA_H
//Железные интерфесы
#include "PeripheralInterfaces.h"
#include "DevRtc.h"
#include "RtcIO.h"
#include "EgtsProcessing.h"
//Переферийные устройства
#include <DeviceStorage.h>
#include <AudioCodec.h>
#include <Accel.h>
#if USE_GSM_AND_GNSS_TELIT
#include <GsmWithGnss.h>
#endif
#ifdef USE_GSM_AND_GNSS_SIMCOM
#include <Gsm.h>
#include <Gnss.h>
#endif
//Подсистемы
#include <PowerManagement.h>
#include <LoggerToSerialPort.h>
#include <ComInt.h>
#include <ComandLineInterface.h>
#include <DeviceTesting.h>
#include <CrashDetection.h>
#include <EraGlonassUveos.h>
typedef struct {
// Преферийные интерфесы
tGpios *gpios;
tSerialPorts *serialPorts;
tI2cPorts *i2cPorts;
tSpiPorts *spiPorts;
tAdcs *adcs;
tStorageOnFlash *flash;
tRtc *rtc;
// Преферийные устройства
tDeviceStorage storage;
tPowerManagement power;
tAudioCodec audioCodec;
tGsmWithGnss gsmWithGnss;
tAccel accel;
//Подсистемы
tLoggerToSerialPort slog;
tUserInput userInput;
tUserIndication indication;
tComInt comInt;
// tCli cli;
// tCli cliVrt;
tDeviceTesting testing;
tCrashDetection crashDetect;
tEraGlonassUveos uveos;
uint32_t lastSmsCheckTime;
struct {
osThreadId_t id;
uint32_t stack[4048]; //4048 6072
StaticTask_t controlBlock;
osThreadAttr_t attr;
} thread;
tStaticThreadBlock(512) threadTesting;
bool flIgn;
volatile bool kzModeBloc;
// tSignPack signature;
tEgtsProcessing egtsProcessing;
} tMma;
void Mma_Init(
tMma *env,
tGpios *gpios,
tSerialPorts *serialPorts,
tI2cPorts *i2cPorts,
tSpiPorts *spiPorts,
tAdcs *adcs,
tStorageOnFlash *flash,
tRtc *rtc
);
void Mma_StartThread(tMma *env);
#define Mma_SetMode(ENV, VALUE) UserIndication_SetMode(&((ENV)->indication),(VALUE))
#endif //UVEOS_ON_NATION_MMA_H