HW does not have 32 states of power, only half, that is why you have /=2
The sx1231h datasheet actually states it's the upper values 16-31 of PAlevel that are used, technically the lower values 0-15 are undefined. Dividing by 2 forces the values to 0-15. Those values seem to work to a degree, but close examination of the current consumption in the link I gave above seems to show 80mA at a value of 15 and 110mA at a value of 31 (for PA1+PA2+HP), so I'm not convinced using 0-15 is the same as 16-31. Interestingly Radiohead uses 16-31.
Mark.