On a PYNQ-Z1, what would be the easiest method for enabling reads from both analog & digital inputs on the Arduino shield within the same program/runtime?
Normally, if only interacting with analog pins A0…5, I would use the
Arduino_Analog class. However, if I wanted to read/write any GPIO (by either making use of the
Arduino_IO class or a
MicroblazeLibrary instance for the
iop_arduino IOP), a runtime error occurs.
I understand that this is because instantiating an
Arduino_IO object will attempt to load each respective class’s associated MicroBlaze program binary (i.e., “arduino_analog.bin” and “arduino_mailbox.bin”) into the Arduino IOP, and only one program may be actively loaded at any given time for a single IOP.
So what is the easiest course of action here if I, say, need a program loop to read an analog sensor value from A0 and transmit that value to another device via UART (connected to digital pins 0 & 1)?
Is there any solution (entirely in software, preferably) other than writing a custom IOP application in C that essentially uses the same code as
arduino_analog.c for interfacing w/ the XADC while also wrapping the UART API defined in
uart.h? Or would even this not be feasible for the single Arduino IOP?