irq_set_status can be used to clear the irq status bit so that the interrupt will stop occuring.
Upon an interrupt, you can read from the interrupt status register to see what caused the interrupt.
Most of these are taken from https://cc65.github.io/doc/customizing.html, but modified to suit this setup.