I've designed a small circuit board with a Cyclone 10 LP FPGA and an EZ-USB FX2LP microcontroller. My current revision has a 10-pin header for connecting a USB Blaster, and it works just fine that way. However, I would like to program the FPGA using the on-board microcontroller so I can directly transfer the programming file over USB and avoid connecting the programming cable. The EZ-USB has some GPIO pins that I can connect to the JTAG pins of the Cyclone 10 LP as in Figure 97 of the Cyclone 10 LP Handbook, so in principle this should work.
At this point, I have only a rudimentary understanding of JTAG so my question is pretty broad: how does programming FPGAs via JTAG work? Is there some reference implementation of software in C that outputs the TCK, TDO, TDI, and TMS signals that I can adapt for the microcontroller? I just need some good references or keywords to do further research... I think Section 126.96.36.199 of the handbook above is the beginning of what I need, but I need some more detail and I'm not sure where to begin.