I've got a project going in C++, and I need to be able to provide 5V DC at about 20mA to a circuit while reading out an output voltage of that circuit, which I expect to look like a square wave between 0V and 5V at 10-80 Hz with a 5% duty cycle. I need to attach a timestamp (with an accuracy of about 1ms) to each rising edge of the square wave, and send those timestamps to my C++ program. The program will also send instructions to the board to control the input voltage to a motor, which will be up to 12V DC and 3A.
My only experience with this sort of thing is with an FPGA board a while ago, and while I have some knowledge of circuits, I'm not sure what board would be required for this application, or what the system would look like, or even how to interface with the C++ program. Is acting as a 5V power supply as simple as just setting an output pin to 5V? How do I program the board to look for rising edges of the square wave? What component should I use to control the motor voltage, and how do I control it, assuming I have a 12V DC supply available?
Any help is greatly appreciated.