Skip to content

Commit

Permalink
Merge pull request #1688 from DSheirer/1687-rtl2832-fc0013
Browse files Browse the repository at this point in the history
Support For RTL2832 With Embedded FC0013 Tuner
  • Loading branch information
DSheirer committed Nov 4, 2023
2 parents a27ddbe + 50bdf0e commit bee0405
Show file tree
Hide file tree
Showing 11 changed files with 1,399 additions and 23 deletions.
Expand Up @@ -55,6 +55,9 @@
import io.github.dsheirer.source.tuner.rtl.e4k.E4KEmbeddedTuner;
import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerEditor;
import io.github.dsheirer.source.tuner.rtl.fc0013.FC0013EmbeddedTuner;
import io.github.dsheirer.source.tuner.rtl.fc0013.FC0013TunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.fc0013.FC0013TunerEditor;
import io.github.dsheirer.source.tuner.rtl.r8x.R8xTunerEditor;
import io.github.dsheirer.source.tuner.rtl.r8x.r820t.R820TEmbeddedTuner;
import io.github.dsheirer.source.tuner.rtl.r8x.r820t.R820TTunerConfiguration;
Expand Down Expand Up @@ -368,6 +371,7 @@ public static EmbeddedTuner getRtlEmbeddedTuner(TunerType tunerType,
return switch(tunerType)
{
case ELONICS_E4000 -> new E4KEmbeddedTuner(adapter);
case FITIPOWER_FC0013 -> new FC0013EmbeddedTuner(adapter);
case RAFAELMICRO_R820T -> new R820TEmbeddedTuner(adapter);
case RAFAELMICRO_R828D -> new R828DEmbeddedTuner(adapter);
default -> throw new SourceException("Unsupported/Unrecognized Tuner Type: " + tunerType);
Expand All @@ -387,6 +391,8 @@ public static TunerConfiguration getTunerConfiguration(TunerType type, String un
return new AirspyTunerConfiguration(uniqueID);
case ELONICS_E4000:
return new E4KTunerConfiguration(uniqueID);
case FITIPOWER_FC0013:
return new FC0013TunerConfiguration(uniqueID);
case FUNCUBE_DONGLE_PRO:
return new FCD1TunerConfiguration(uniqueID);
case FUNCUBE_DONGLE_PRO_PLUS:
Expand Down Expand Up @@ -479,6 +485,8 @@ else if(discoveredRspTuner instanceof DiscoveredRspDuoTuner2 duoTuner2)
{
case ELONICS_E4000:
return new E4KTunerEditor(userPreferences, tunerManager, discoveredTuner);
case FITIPOWER_FC0013:
return new FC0013TunerEditor(userPreferences, tunerManager, discoveredTuner);
case RAFAELMICRO_R820T:
case RAFAELMICRO_R828D:
return new R8xTunerEditor(userPreferences, tunerManager, discoveredTuner);
Expand Down
Expand Up @@ -31,6 +31,7 @@
import io.github.dsheirer.source.tuner.hackrf.HackRFTunerConfiguration;
import io.github.dsheirer.source.tuner.recording.RecordingTunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.fc0013.FC0013TunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.r8x.r820t.R820TTunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.r8x.r828d.R828DTunerConfiguration;
import io.github.dsheirer.source.tuner.sdrplay.RspTunerConfiguration;
Expand All @@ -43,6 +44,7 @@
@JsonSubTypes.Type(value = AirspyTunerConfiguration.class, name = "airspyTunerConfiguration"),
@JsonSubTypes.Type(value = AirspyHfTunerConfiguration.class, name = "airspyHfTunerConfiguration"),
@JsonSubTypes.Type(value = E4KTunerConfiguration.class, name = "e4KTunerConfiguration"),
@JsonSubTypes.Type(value = FC0013TunerConfiguration.class, name = "fc0013TunerConfiguration"),
@JsonSubTypes.Type(value = FCD1TunerConfiguration.class, name = "fcd1TunerConfiguration"),
@JsonSubTypes.Type(value = FCD2TunerConfiguration.class, name = "fcd2TunerConfiguration"),
@JsonSubTypes.Type(value = HackRFTunerConfiguration.class, name = "hackRFTunerConfiguration"),
Expand Down
Expand Up @@ -24,6 +24,7 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.github.dsheirer.source.tuner.configuration.TunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.fc0013.FC0013TunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.r8x.r820t.R820TTunerConfiguration;
import io.github.dsheirer.source.tuner.rtl.r8x.r828d.R828DTunerConfiguration;

Expand All @@ -33,6 +34,7 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = E4KTunerConfiguration.class, name = "e4KTunerConfiguration"),
@JsonSubTypes.Type(value = FC0013TunerConfiguration.class, name = "fc0013TunerConfiguration"),
@JsonSubTypes.Type(value = R820TTunerConfiguration.class, name = "r820TTunerConfiguration"),
@JsonSubTypes.Type(value = R828DTunerConfiguration.class, name = "r828DTunerConfiguration"),
})
Expand Down
Expand Up @@ -354,21 +354,28 @@ private void setIFFrequency(int frequency) throws LibUsbException
*/
public String getUniqueID()
{
if(mDescriptor != null && mDescriptor.hasSerial())
if(mDescriptor != null)
{
if(hasEmbeddedTuner())
if(mDescriptor.hasSerial())
{
return TunerClass.RTL2832 + "/" + getTunerType().getLabel() + " " + mDescriptor.getSerial();
if(hasEmbeddedTuner())
{
return TunerClass.RTL2832 + "/" + getTunerType().getLabel() + " " + mDescriptor.getSerial();
}
else
{
return TunerClass.RTL2832 + " " + mDescriptor.getSerial();
}
}
else
{
return TunerClass.RTL2832 + " " + mDescriptor.getSerial();
return "RTL-2832 USB Bus:" + mBus + " Port:" + mPortAddress;
}
}
else
{
int serial = (0xFF & getDeviceDescriptor().iSerialNumber());
return TunerClass.RTL2832.toString() + " " + serial;
return TunerClass.RTL2832 + " " + serial;
}
}

Expand Down Expand Up @@ -593,10 +600,9 @@ private void setGPIOOutput(byte bitMask) throws LibUsbException
*/
private void enableI2CRepeater(boolean enabled) throws LibUsbException
{
Page page = Page.ONE;
short address = 1;
int value = (enabled ? 0x18 : 0x10);
writeDemodRegister(page, address, value, 1);
writeDemodRegister(Page.ONE, address, value, 1);
}

/**
Expand Down

0 comments on commit bee0405

Please sign in to comment.