From 2439912c09627f37fdbada355e88f2f80ffb37e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20B=C3=ADr=C3=B3?= Date: Tue, 20 Jan 2015 22:29:45 +0100 Subject: [PATCH 1/2] fixed i2c comunication with tea5767 --- TEA5767.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/TEA5767.cpp b/TEA5767.cpp index a2b5701..8dd9b14 100644 --- a/TEA5767.cpp +++ b/TEA5767.cpp @@ -94,6 +94,7 @@ bool TEA5767::TEA5767::init() { #else registers[REG_5] = REG_5_DTC; // 75 ms Europe setup #endif + Wire.begin(); return(result); From 30f95cf3b47143c4c06669e641af9b7c47c69db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20B=C3=ADr=C3=B3?= Date: Tue, 20 Jan 2015 22:39:22 +0100 Subject: [PATCH 2/2] removed some unused stuff --- TEA5767.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/TEA5767.cpp b/TEA5767.cpp index 8dd9b14..e9cf9cb 100644 --- a/TEA5767.cpp +++ b/TEA5767.cpp @@ -161,16 +161,13 @@ void TEA5767::setBand(RADIO_BAND newBand) { if (newBand == RADIO_BAND_FM) { RADIO::setBand(newBand); - _freqLow = 8750; #ifdef IN_EUROPE //Freq(MHz) = 0.100(in Europe) * Channel + 87.5MHz - _freqSteps = 10; registers[REG_4] &= ~REG_4_BL; #else //Freq(MHz) = 0.200(in USA) * Channel + 87.5MHz - _freqSteps = 10; registers[REG_4] |= REG_4_BL; #endif @@ -263,22 +260,6 @@ void TEA5767::_saveRegisters() } // _saveRegisters -// write a register value using 2 bytes into the Wire. -void TEA5767::_write16(uint16_t val) -{ - Wire.write(val >> 8); Wire.write(val & 0xFF); -} // _write16 - - -// read a register value using 2 bytes in a row -uint16_t TEA5767::_read16(void) -{ - uint8_t hiByte = Wire.read(); - uint8_t loByte = Wire.read(); - return((hiByte << 8) + loByte); -} // _read16 - - void TEA5767::getRadioInfo(RADIO_INFO *info) { RADIO::getRadioInfo(info);