User Manual

- 16 -
implementation of the mechanism needs to open the serial port interrupt. The serial port buffers
the data into the FIFO every time the serial port generates the receiving interrupt. The main
program only needs to check and judge the data length of the FIFO, and can fully utilize the
waiting time of the mode 1), which has higher Time utilization, but at the expense of space
utilization.
Th e serial port generates
a receive interrupt
Use fifo_put or
fifo_put_byte receive
cached data
Start measuring
Start measuring
fifo_get_only() get two
bytes
fifo_get_only() get two
bytes Conver to length
L
Is it a 2-byte header
Use the API interface
HPS3D_MeasureDataParse() to parse the
data received
Y
N
At the end of this
measurement
fifo_clear_bytes(fifo, 2);
fifo_get_element_size() > 4?
fifo_get_element_size() >= L?
fifo_get(fifo, buff, L+4)
gets a frame of data
N
fifo_init(fifo);
Initialization FIFO