aboutsummaryrefslogtreecommitdiffstats
path: root/awlsim/core/timers.pxd.in
blob: a2cff8232b95dc17d961bfec7e55d0929f03e577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from awlsim.common.cython_support cimport *
from awlsim.core.cpu cimport *

cdef class TimerConstsClass(object):
	cdef public uint8_t TB_10MS
	cdef public uint8_t TB_100MS
	cdef public uint8_t TB_1S
	cdef public uint8_t TB_10S

	cdef public uint8_t TB_SHIFT
	cdef public uint8_t TB_MASK
	cdef public uint16_t TB_MASK_S

	cdef public uint16_t TB_10MS_S
	cdef public uint16_t TB_100MS_S
	cdef public uint16_t TB_1S_S
	cdef public uint16_t TB_10S_S

cdef TimerConstsClass TimerConsts

cdef class Timer(object):
	cdef public S7CPU cpu
	cdef public uint32_t index
	cdef public _Bool prevVKE_S
	cdef public _Bool prevVKE_FR
	cdef public uint16_t timebase
	cdef public _Bool deadlineActionSetStatus
	cdef public double deadline
	cdef public double remaining
	cdef public _Bool status
	cdef public _Bool running

	cdef _Bool get(self)
	cdef void reset(self)
	cdef setTimevalS5T(self, uint16_t s5t)
	cdef uint32_t getTimevalBin(self) except? 0xFFFFFFFF
	cdef uint16_t getTimevalS5T(self) except? 0xFFFF
	cdef uint16_t getTimevalS5TwithBase(self) except? 0xFFFF
	cdef double __getRemainingSeconds(self)
	cdef void __updateRemaining(self)
	cdef run_FR(self)
	cdef run_SI(self, uint16_t s5t)
	cdef run_SV(self, uint16_t s5t)
	cdef run_SE(self, uint16_t s5t)
	cdef run_SS(self, uint16_t s5t)
	cdef run_SA(self, uint16_t s5t)
	cdef __start(self, uint16_t s5t)
	cdef void __checkDeadline(self)

cdef uint16_t _seconds_to_s5t_tb10ms(double seconds)
cdef uint16_t _seconds_to_s5t_tb100ms(double seconds)
cdef uint16_t _seconds_to_s5t_tb1s(double seconds)
cdef uint16_t _seconds_to_s5t_tb10s(double seconds)

cdef uint32_t Timer_seconds_to_s5t(double seconds) except? 0xFFFFFFFF
cdef double Timer_s5t_to_seconds(uint16_t s5t) except? -1.0
bues.ch cgit interface