tecki / ebpfcat

A Python-base EBPF code generator
GNU General Public License v2.0
17 stars 5 forks source link

Can you add BufferInput and BufferOutput ? #12

Open jinyistudio534 opened 7 months ago

jinyistudio534 commented 7 months ago

di1 = DigitalInput(in1.channel1) # use channel 1 of terminal "out" di2 = DigitalInput(in2.channel1) # use channel 1 of terminal "out" do1 = DigitalOutput(out1.channel1) # use channel 1 of terminal "out" do2 = DigitalOutput(out2.channel2) # use channel 1 of terminal "out" ob0 = AnalogOutput(easycat.outputs.byte0) ob1 = AnalogOutput(easycat.outputs.byte3) ib1 = AnalogInput(easycat.inputs.byte13) sg = SyncGroup(master, [di1,di2,do1,do2,ob1,ob0,ib1]) # this sync group only contains one terminal

What can be operated on above is not a single bit/Digital or a single number/Analog. Is it possible to process an array of values? For example: ob2 = BufferOutput(easycat.outputs) ib2 = BufferInput(easycat.inputs) sg = SyncGroup(master, [ob2,ib2])
ob2.value[0] = 12 ob2.value[1] = 13 n1 = ib2.value[2]

tecki commented 6 months ago

Well, one can do all kinds of inputs and outputs. E.g. For the EL6022 there is a 23 byte buffer input and output. Also the serial device in serial.py uses it, an example on how to use buffers. Unfortunately it doesn't currently work, but I'll make it work soon.

jinyistudio534 commented 6 months ago

Looking forward to your good informations