If you need to reverse bits, FLEXIO module already has several registers that do it automatically. You write it to one register and can read it from a few others that have different bit flippings... This was very handy for my transputer project where I have to reverse 32bits constantly. FYI...