HDMI Co-routine Examples

Are there any examples for asynchronous versions of read and write frames?
(Code block taken from the user-guide online)

async def readframes():
    while True:
        frame = await hdmi_in.readframe_async()
        dma.sendchannel.transfer(frame)
        await dma.sendchannel.wait_async()
        frame.freebuffer()
async def writeframes():
    while True:
        frame = hdmi_out.newframe()
        dma.recvchannel.transfer(frame)
        await dma.recvchannel.wait()
        await hdmi_out.writeframe_async(frame)

I have created task to run the coroutine and I wanted to see whether there is an example is I can refer to.

Configuration
Board: PYNQ-Z1
Video-in spec: (from hdmi_in.mode function)
VideoMode: width=1280 height=720 bpp=24 fps=60

1 Like