summaryrefslogtreecommitdiffstats
path: root/awlsimhw_pixtend/ppl_shim.pxd.in
blob: 53e811404da517a742cd85da11396f15c7442592 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
from awlsim.common.cython_support cimport *

cdef class AbstractIO(object):
	cdef public object pixtend
	cdef public _Bool isV2
	cdef public uint32_t index
	cdef public uint32_t byteOffset
	cdef public uint32_t bitOffset
	cdef public uint32_t bitSize
	cdef public uint32_t byteSize
	cdef public _Bool directOnly
	cdef public object setter
	cdef public object getter
	cdef public object directionSetter

	cpdef setup(self, secondaryOffset)
	cdef set(self, bytearray dataBytes)
	cdef setWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
	cdef get(self, bytearray dataBytes)
	cdef getWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)

cdef class AbstractBitIO(AbstractIO):
	cdef public uint32_t bitMask
	cdef public uint32_t invBitMask

	cdef setWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
	cdef getWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
	cpdef setup(self, secondaryOffset)

cdef class AbstractWordIO(AbstractIO):
	cdef setWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
	cdef getWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)

cdef class Relay(AbstractBitIO):
	pass

cdef class DigitalOut(AbstractBitIO):
	pass

cdef class DigitalIn(AbstractBitIO):
	pass

cdef class GPIO(AbstractBitIO):
	cdef public object mode
	cdef public object pullUp

	cpdef setup(self, secondaryOffset)

cdef class EnvSensorBase(AbstractWordIO):
	cdef public uint32_t sensorType
	cdef public GPIO gpio

	cpdef setup(self, secondaryOffset)

cdef class TempIn(EnvSensorBase):
	cdef uint16_t __convert(self, double temp)

cdef class HumIn(EnvSensorBase):
	cdef uint16_t __convert(self, double hum)

cdef class AnalogIn(AbstractWordIO):
	cdef public object jumper10V
	cdef public object numberOfSamples

	cdef uint16_t __convertV(self, double V)
	cdef uint16_t __convertMA(self, double mA)
	cpdef setup(self, secondaryOffset)

cdef class AnalogOut(AbstractWordIO):
	cdef uint16_t __convert(self, uint16_t s7Value)

cdef class PWM0Period(AbstractWordIO):
	pass

cdef class PWM0(AbstractWordIO):
	cdef public _Bool enabled
	cdef public _Bool servoMode

	cpdef setup(self, secondaryOffset)

cdef class PWM1Period(AbstractWordIO):
	pass

cdef class PWM1(AbstractWordIO):
	cdef public _Bool enabled
	cdef public _Bool servoMode

	cpdef setup(self, secondaryOffset)
bues.ch cgit interface