calculate frequency deviation register value

freq dev calculation is now done by defines. also fixes casts to
integer where neccesary