Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows the calculation of the PLL information
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