Thank you so much for posting this. This works perfectly for my M5 Paper as well (changing out the hardware numbers as needed). I was able to write some custom blocks based on this. <3