/* Sets the frequency to the specified value in Hz.  */
void tea5767SetFrequency(uint32_t frequency)
/* Sets the frequency to the specified value in Hz.  */
void tea5767SetFrequency(uint32_t frequency)
{
  uint32_t pllValue;
  uint8_t buffer[5] = { 0, 0, 0, 0, 0 };
  if (!_tea5767Initialised) tea5767Init();
  pllValue = (4 * (frequency + 225000)) / 32768;
  buffer[0] = (pllValue >> 8) & 0x3F;
  buffer[1] = (pllValue & 0xFF);
  buffer[2] = TEA5767_WBYTE3_HLSI;
  buffer[3] = TEA5767_WBYTE4_XTAL;
  buffer[4] = 0;
  tea5767SendData(buffer);
}