Meadow.Foundation.Audio.Radio.Tea5767
Tea5767 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
The TEA5767 FM module is based on the TEA5767GH which is a single-chip, electronically tuned, FM stereo radio for low-voltage applications with fully integrated Intermediate Frequency (IF) selectivity and demodulation.
The TEA5767 is controlled via I2C. It comes with two 1/4" jacks, one for connection to a headphone/speaker and one to connect an antenna (often sold with the module).
Code Example
Tea5767 radio;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
radio = new Tea5767(Device.CreateI2cBus());
return Task.CompletedTask;
}
public async override Task Run()
{
//scan through available stations
for (int i = 0; i < 8; i++)
{
await Task.Delay(1000);
radio.SearchNextSilent();
Resolver.Log.Info($"Current frequency: {radio.GetFrequency()}");
}
//set a known station
radio.SelectFrequency(new Frequency(94.5, Frequency.UnitType.Megahertz));
}
Sample project(s) available on GitHub
Wiring Example
To wire a TEA5767 to your Meadow board, connect the following:
TEA5767 | Meadow Pin |
---|---|
GND | GND |
SCL | D08 (SCL) |
SDA | D07 (SDA) |
VCC | 3V3 |
It should look like the following diagram:
Class Tea5767
Represents a TEA5767 radio
Assembly: Tea5767.dll
View Source
public class Tea5767 : II2cPeripheral
Implements:
Meadow.Hardware.II2cPeripheral
Properties
IsMuted
Is the audio muted
View Source
public bool IsMuted { get; set; }
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
Fields
i2cComms
I2C Communication bus used to communicate with the peripheral
View Source
protected readonly II2cCommunications i2cComms
Methods
Mute()
Mute audio if not muted
View Source
public void Mute()
SelectFrequency(Frequency)
Select radio frequency
View Source
public void SelectFrequency(Frequency frequency)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Units.Frequency | frequency | the frequency |
GetFrequency()
Get the current radio frequency
View Source
public Frequency GetFrequency()
Returns
Meadow.Units.Frequency
SearchNextSilent()
Search to next station and mute while seeking
View Source
public bool SearchNextSilent()
Returns
System.Boolean
SearchNext()
Search to next station
View Source
public bool SearchNext()
Returns
System.Boolean
SearchFromBeginningMuted()
Start searching for station from lowest frequency (87Mhz)
View Source
public bool SearchFromBeginningMuted()
Returns
System.Boolean
: true if station found### SearchFromEndMuted()
Start searching for station from highest frequency (108Mhz)
View Source
public bool SearchFromEndMuted()
Returns
System.Boolean
StartSearchFromBeginning()
Start searching for station from lowest frequency (87Mhz)
View Source
public bool StartSearchFromBeginning()
Returns
System.Boolean
: true if station found### StartSearchFromEnd()
Start searching for station from highest frequency (108Mhz)
View Source
public bool StartSearchFromEnd()
Returns
System.Boolean
GetSignalLevel()
Get Signal Level
View Source
public byte GetSignalLevel()
Returns
System.Byte
: level as a byte (0-255)### IsStereo()
Is the current station stereo
View Source
public bool IsStereo()
Returns
System.Boolean
IsReady()
Is the radio ready for operation
View Source
public bool IsReady()
Returns
System.Boolean
IsSearchUp()
Is search mode up
View Source
public bool IsSearchUp()
Returns
System.Boolean
IsSearchDown()
Is search mode down
View Source
public bool IsSearchDown()
Returns
System.Boolean
IsStandby()
Is the radio in standby mode
View Source
public bool IsStandby()
Returns
System.Boolean
EnableStereo(bool)
Enable stereo if set to mono
View Source
public void EnableStereo(bool enable)
Parameters
Type | Name |
---|---|
System.Boolean | enable |
SetSoftMuteOn()
Enable soft mute
View Source
public void SetSoftMuteOn()
SetSoftMuteOff()
Turn soft mute off if enabled
View Source
public void SetSoftMuteOff()
MuteRight()
Mute the right channel
View Source
public void MuteRight()
UnmuteRight()
Unmute the right channel
View Source
public void UnmuteRight()
MuteLeft()
Mute the left channel
View Source
public void MuteLeft()
UnmuteLeft()
Unmute the left channel
View Source
public void UnmuteLeft()
EnableStandby(bool)
Enable standby mode
View Source
public void EnableStandby(bool enable)
Parameters
Type | Name |
---|---|
System.Boolean | enable |
SetHighCutControlOn()
Enable high cut control
View Source
public void SetHighCutControlOn()
SetHighCutControlOff()
Disable high cut control
View Source
public void SetHighCutControlOff()
SetStereoNoiseCancellingOn()
Enable stereo noise canceling
View Source
public void SetStereoNoiseCancellingOn()
SetStereoNoiseCancellingOff()
Disable stereo noise canceling
View Source
public void SetStereoNoiseCancellingOff()
Implements
Meadow.Hardware.II2cPeripheral