kopia lustrzana https://github.com/Hamlib/Hamlib
				
				
				
			Patch from Lars E. Pettersson, sm6rpz
The code should work on IC-751 and IC-751A, both with the original Icom UX-14 board (an option needed to be able to use CI-V) and the Piexx UX-14px-board. The Piexx UX-14px board have the same capabilities as the Icom one, but adds S-meter reading, and PTT (can not read if the PTT is set though.) The Icom IC-751 had FM as an option, the IC-751A had FM built in. I had to add an extra if-statement in frame.c for the CW-narrow to work. The bandwidth numbers used by Icom seem to be a jungle... git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2070 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.5
							rodzic
							
								
									0b324fe2cd
								
							
						
					
					
						commit
						8c4087e7d6
					
				
							
								
								
									
										10
									
								
								icom/frame.c
								
								
								
								
							
							
						
						
									
										10
									
								
								icom/frame.c
								
								
								
								
							| 
						 | 
				
			
			@ -1,8 +1,8 @@
 | 
			
		|||
/*
 | 
			
		||||
 *  Hamlib CI-V backend - low level communication routines
 | 
			
		||||
 *  Copyright (c) 2000-2005 by Stephane Fillod
 | 
			
		||||
 *  Copyright (c) 2000-2006 by Stephane Fillod
 | 
			
		||||
 *
 | 
			
		||||
 *	$Id: frame.c,v 1.27 2005-04-20 15:31:26 fillods Exp $
 | 
			
		||||
 *	$Id: frame.c,v 1.28 2006-02-26 18:48:07 fillods Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *   This library is free software; you can redistribute it and/or modify
 | 
			
		||||
 *   it under the terms of the GNU Library General Public License as
 | 
			
		||||
| 
						 | 
				
			
			@ -372,6 +372,12 @@ void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode, pbwidth_t
 | 
			
		|||
		case 0x01: *width = rig_passband_normal(rig, *mode); break;
 | 
			
		||||
		case 0x02: *width = rig_passband_wide(rig, *mode); break;
 | 
			
		||||
		case -1: break;		/* no passband data */
 | 
			
		||||
	case 0x03:
 | 
			
		||||
		if (rig->caps->rig_model == RIG_MODEL_IC751) {
 | 
			
		||||
			*width = rig_passband_narrow(rig, *mode);
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		/* else fall through */
 | 
			
		||||
	default:
 | 
			
		||||
		rig_debug(RIG_DEBUG_ERR,"icom: Unsupported Icom mode width %#.2x\n",
 | 
			
		||||
						pd);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										67
									
								
								icom/ic751.c
								
								
								
								
							
							
						
						
									
										67
									
								
								icom/ic751.c
								
								
								
								
							| 
						 | 
				
			
			@ -1,8 +1,8 @@
 | 
			
		|||
/*
 | 
			
		||||
 *  Hamlib CI-V backend - description of IC-751 and variations
 | 
			
		||||
 *  Copyright (c) 2000-2004 by Stephane Fillod
 | 
			
		||||
 *  Copyright (c) 2000-2006 by Stephane Fillod
 | 
			
		||||
 *
 | 
			
		||||
 *	$Id: ic751.c,v 1.2 2005-04-03 19:53:51 fillods Exp $
 | 
			
		||||
 *	$Id: ic751.c,v 1.3 2006-02-26 18:48:07 fillods Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *   This library is free software; you can redistribute it and/or modify
 | 
			
		||||
 *   it under the terms of the GNU Library General Public License as
 | 
			
		||||
| 
						 | 
				
			
			@ -29,17 +29,20 @@
 | 
			
		|||
#include "hamlib/rig.h"
 | 
			
		||||
#include "bandplan.h"
 | 
			
		||||
#include "icom.h"
 | 
			
		||||
#include "idx_builtin.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define IC751_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY)
 | 
			
		||||
/*
 | 
			
		||||
 * FM is an option on the Icom IC-751, and built-in in the Icom IC-751A
 | 
			
		||||
 */
 | 
			
		||||
#define IC751_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * 200W in all modes but AM (40W)
 | 
			
		||||
 */ 
 | 
			
		||||
#define IC751_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY)
 | 
			
		||||
#define IC751_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_FM)
 | 
			
		||||
#define IC751_AM_TX_MODES (RIG_MODE_AM)
 | 
			
		||||
 | 
			
		||||
#define IC751_VFO_ALL (RIG_VFO_A)
 | 
			
		||||
#define IC751_VFO_ALL (RIG_VFO_VFO|RIG_VFO_MEM)
 | 
			
		||||
 | 
			
		||||
#define IC751_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -47,6 +50,31 @@
 | 
			
		|||
 | 
			
		||||
#define IC751_ANTS RIG_ANT_1
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * S-Meter measurements
 | 
			
		||||
 * (Only the Piexx UX-14px rev.2 and up has an S-meter option.)
 | 
			
		||||
 * Values based on the readings of my IC-751A S-meter, i.e. not
 | 
			
		||||
 * actual signal strength. -- Lars, sm6rpz
 | 
			
		||||
 */
 | 
			
		||||
#define IC751_STR_CAL { 16,  { \
 | 
			
		||||
			{   3, -52 }, /* S0.5 */ \
 | 
			
		||||
			{  12, -48 }, /* S1 */ \
 | 
			
		||||
			{  33, -42 }, /* S2 */ \
 | 
			
		||||
			{  45, -36 }, /* S3 */ \
 | 
			
		||||
			{  60, -30 }, /* S4 */ \
 | 
			
		||||
			{  73, -24 }, /* S5 */ \
 | 
			
		||||
			{  86, -18 }, /* S6 */ \
 | 
			
		||||
			{ 100, -12 }, /* S7 */ \
 | 
			
		||||
			{ 115,  -6 }, /* S8 */ \
 | 
			
		||||
			{ 129,   0 }, /* S9 */ \
 | 
			
		||||
			{ 160,  10 }, /* S9+10 */ \
 | 
			
		||||
			{ 186,  20 }, /* S9+20 */ \
 | 
			
		||||
			{ 208,  30 }, /* S9+30 */ \
 | 
			
		||||
			{ 226,  40 }, /* S9+40 */ \
 | 
			
		||||
			{ 241,  50 }, /* S9+50 */ \
 | 
			
		||||
			{ 255,  60 }  /* S9+60 */ \
 | 
			
		||||
				} }
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 */
 | 
			
		||||
static const struct icom_priv_caps ic751_priv_caps = { 
 | 
			
		||||
| 
						 | 
				
			
			@ -59,15 +87,15 @@ const struct rig_caps ic751_caps = {
 | 
			
		|||
.rig_model =  RIG_MODEL_IC751,
 | 
			
		||||
.model_name = "IC-751", 
 | 
			
		||||
.mfg_name =  "Icom", 
 | 
			
		||||
.version =  BACKEND_VER, 
 | 
			
		||||
.version =  BACKEND_VER ".1",
 | 
			
		||||
.copyright =  "LGPL",
 | 
			
		||||
.status =  RIG_STATUS_UNTESTED,
 | 
			
		||||
.status =  RIG_STATUS_BETA,
 | 
			
		||||
.rig_type =  RIG_TYPE_TRANSCEIVER,
 | 
			
		||||
.ptt_type =  RIG_PTT_NONE,
 | 
			
		||||
.ptt_type =  RIG_PTT_RIG, /* Piexx UX-14px has a PTT option */
 | 
			
		||||
.dcd_type =  RIG_DCD_NONE,
 | 
			
		||||
.port_type =  RIG_PORT_SERIAL,
 | 
			
		||||
.serial_rate_min =  1200,
 | 
			
		||||
.serial_rate_max =  1200,
 | 
			
		||||
.serial_rate_max =  9600, /* Piexx UX-14px can use 9600 */
 | 
			
		||||
.serial_data_bits =  8,
 | 
			
		||||
.serial_stop_bits =  1,
 | 
			
		||||
.serial_parity =  RIG_PARITY_NONE,
 | 
			
		||||
| 
						 | 
				
			
			@ -78,11 +106,14 @@ const struct rig_caps ic751_caps = {
 | 
			
		|||
.retry =  3, 
 | 
			
		||||
.has_get_func =  RIG_FUNC_NONE,
 | 
			
		||||
.has_set_func =  RIG_FUNC_NONE, 
 | 
			
		||||
.has_get_level =  RIG_LEVEL_NONE,
 | 
			
		||||
/* Piexx UX-14px has an S-meter option */
 | 
			
		||||
.has_get_level =  (RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH),
 | 
			
		||||
.has_set_level =  RIG_LEVEL_NONE,
 | 
			
		||||
.has_get_parm =  RIG_PARM_NONE,
 | 
			
		||||
.has_set_parm =  RIG_PARM_NONE,
 | 
			
		||||
.level_gran =  {},
 | 
			
		||||
.level_gran =  {
 | 
			
		||||
	[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
 | 
			
		||||
},
 | 
			
		||||
.parm_gran =  {},
 | 
			
		||||
.ctcss_list =  NULL,
 | 
			
		||||
.dcs_list =  NULL,
 | 
			
		||||
| 
						 | 
				
			
			@ -99,7 +130,7 @@ const struct rig_caps ic751_caps = {
 | 
			
		|||
.chan_desc_sz =  0,
 | 
			
		||||
 | 
			
		||||
.chan_list =  {
 | 
			
		||||
	{   1,  26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },	/* TBC */
 | 
			
		||||
	{   1,  32, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
 | 
			
		||||
	RIG_CHAN_END,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -158,11 +189,16 @@ const struct rig_caps ic751_caps = {
 | 
			
		|||
	},
 | 
			
		||||
	/* mode/filter list, remember: order matters! */
 | 
			
		||||
.filters = 	{
 | 
			
		||||
	{RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_RTTY, kHz(2.3)},
 | 
			
		||||
	{RIG_MODE_SSB, kHz(2.3)},
 | 
			
		||||
	{RIG_MODE_RTTY|RIG_MODE_CW, Hz(500)},
 | 
			
		||||
	{RIG_MODE_RTTY|RIG_MODE_CW, Hz(250)},
 | 
			
		||||
	{RIG_MODE_AM, kHz(6)},
 | 
			
		||||
	{RIG_MODE_FM, kHz(15)},
 | 
			
		||||
	RIG_FLT_END,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
.str_cal = IC751_STR_CAL,
 | 
			
		||||
 | 
			
		||||
.cfgparams =  icom_cfg_params,
 | 
			
		||||
.set_conf =  icom_set_conf,
 | 
			
		||||
.get_conf =  icom_get_conf,
 | 
			
		||||
| 
						 | 
				
			
			@ -183,5 +219,6 @@ const struct rig_caps ic751_caps = {
 | 
			
		|||
.set_mem =  icom_set_mem,
 | 
			
		||||
.vfo_op =  icom_vfo_op,
 | 
			
		||||
 | 
			
		||||
.get_level =  icom_get_level,
 | 
			
		||||
.set_ptt =  icom_set_ptt,/* Piexx UX-14px has no get_ptt only set_ptt */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue