Machine

Machine module

Procedures and variables here must be implemented in other MCU dependent module. This module exists to disconnect from MCU dependent import in general drivers.

Const

RESET_UNKNOWN* = 0;
RESET_PWRON* = 1;
RESET_HARD* = 2;
RESET_WDT* = 3;
RESET_DEEPSLEEP* = 4;
RESET_SOFT* = 5;

Vars

cpuFreq- ["_cpu_freq"]: INTEGER;
resetCause- ["_reset_cause"]: INTEGER;

Procedures

IRQEnable

Enable interrupts.

PROCEDURE ^ IRQEnable* ["irq_enable"]();

IRQDisable

Disable interrupts.

PROCEDURE ^ IRQDisable*["irq_disable"] ();

Reset

System reset

PROCEDURE ^ Reset* ["reset"] ();

Idle

Idle until interrupt is triggered.

PROCEDURE ^ Idle* ["idle"] ();

SleepLight

Enter light sleep.

PROCEDURE ^ SleepLight* ["sleep_light"] ();

SleepDeep

Enter deep sleep.

PROCEDURE ^ SleepDeep* ["sleep_deep"] ();

DelayS

Delay delta seconds.

PROCEDURE ^ DelayS* ["delay_s"] (delta : UNSIGNED32);

DelayMS

Delay delta milli seconds.

PROCEDURE ^ DelayMS* ["delay_ms"] (delta : UNSIGNED32);

DelayUS

Delay delta micro seconds.

PROCEDURE ^ DelayUS* ["delay_us"] (delta : UNSIGNED32);

TicksMS

Milli seconds ticker value.

PROCEDURE ^ TicksMS* ["ticks_ms"] (): UNSIGNED32;

TicksCPU

CPU ticker value.

PROCEDURE ^ TicksCPU* ["ticks_cpu"] (): UNSIGNED32;