# HAL Ring stream demo

# this creates ring_0 in stream mode
newring test 16384 stream

loadrt ringread ring=test
loadrt ringwrite ring=test

# slow square signal on ringwrite.write
# every edge on ringwrite.write causes a message to be queued
loadrt charge_pump
net square-wave charge_pump.0.out ringwrite.write

# 1ms/1s
newthread fast 1000000    fp
newthread slow 1000000000 fp

# the 'dequeue and print message' thread function
addf ringread  fast

# the 'enqueue a message' function
addf ringwrite fast

addf charge_pump.0 slow
start

# get going
setp charge_pump.0.enable 1
