in an PEC application the application class with the name „Controller“ already exists with the instance name „app“. class Controller{void onStart(); voidOnWork();}:PecAppKernel:PecAppModul;
Simple wait functions are available: waitMs(uint16_t milliseconds) and waitUs(uint16_t microsecond). These functions should be used with caution in complex solutions as they are based only on a simple wait loop.
The following library elements are provided:
class PecAppModul(virtual onPower(); virtual onStart(); virtual onWork(); virtual onTimer10ms(); virtual onEvent100ms(); virtual onEvent1s();); class PecDevice(virtual onPower(); virtual onStart()); template PecPinOutput{bool getState();void setState();}; template PecPortInputOutput{void config();void setDirection();portMask_t getData();portMask_t operator=();void setData();void setPullUp();}; template PecPinInput{bool getState();}; template PecPortOutput{void setData();portMask_t operator=();void config();portMask_t getData();}; template PecPortInput{void config();portMask_t getData();void setPullUp();}; template PecPinOpenDrain{void config();bool getState();void down();void release();}; template PecPinInterrupt{void onPinEvent();uint8_t onEvent();}; template PecAppKernel{void onSysTick();void initSystemClock();uint16_t getMilliSpan();void resetMilliSpan();void getSysTime();}:PecAppModul; template PecString{void addContent();StringSize_t find();StringSize_t find();void format();String getPart();StringSize_t getSize(); operator char*(); operator const char*();String operator+();String& operator+=();String& operator+=();bool operator==();String& operator=();bool setContent();bool setSize(); String();void addInt();bool operator==();int32_t toInt();StringSize_t findReverse();void toUpperCase();void toLowerCase();String& operator=();void addInt();void addNumBin();void addNumHex();void clear();StringSize_t count();void fromInt();void fromInt();void fromNumBin();void fromNumHex();String getPartTo();void insert();void insert();void remove();void replace();void replace();void trim();void urlDecode();void urlEncode();String& operator=(); String();double toFloat();void formatAdd();bool isEqual();}; template PecLed{void on();void off();void flash();void blink();void nextBlinkCode();void toggle();uint8_t getBlinkCode();void setBlinkCode();void config();void dimm();void flicker();void slowBlink();}:PecAppModul; template PecButtonClickAndHold{virtual onClick(); virtual onHoldStart(); virtual onHolding(); virtual onHoldEnd(); bool is Pressed(); void waitForPress();}:PecAppModul; template PecButton{bool isPressed();void waitForPress();virtual onButtonDown(); virtual onButtonUp();}:PecAppModul; template PecPinOutputTimed{void on();void off();void toggle();void pulse();bool isBusy();void onTimer();void pulse();void halt();}:PecAppModul; template PecTimer{bool configHz();void onTimerEvent();bool configUs();bool configMs();void stop();uint8_t onEvent();}; template PecPwmChannel{bool configHz();void setDuty();void setValue();void start();void stop();}; template PecFrequencyChannel{bool init();void on();void off();bool setHz();void set();void modifyTopValue();}; template PecTimerCounterUs{void onStart();void start();unsigned int stop();unsigned int getCount();unsigned int reStart();}:PecDevice; template PecTimerCounterMs{void onStart();void start();unsigned int stop();unsigned int getCount();unsigned int reStart();}:PecDevice; template PecUart{void writeByte(uint8_t);void config();bool dataAvailable();uint8_t readByte();void writeString(char*);void writeData(uint8_t* buffer,uint16_t count);void write(uint16_t);void write(int16_t);void write(uint32_t);void write(int32_t);void onPower();}:PecDevice; template PecAdcSingle{adc_t getValue();void config();void onPower();}; template PecAdcChannel{adc_t getValue();void config();void onPower();void onStart();}:PecDevice; template PecSimpleSound{void play();void play();void stop();void initTones();bool isPlaying();}:PecAppModul; template PecSpiMasterSoft{uint%spiSize%_t transferData();}; template PecSpiMaster{}; template PecSpiDevice{void onStart();void init();}; template PecSpiMemory{bool readData();uint8_t getState();uint8_t readId();bool writeData();void powerDown();}; template PecSpiEeprom{}; template PecSpiRam{}; template PecSpiMasterUart{}; template PecSpiFlash{void sectorsErease();bool replaceSectorData();}; template PecI2cBus{void connect();void initI2c();}; template PecI2cDevice{}:PecDevice; template PecLM75{void init();void setComparator();int16_t getRawValue();int8_t getTemp();}; template PecHIH6130{bool readTemp100Humi();bool startCalc();}; template PecPCA9555{bool configPorts();bool outPorts();uint8_t readPorts();}; template Pec24Cxx{uint8_t readData();bool writeData();bool readData();bool writeData();}; template PecMax520{bool reset();bool powerDown();bool powerUp();bool setChannelValue();}; template PecDS1307{bool read();bool write();void stopClock();void startClock();}; template PecMCP7940N{bool read();bool write();void stopClock();void startClock();}; template PecPersistentData{void save();void load();}; template PecPersistentStorage_I2C_24Cxx{void save();void load();}; template Pec7Segment{void config();uint8_t showDigit();}; template PecServoTypeB{void setPos(uint16_t);uint16_t getPos();void goToPos(uint16_t);bool ready();void stop();}:PecAppModul; template PecServoTypeA{void setPos(uint16_t);uint16_t getPos();void goToPos(uint16_t);bool ready();void stop();}:PecAppModul; parameter pinPullUp{}; parameter pinPullDown{}; parameter pinOpenDrain{}; parameter pinHighActive{}; parameter pinLowActive{}; parameter pinInterruptDirect{void onPinInterrupt();}; parameter timerIntDirect{void onTimerInterrupt();}; parameter noTx{}; parameter noRx{}; parameter baudrate9600{}; parameter baudrate500k{}; parameter baudrate57600{}; parameter baudrate300{}; parameter baudrate600{}; parameter baudrate1200{}; parameter baudrate2400{}; parameter baudrate4800{}; parameter baudrate14400{}; parameter baudrate28800{}; parameter baudrate19200{}; parameter baudrate38400{}; parameter baudrate256k{}; parameter baudrate1M{}; parameter baudrate2M{}; parameter baudrate115k{}; parameter uartEventRx{uint8_t onEvent();void onEventRx();}; parameter uartIntRx{void onIntRx();}; parameter adcResolution8bit{}; parameter adcResolution10bit{}; parameter debugOutput{String getDump();String getIpString();}; parameter persistentData_dontUseInitFlag{};