I am trying to understand how the data is transferred from the device to the software.
As far as I could deduce the data is put into the Samples_Buffer_t
struct (Hardware/DeviceV2_02/Firmware/Main.c · master · Zred / openZmeter · GitLab) by the function DMA_CH1_ISR()
(Hardware/DeviceV2_02/Firmware/Main.c · master · Zred / openZmeter · GitLab).
There is some pointer magic happening which I do not understand. Why there is the Offset
variable? To reduce the size? How does Ptr
look like?
After the buffer is filled it can be send once a send command comes from the control software. This seems to happen in USB_HandleEP1_TX
(Hardware/DeviceV2_02/Firmware/Main.c · master · Zred / openZmeter · GitLab)
Why is there a 32 counter? BUFF_LEN
seems to be a much larger value? How is it actually transmitted?
The device is set up in DeviceV2.cpp. The data is received by DeviceV2::ReadCallback
and cast back into its original form. Then it is added to the buffer of the Analyser. Is that correct? How are the other non waveform channels extracted?
Thanks in advance!