This repository has been archived by the owner on Oct 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
4,818 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#define TEF6686_h | ||
|
||
#include "Arduino.h" | ||
#include "Tuner_Api.h" | ||
#include "Tuner_Drv_Lithio.h" | ||
#include "Tuner_Interface.h" | ||
|
||
|
||
enum RDS_GROUPS | ||
{ | ||
RDS_GROUP_0A, RDS_GROUP_0B, RDS_GROUP_1A, RDS_GROUP_1B, RDS_GROUP_2A, RDS_GROUP_2B, RDS_GROUP_3A, RDS_GROUP_3B, | ||
RDS_GROUP_4A, RDS_GROUP_4B, RDS_GROUP_5A, RDS_GROUP_5B, RDS_GROUP_6A, RDS_GROUP_6B, RDS_GROUP_7A, RDS_GROUP_7B, | ||
RDS_GROUP_8A, RDS_GROUP_8B, RDS_GROUP_9A, RDS_GROUP_9B, RDS_GROUP_10A, RDS_GROUP_10B, RDS_GROUP_11A, RDS_GROUP_11B, | ||
RDS_GROUP_12A, RDS_GROUP_12B, RDS_GROUP_13A, RDS_GROUP_13B, RDS_GROUP_14A, RDS_GROUP_14B, RDS_GROUP_15A, RDS_GROUP_15B | ||
}; | ||
|
||
typedef struct _rds_ | ||
{ | ||
char picode[5]; | ||
char stationName[9]; | ||
char stationText[65]; | ||
byte stationTypeCode; | ||
char stationType[17]; | ||
uint16_t hours, minutes, days, offsetplusmin, stationID = 0, rdsA, rdsB, rdsC, rdsD, rdsError, errors = 0; | ||
int8_t offset; | ||
uint8_t stationTextOffset = 0; | ||
bool hasCT = false; | ||
bool rtAB = false; | ||
} rds_; | ||
|
||
class TEF6686 { | ||
public: | ||
rds_ rds; | ||
bool readRDS(void); | ||
uint16_t getFrequency(); | ||
uint16_t getFrequency_AM(); | ||
uint16_t tuneDown(uint8_t stepsize, uint16_t LowEdge, uint16_t HighEdge, bool fullsearchrds); | ||
uint16_t tuneUp(uint8_t stepsize, uint16_t LowEdge, uint16_t HighEdge, bool fullsearchrds); | ||
uint16_t tuneDown_AM(uint8_t stepsize); | ||
uint16_t tuneUp_AM(uint8_t stepsize); | ||
bool getStatus(int16_t &level, uint16_t &USN, uint16_t &WAM, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation); | ||
bool getStatus_AM(int16_t &level, uint16_t &USN, uint16_t &WAM, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation); | ||
bool getIdentification(uint16_t &device, uint16_t &hw_version, uint16_t &sw_version); | ||
bool getBootStatus(uint8_t &bootstatus); | ||
void setMono(uint8_t mono); | ||
bool getStereoStatus(); | ||
void init(byte TEF); | ||
void clearRDS(bool fullsearchrds); | ||
void power(uint8_t mode); | ||
void setAGC(uint8_t start); | ||
void setiMS(uint16_t mph); | ||
void setEQ(uint16_t eq); | ||
void setDeemphasis(uint8_t timeconstant); | ||
void setFMABandw(); | ||
void setFMBandw(uint16_t bandwidth); | ||
void setAMBandw(uint16_t bandwidth); | ||
void setFrequency(uint16_t frequency, uint16_t LowEdge, uint16_t HighEdge, bool fullsearchrds); | ||
void setFrequency_AM(uint16_t frequency); | ||
void setHighCutLevel(uint16_t limit); | ||
void setHighCutOffset(uint16_t start); | ||
void setMute(); | ||
void setOffset(int16_t offset); | ||
void setStereoLevel(uint16_t start); | ||
void setUnMute(); | ||
void setVolume(int16_t volume); | ||
uint8_t af_counter; | ||
|
||
private: | ||
uint16_t tune(uint8_t up, uint8_t stepsize, uint16_t LowEdge, uint16_t HighEdge, bool fullsearchrds); | ||
uint16_t tune_AM(uint8_t up, uint8_t stepsize); | ||
uint8_t ascii_converter (uint8_t src); | ||
uint8_t ps_process; | ||
uint8_t rt_process; | ||
char ps_buffer[9]; | ||
char rt_buffer[65]; | ||
bool ABold; | ||
byte rt_timer; | ||
byte offsetold; | ||
char stationTextBuffer[65]; | ||
}; |
Oops, something went wrong.
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note, that lines starting with
S
now have an additional leadingR
(examples filtered bygrep R
)aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should not happen. I'll look into it tomorrow.
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another issue: after connecting to
xdr-gtk
, sometimes the TEF display loses the bandwidth information (the value disappears). When you select another frequency, it turns to 0 kHz. Restart helps.aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is reception stopped at that point?
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Have to check.
I found another bug with Clock Time (CT). 0:13 next day is shown as 24:13 on the display. I found a station with wrong CT, but the TEF should not use hours >24.
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And can you reset the RDS fields in case of PI and/or frequency change via xdr-gtk? Currently the old PS from previous frequency will remain until the new PS is detected. Same with RT, CT and PI.
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
24 hour bug fixed.
About a reset to RDS Spy, this needs to be done by XDRGTK, I can't send a command directly to RDS Spy.
The question regarding an R before every line, I can't reproduce.
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, when I change the frequency on the TEF the RDS fields are cleared on the TEF display.
If I change the frequency through xdr-gtk then the RDS fields won't be cleared on the TEF display. It has nothing to do with Rdsspy or xdr-gtk.
Regarding R: There are still some S Lines without leading R, but the most S lines now start with RS.
How does your serial output looks like?
I have made some recordings yesterday, see
windytan/redsea#89 (comment)
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fear that the line
https://github.com/PE5PVB/TEF6686_ESP32-Archive/blob/main/TEF6686_ESP32-v116_RC/TEF6686_ESP32-v116_RC.ino#L1389
should be in line 1401 (within the if), but I have not tested it.
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Please check the released version at my new repository. https://github.com/PE5PVB/TEF6686_ESP32
aba24c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will test it on the weekend. The R Bug seems solved, as far as I can see in the source code.