There is all the speedy side for knock control already in firmware, just disabled.
You can pretty easily enable it.
analog or digital inputs
I've managed to dig up a few obscure wiring diag[…]
Still can't find what you're looking for?