summaryrefslogtreecommitdiffstats
path: root/awlsimhw_pixtend/main.pxd.in
blob: 38120e712c8a981d52e48c44dfbf3eb26230595c (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
from awlsim.core.hardware cimport *

cdef class AbstractIO(object):
	cdef public object pixtend
	cdef public uint32_t index
	cdef public uint32_t byteOffset
	cdef public uint32_t bitOffset
	cdef public object setter
	cdef public object getter
	cdef public object directionSetter

	cpdef setup(self, secondaryOffset)
	cdef set(self, bytearray dataBytes)
	cdef get(self, bytearray dataBytes)
	cpdef setDirection(self, outDirection)

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

	cdef set(self, bytearray dataBytes)
	cdef get(self, bytearray dataBytes)
	cpdef setup(self, secondaryOffset)

cdef class AbstractWordIO(AbstractIO):
	cdef set(self, bytearray dataBytes)
	cdef get(self, bytearray dataBytes)

cdef class Relay(AbstractBitIO):
	pass

cdef class DigitalOut(AbstractBitIO):
	pass

cdef class DigitalIn(AbstractBitIO):
	pass

cdef class GPIO(AbstractBitIO):
	pass

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 PWMPeriod(AbstractWordIO):
	pass

cdef class PWM(AbstractWordIO):
	cdef public object overDrive

	cpdef setup(self, secondaryOffset)

cdef class HardwareInterface_PiXtend(AbstractHardwareInterface):
	cdef public object __PiXtend_class
	cdef public object __pixtend
	cdef public _Bool __pixtendInitialized
	cdef public list __relays
	cdef public list __DOs
	cdef public list __DIs
	cdef public list __GPIO_out
	cdef public list __GPIO_in
	cdef public list __AIs
	cdef public list __AOs
	cdef public list __PWMs
	cdef public list __allOutputs
	cdef public list __allInputs
	cdef public uint32_t __outBase
	cdef public uint32_t __outSize
	cdef public uint32_t __inBase
	cdef public uint32_t __inSize
	cdef public double __pollInt
	cdef public double __nextPoll

	cdef ExBool_t __pixtendPoll(self, double now)
	cdef __syncPixtendPoll(self)

	cdef readInputs(self)
	cdef writeOutputs(self)
	cdef bytearray directReadInput(self, uint32_t accessWidth, uint32_t accessOffset)
	cdef ExBool_t directWriteOutput(self, uint32_t accessWidth, uint32_t accessOffset, bytearray data) except ExBool_val
bues.ch cgit interface