ppl_shim.pxd.in 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. from awlsim.common.cython_support cimport *
  2. cdef class AbstractIO(object):
  3. cdef public object pixtend
  4. cdef public _Bool isV2
  5. cdef public uint32_t index
  6. cdef public uint32_t byteOffset
  7. cdef public uint32_t bitOffset
  8. cdef public uint32_t bitSize
  9. cdef public uint32_t byteSize
  10. cdef public _Bool directOnly
  11. cdef public object setter
  12. cdef public object getter
  13. cdef public object directionSetter
  14. cpdef setup(self, secondaryOffset)
  15. cdef set(self, bytearray dataBytes)
  16. cdef setWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
  17. cdef get(self, bytearray dataBytes)
  18. cdef getWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
  19. cdef class AbstractBitIO(AbstractIO):
  20. cdef public uint32_t bitMask
  21. cdef public uint32_t invBitMask
  22. cdef setWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
  23. cdef getWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
  24. cpdef setup(self, secondaryOffset)
  25. cdef class AbstractWordIO(AbstractIO):
  26. cdef setWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
  27. cdef getWithByteOffset(self, bytearray dataBytes, uint32_t byteOffset)
  28. cdef class Relay(AbstractBitIO):
  29. pass
  30. cdef class DigitalOut(AbstractBitIO):
  31. pass
  32. cdef class DigitalIn(AbstractBitIO):
  33. pass
  34. cdef class GPIO(AbstractBitIO):
  35. cdef public object mode
  36. cdef public object pullUp
  37. cpdef setup(self, secondaryOffset)
  38. cdef class EnvSensorBase(AbstractWordIO):
  39. cdef public uint32_t sensorType
  40. cdef public GPIO gpio
  41. cpdef setup(self, secondaryOffset)
  42. cdef class TempIn(EnvSensorBase):
  43. cdef uint16_t __convert(self, double temp)
  44. cdef class HumIn(EnvSensorBase):
  45. cdef uint16_t __convert(self, double hum)
  46. cdef class AnalogIn(AbstractWordIO):
  47. cdef public object jumper10V
  48. cdef public object numberOfSamples
  49. cdef uint16_t __convertV(self, double V)
  50. cdef uint16_t __convertMA(self, double mA)
  51. cpdef setup(self, secondaryOffset)
  52. cdef class AnalogOut(AbstractWordIO):
  53. cdef uint16_t __convert(self, uint16_t s7Value)
  54. cdef class PWM0Period(AbstractWordIO):
  55. pass
  56. cdef class PWM0(AbstractWordIO):
  57. cdef public _Bool enabled
  58. cdef public _Bool servoMode
  59. cpdef setup(self, secondaryOffset)
  60. cdef class PWM1Period(AbstractWordIO):
  61. pass
  62. cdef class PWM1(AbstractWordIO):
  63. cdef public _Bool enabled
  64. cdef public _Bool servoMode
  65. cpdef setup(self, secondaryOffset)