feat: added APF for CW in Icom
This commit is contained in:
@@ -415,6 +415,7 @@ type IcomTXState struct {
|
||||
NR bool `json:"nr"`
|
||||
NRLevel int `json:"nr_level"`
|
||||
ANF bool `json:"anf"`
|
||||
APF bool `json:"apf"` // audio peak filter (CW only)
|
||||
AGC string `json:"agc,omitempty"` // FAST | MID | SLOW
|
||||
Preamp int `json:"preamp"` // 0=off, 1=P.AMP1, 2=P.AMP2
|
||||
Att int `json:"att"` // dB attenuation, 0=off
|
||||
@@ -450,6 +451,7 @@ type IcomController interface {
|
||||
SetNR(bool) error
|
||||
SetNRLevel(int) error
|
||||
SetANF(bool) error
|
||||
SetAPF(bool) error
|
||||
SetAGC(string) error
|
||||
SetPreamp(int) error
|
||||
SetAtt(int) error
|
||||
|
||||
@@ -110,6 +110,7 @@ const (
|
||||
SubSwVOX = 0x46 // VOX on/off
|
||||
SubSwBreakIn = 0x47 // CW break-in: 0=OFF, 1=SEMI, 2=FULL (needed so 0x17 CW keys TX)
|
||||
SubSwMN = 0x48 // manual notch on/off
|
||||
SubSwAPF = 0x32 // audio peak filter on/off (CW only)
|
||||
)
|
||||
|
||||
// CW break-in modes (CmdSwitch 0x47).
|
||||
|
||||
@@ -1166,6 +1166,9 @@ func (b *IcomSerial) readDSP() {
|
||||
if v, ok := b.readSwitch(civ.SubSwANF); ok {
|
||||
st.ANF = v != 0
|
||||
}
|
||||
if v, ok := b.readSwitch(civ.SubSwAPF); ok {
|
||||
st.APF = v != 0
|
||||
}
|
||||
if v, ok := b.readSwitch(civ.SubSwAGC); ok {
|
||||
st.AGC = agcName(v)
|
||||
}
|
||||
@@ -1357,6 +1360,14 @@ func (b *IcomSerial) SetANF(on bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *IcomSerial) SetAPF(on bool) error {
|
||||
if err := b.exec(civ.CmdSwitch, civ.SubSwAPF, boolByte(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
b.setCache(func(s *IcomTXState) { s.APF = on })
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *IcomSerial) SetAGC(name string) error {
|
||||
v := agcValue(name)
|
||||
if v == 0 {
|
||||
|
||||
Reference in New Issue
Block a user