I figured it out, The AS5048 module I am using is configured to use 5v not 3.3V, I added a level shifter and now it gives valid data.