Initialize and set up of GPIO pins

Surely @Jonny040 glad it helps. Here are a few sources for examples in C and also some general descriptions.

The gpio-testbench.c is a small and self-contained example, with minimal dependencies. Do, however, keep the assembly code mentioned earlier in mind, to keep each bit of each register in mind and stay close to the true simplicity and beauty of the RISC-V ISA.

Explained in simple and concrete terms is the concept of the PLIC interrupt source IDs, which are otherwise vague, abstract, and highly obscure.

Some great and well-written general information is in the SiFive Interrupt Cookbook which you might find helpful. Note, however, that specific examples seem to work around the device tree .dts configuration file structures for which this overall genrality, to me, seems to distract from a fundamental basic understanding of how CLIC, CLINT, and PLIC work in practice.

There is always the SiFive Freedom Studio; with a simple guide for helping to install it. Make sure to look at all the github repo’s of the sifive repository.