I've been programming on raspberry Pi for some time and love using the asyncio mechanisms for creating event driven programs. More recently I've started developing a product using the Seeed nRF52840 Sense board, using CircuitPython. I see we've got asyncio support, but there doesn't seem to be any async oriented libraries.
e.g
I would like to be able to do:
async def buttonAction(pin: DigitalInOut):
while True:
await pinChanged(pin, RISING_EDGE)
#do some action here
async def uartRespodner(uart: busio.UART):
while True:
line = await asyncReadline(uart)
uart.write(line)
I know we can use the countio stuff as per the asyncio tutorial, but that seems a bit long winded for what should be a fairly simple operation. I think having an async wrapper around anything that has a "file-like" interface (read, read_into, readline, write), should also be fairly straightforwards.
I'm willing to create this library if you feel it is a good idea, but I would welcome suggestions for a) what to call it and b) how to structure it.
Phil
I've been programming on raspberry Pi for some time and love using the asyncio mechanisms for creating event driven programs. More recently I've started developing a product using the Seeed nRF52840 Sense board, using CircuitPython. I see we've got asyncio support, but there doesn't seem to be any async oriented libraries.
e.g
I would like to be able to do:
I know we can use the countio stuff as per the asyncio tutorial, but that seems a bit long winded for what should be a fairly simple operation. I think having an async wrapper around anything that has a "file-like" interface (read, read_into, readline, write), should also be fairly straightforwards.
I'm willing to create this library if you feel it is a good idea, but I would welcome suggestions for a) what to call it and b) how to structure it.
Phil