| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  *  Hamlib Uniden backend - BC895 description | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  |  *  Copyright (c) 2001-2008 by Stephane Fillod | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2011-08-23 01:59:19 +00:00
										 |  |  |  *   This library is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  *   modify it under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  |  *   License as published by the Free Software Foundation; either | 
					
						
							|  |  |  |  *   version 2.1 of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2011-08-23 01:59:19 +00:00
										 |  |  |  *   This library is distributed in the hope that it will be useful, | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  |  *   but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							| 
									
										
										
										
											2011-08-23 01:59:19 +00:00
										 |  |  |  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
					
						
							|  |  |  |  *   Lesser General Public License for more details. | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2011-08-23 01:59:19 +00:00
										 |  |  |  *   You should have received a copy of the GNU Lesser General Public | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  |  *   License along with this library; if not, write to the Free Software | 
					
						
							| 
									
										
										
										
											2011-08-23 01:59:19 +00:00
										 |  |  |  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef HAVE_CONFIG_H
 | 
					
						
							|  |  |  | #include "config.h"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-10-01 19:32:04 +00:00
										 |  |  | #include <stdlib.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | #include <hamlib/rig.h>
 | 
					
						
							|  |  |  | #include "uniden.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define BC895_MODES (RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_WFM)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | #define BC895_FUNC (RIG_FUNC_MUTE)
 | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | #define BC895_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_RAWSTR)
 | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define BC895_PARM_ALL (RIG_PARM_NONE)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define BC895_VFO RIG_VFO_A
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | #define BC895_CHANNEL_CAPS \
 | 
					
						
							|  |  |  | 		UNIDEN_CHANNEL_CAPS \ | 
					
						
							|  |  |  | 		.ctcss_sql=1, \ | 
					
						
							|  |  |  | 		.dcs_sql=1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* The BC895 seems to max out at 32 while 12 seems to be about minimum. */ | 
					
						
							|  |  |  | #define BC895_STR_CAL { 4, \
 | 
					
						
							|  |  |  |         { \ | 
					
						
							|  |  |  | 		{   0, -54 }, \ | 
					
						
							|  |  |  | 		{  12, -20 }, /* TBC */ \ | 
					
						
							|  |  |  | 		{  32,   4 }, /* TBC */ \ | 
					
						
							|  |  |  | 		{ 255,  60 }, \ | 
					
						
							|  |  |  | 	} } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * bc895 rig capabilities. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * TODO: check this with manual or web site. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | const struct rig_caps bc895_caps = { | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .rig_model =  RIG_MODEL_BC895, | 
					
						
							|  |  |  | .model_name = "BC895xlt", | 
					
						
							|  |  |  | .mfg_name =  "Uniden", | 
					
						
							| 
									
										
										
										
											2005-04-03 20:23:19 +00:00
										 |  |  | .version =  BACKEND_VER, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .copyright =  "LGPL", | 
					
						
							|  |  |  | .status =  RIG_STATUS_UNTESTED, | 
					
						
							|  |  |  | .rig_type =  RIG_TYPE_TRUNKSCANNER, | 
					
						
							|  |  |  | .ptt_type =  RIG_PTT_NONE, | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | .dcd_type =  RIG_DCD_RIG, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .port_type =  RIG_PORT_SERIAL, | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | .serial_rate_min =  2400, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .serial_rate_max =  9600, | 
					
						
							|  |  |  | .serial_data_bits =  8, | 
					
						
							|  |  |  | .serial_stop_bits =  1, | 
					
						
							|  |  |  | .serial_parity =  RIG_PARITY_NONE, | 
					
						
							|  |  |  | .serial_handshake =  RIG_HANDSHAKE_NONE, | 
					
						
							|  |  |  | .write_delay =  0, | 
					
						
							|  |  |  | .post_write_delay =  1, | 
					
						
							|  |  |  | .timeout =  200, | 
					
						
							|  |  |  | .retry =  3, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .has_get_func =  BC895_FUNC, | 
					
						
							|  |  |  | .has_set_func =  BC895_FUNC, | 
					
						
							|  |  |  | .has_get_level =  BC895_LEVEL_ALL, | 
					
						
							|  |  |  | .has_set_level =  RIG_LEVEL_SET(BC895_LEVEL_ALL), | 
					
						
							|  |  |  | .has_get_parm =  BC895_PARM_ALL, | 
					
						
							|  |  |  | .has_set_parm =  RIG_PARM_SET(BC895_PARM_ALL), | 
					
						
							|  |  |  | .level_gran =  {},                 /* FIXME: granularity */ | 
					
						
							|  |  |  | .parm_gran =  {}, | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | .ctcss_list =  uniden_ctcss_list, | 
					
						
							|  |  |  | .dcs_list =  uniden_dcs_list, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .preamp =   { RIG_DBLST_END }, | 
					
						
							|  |  |  | .attenuator =   { RIG_DBLST_END }, | 
					
						
							|  |  |  | .max_rit =  Hz(0), | 
					
						
							|  |  |  | .max_xit =  Hz(0), | 
					
						
							|  |  |  | .max_ifshift =  Hz(0), | 
					
						
							|  |  |  | .targetable_vfo =  0, | 
					
						
							|  |  |  | .transceive =  RIG_TRN_OFF, | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | .bank_qty =   10,	/* A..J */ | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .chan_desc_sz =  0, | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | .str_cal = BC895_STR_CAL, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | .chan_list =  { | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | 		{ 1, 300, RIG_MTYPE_MEM, {BC895_CHANNEL_CAPS} }, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | 		RIG_CHAN_END, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .rx_range_list1 =  { RIG_FRNG_END, },    /* FIXME: enter region 1 setting */ | 
					
						
							|  |  |  | .tx_range_list1 =  { RIG_FRNG_END, }, | 
					
						
							|  |  |  | .rx_range_list2 =  { | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | 	{MHz(29),MHz(956),BC895_MODES,-1,-1,BC895_VFO}, | 
					
						
							|  |  |  | 	RIG_FRNG_END, | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .tx_range_list2 =  { RIG_FRNG_END, }, | 
					
						
							|  |  |  | .tuning_steps =  { | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | 	 {BC895_MODES,kHz(5)}, | 
					
						
							|  |  |  | 	 {BC895_MODES,kHz(7.5)}, | 
					
						
							|  |  |  | 	 {BC895_MODES,kHz(10)}, | 
					
						
							|  |  |  | 	 {BC895_MODES,kHz(12.5)}, | 
					
						
							|  |  |  | 	 {BC895_MODES,kHz(25)}, | 
					
						
							|  |  |  | 	 {BC895_MODES,kHz(50)}, | 
					
						
							|  |  |  | 	 RIG_TS_END, | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | 	 RIG_TS_END, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  |         /* mode/filter list, remember: order matters! */ | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .filters =  { | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | 		{RIG_MODE_AM|RIG_MODE_FM, kHz(8)}, | 
					
						
							|  |  |  | 		{RIG_MODE_WFM, kHz(230)}, | 
					
						
							|  |  |  | 		RIG_FLT_END, | 
					
						
							|  |  |  | 	}, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .priv =  NULL, | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .set_freq =  uniden_set_freq, | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | .get_freq =  uniden_get_freq, | 
					
						
							|  |  |  | .set_mode =  uniden_set_mode, | 
					
						
							|  |  |  | .get_mode =  uniden_get_mode, | 
					
						
							| 
									
										
										
										
											2002-08-16 17:43:02 +00:00
										 |  |  | .set_mem =  uniden_set_mem, | 
					
						
							| 
									
										
										
										
											2008-05-04 14:23:54 +00:00
										 |  |  | .get_mem =  uniden_get_mem, | 
					
						
							|  |  |  | .get_dcd =  uniden_get_dcd, | 
					
						
							|  |  |  | .get_info =  uniden_get_info, | 
					
						
							|  |  |  | .get_level = uniden_get_level, | 
					
						
							|  |  |  | .set_level = uniden_set_level, | 
					
						
							|  |  |  | .get_channel = uniden_get_channel, | 
					
						
							|  |  |  | .set_channel = uniden_set_channel, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-07-14 16:45:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Function definitions below | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 |