Created
August 23, 2014 02:44
-
-
Save mroger/75e4ef0f8105b6ea995c to your computer and use it in GitHub Desktop.
Shows the calculation of the PLL information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void TEA5767N::transmitFrequency(float frequency) { | |
setFrequency(frequency); | |
transmitData(); | |
} | |
void TEA5767N::setFrequency(float _frequency) { | |
frequency = _frequency; | |
unsigned int frequencyW; | |
if (hiInjection) { | |
setHighSideLOInjection(); | |
frequencyW = 4 * ((frequency * 1000000) + 225000) / 32768; | |
} else { | |
setLowSideLOInjection(); | |
frequencyW = 4 * ((frequency * 1000000) - 225000) / 32768; | |
} | |
transmission_data[FIRST_DATA] = ((transmission_data[FIRST_DATA] & 0xC0) | ((frequencyW >> 8) & 0x3F)); | |
transmission_data[SECOND_DATA] = frequencyW & 0XFF; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment