/* Starts the auto-scan process from the current frequency.  */
void tea5767Scan(uint8_t scanDirection)
/* Starts the auto-scan process from the current frequency.  */
void tea5767Scan(uint8_t scanDirection)
{
  uint8_t rbuffer[5] = { 0, 0, 0, 0, 0 };
  uint8_t wbuffer[5] = { 0, 0, 0, 0, 0 };
  if (!_tea5767Initialised) tea5767Init();
  tea5767ReadData(&rbuffer[0]);
  wbuffer[0] = TEA5767_WBYTE1_SEARCHMODE +
               (rbuffer[0] & 0x3F);
  wbuffer[1] = rbuffer[1];
  wbuffer[2] = TEA5767_WBYTE3_SEARCHSTOPLEVEL_MID |
               TEA5767_WBYTE3_HLSI;
  wbuffer[3] = TEA5767_WBYTE4_XTAL;
  wbuffer[4] = 0x00;
  if (scanDirection) wbuffer[2] |= TEA5767_WBYTE3_SEARCHUPDOWN;
  tea5767SendData(wbuffer);
}