Added I2S input switch for future purpose
This commit is contained in:
+1
-1
@@ -710,7 +710,7 @@ void setup() {
|
|||||||
|
|
||||||
setupmode = false;
|
setupmode = false;
|
||||||
if (edgebeep) radio.tone(50, -5, 2000);
|
if (edgebeep) radio.tone(50, -5, 2000);
|
||||||
|
radio.I2Sin(true);
|
||||||
if (screensaverset) {
|
if (screensaverset) {
|
||||||
ScreensaverTimerInit();
|
ScreensaverTimerInit();
|
||||||
ScreensaverTimerSet(screensaverOptions[screensaverset]);
|
ScreensaverTimerSet(screensaverOptions[screensaverset]);
|
||||||
|
|||||||
@@ -1569,6 +1569,10 @@ void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) {
|
|||||||
devTEF_Radio_Set_Wavegen(0, 0, 0);
|
devTEF_Radio_Set_Wavegen(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TEF6686::I2Sin(bool mode) {
|
||||||
|
devTEF_Radio_Set_I2S_Input(mode);
|
||||||
|
}
|
||||||
|
|
||||||
String TEF6686::convertToUTF8(const wchar_t* input) {
|
String TEF6686::convertToUTF8(const wchar_t* input) {
|
||||||
String output;
|
String output;
|
||||||
while (*input) {
|
while (*input) {
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
#ifndef TEF6686_H
|
ifndef TEF6686_H
|
||||||
#define TEF6686_H
|
#define TEF6686_H
|
||||||
|
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
@@ -655,6 +655,7 @@ class TEF6686 {
|
|||||||
bool getStatus(int16_t &level, uint16_t &USN, uint16_t &WAM, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation, int8_t &snr);
|
bool getStatus(int16_t &level, uint16_t &USN, uint16_t &WAM, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation, int8_t &snr);
|
||||||
bool getStatusAM(int16_t &level, uint16_t &noise, uint16_t &cochannel, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation, int8_t &snr);
|
bool getStatusAM(int16_t &level, uint16_t &noise, uint16_t &cochannel, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation, int8_t &snr);
|
||||||
bool getIdentification(uint16_t &device, uint16_t &hw_version, uint16_t &sw_version);
|
bool getIdentification(uint16_t &device, uint16_t &hw_version, uint16_t &sw_version);
|
||||||
|
void I2Sin(bool mode);
|
||||||
void setSoftmuteFM(uint8_t mode);
|
void setSoftmuteFM(uint8_t mode);
|
||||||
void setSoftmuteAM(uint8_t mode);
|
void setSoftmuteAM(uint8_t mode);
|
||||||
void setMono(bool mono);
|
void setMono(bool mono);
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ bool devTEF_Radio_Get_Quality_Status_AM (int16_t *level, uint16_t *noise, uint16
|
|||||||
*mod = Convert8bto16b(buf + 12) / 10;
|
*mod = Convert8bto16b(buf + 12) / 10;
|
||||||
if (*level < -200) *level = -200;
|
if (*level < -200) *level = -200;
|
||||||
if (*level > 1200) *level = 1200;
|
if (*level > 1200) *level = 1200;
|
||||||
*snr = int(0.46222375 * (float)(*level) / 10 - 0.082495118 * (float)(*noise/50) / 10) + 10;
|
*snr = int(0.46222375 * (float)(*level) / 10 - 0.082495118 * (float)(*noise / 50) / 10) + 10;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,3 +290,11 @@ bool devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq) {
|
|||||||
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 0);
|
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool devTEF_Radio_Set_I2S_Input(bool mode) {
|
||||||
|
if (mode) {
|
||||||
|
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, 32);
|
||||||
|
} else {
|
||||||
|
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -107,5 +107,6 @@ bool devTEF_Radio_Set_StHiBlend_Noise(uint8_t mode, uint16_t start, uint16_t slo
|
|||||||
bool devTEF_Radio_Set_StHiBlend_Mph(uint8_t mode, uint16_t start, uint16_t slope);
|
bool devTEF_Radio_Set_StHiBlend_Mph(uint8_t mode, uint16_t start, uint16_t slope);
|
||||||
bool devTEF_Radio_Set_NoisBlanker(uint8_t mode, uint16_t start);
|
bool devTEF_Radio_Set_NoisBlanker(uint8_t mode, uint16_t start);
|
||||||
bool devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq);
|
bool devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq);
|
||||||
|
bool devTEF_Radio_Set_I2S_Input(bool mode);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -30,7 +30,8 @@ static const unsigned char tuner_init_tab[] = {
|
|||||||
9, 0x20, 0x4A, 0x01, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x8C,
|
9, 0x20, 0x4A, 0x01, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x8C,
|
||||||
7, 0x20, 0x4B, 0x01, 0x00, 0x00, 0x0F, 0xA0,
|
7, 0x20, 0x4B, 0x01, 0x00, 0x00, 0x0F, 0xA0,
|
||||||
5, 0x20, 0x56, 0x01, 0x03, 0x84,
|
5, 0x20, 0x56, 0x01, 0x03, 0x84,
|
||||||
7, 0x30, 0x15, 0x01, 0x00, 0x80, 0x00, 0x01
|
7, 0x30, 0x15, 0x01, 0x00, 0x80, 0x00, 0x01,
|
||||||
|
13, 0x30, 0x16, 0x01, 0x00, 0x20, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x12, 0xc0
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned char tuner_init_tab4000[] = {
|
static const unsigned char tuner_init_tab4000[] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user