ft-857 power levels for 2m/70cm

pull/1592/head
Christian Bayer 2024-08-09 10:10:40 +02:00
rodzic fd153e26f4
commit 3e8b1d7a94
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 090D0F8B431A7C88
1 zmienionych plików z 23 dodań i 4 usunięć

Wyświetl plik

@ -225,6 +225,19 @@ enum ft857_digi
FT857_DIGI_USER_U,
};
#define FT857_PWR_CAL { 9, \
{ \
{ 0x00, 0.0f }, \
{ 0x01, 10.0f }, \
{ 0x02, 15.0f }, \
{ 0x03, 20.0f }, \
{ 0x04, 34.0f }, \
{ 0x05, 50.0f }, \
{ 0x06, 66.0f }, \
{ 0x07, 82.f }, \
{ 0x08, 100.0f } \
} }
#define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\
RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB)
#define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB)
@ -354,7 +367,7 @@ struct rig_caps ft857_caps =
// {RIG_MODE_WFM, kHz(230)}, /* ?? */
RIG_FLT_END,
},
.rfpower_meter_cal = FT857_PWR_CAL,
.rig_init = ft857_init,
.rig_cleanup = ft857_cleanup,
.rig_open = ft857_open,
@ -841,7 +854,7 @@ int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
return RIG_OK;
}
static int ft857_get_pometer_level(RIG *rig, value_t *val)
static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float_t *cal, float divider)
{
struct ft857_priv_data *p = (struct ft857_priv_data *) STATE(rig)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
@ -861,7 +874,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val)
{
rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F);
// does rig have 10 bars or 15?
val->f = (p->tx_status & 0x0F) / 10.0;
val->f = (p->tx_status & 0x0F) / divider;
}
else
{
@ -902,7 +915,13 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return ft857_get_smeter_level(rig, val);
case RIG_LEVEL_RFPOWER:
return ft857_get_pometer_level(rig, val);
if (144000000 >= vfo && 148000000 <= vfo) {
return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0);
}
else if (420000000 >= vfo && 450000000 <= vfo) {
return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0);
}
return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0);
default:
return -RIG_EINVAL;