Hamlib
1.2.15
|
00001 /* 00002 * Hamlib Interface - setting2idx for builtin constants 00003 * Copyright (c) 2002-2005 by Stephane Fillod and Frank Singleton 00004 * 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 * 00020 */ 00021 00022 #ifndef _IDX_BUILTIN_H 00023 #define _IDX_BUILTIN_H 1 00024 00025 #include <hamlib/rig.h> 00026 00027 /* 00028 * only for Hamlib internal use (backend caps) 00029 * This is a rig_setting2idx version that works for builtin_constant, 00030 * hence allowing its use in array initializers. The compiler simplifies 00031 * everything at compile time. 00032 * 00033 * struct rig_caps foo = { 00034 * .level_gran = { [LVL_PREAMP] = { .min = 0, .max = 20, .step = 10 } }, 00035 * } 00036 * 00037 * Of course, it can't work with setting2idx_builtin(RIG_LEVEL_XX|RIG_LEVEL_YY) 00038 */ 00039 00040 #define setting2idx_builtin(s) ((s)==(1<<0)?0: \ 00041 (s)==(1<<1)?1: \ 00042 (s)==(1<<2)?2: \ 00043 (s)==(1<<3)?3: \ 00044 (s)==(1<<4)?4: \ 00045 (s)==(1<<5)?5: \ 00046 (s)==(1<<6)?6: \ 00047 (s)==(1<<7)?7: \ 00048 (s)==(1<<8)?8: \ 00049 (s)==(1<<9)?9: \ 00050 (s)==(1<<10)?10: \ 00051 (s)==(1<<11)?11: \ 00052 (s)==(1<<12)?12: \ 00053 (s)==(1<<13)?13: \ 00054 (s)==(1<<14)?14: \ 00055 (s)==(1<<15)?15: \ 00056 (s)==(1<<16)?16: \ 00057 (s)==(1<<17)?17: \ 00058 (s)==(1<<18)?18: \ 00059 (s)==(1<<19)?19: \ 00060 (s)==(1<<20)?20: \ 00061 (s)==(1<<21)?21: \ 00062 (s)==(1<<22)?22: \ 00063 (s)==(1<<23)?23: \ 00064 (s)==(1<<24)?24: \ 00065 (s)==(1<<25)?25: \ 00066 (s)==(1<<26)?26: \ 00067 (s)==(1<<27)?27: \ 00068 (s)==(1<<28)?28: \ 00069 (s)==(1<<29)?29: \ 00070 (s)==(1<<30)?30: \ 00071 (s)==(1<<31)?31: \ 00072 0 \ 00073 ) 00074 00075 #define LVL_PREAMP setting2idx_builtin(RIG_LEVEL_PREAMP) 00076 #define LVL_ATT setting2idx_builtin(RIG_LEVEL_ATT) 00077 #define LVL_VOX setting2idx_builtin(RIG_LEVEL_VOX) 00078 #define LVL_AF setting2idx_builtin(RIG_LEVEL_AF) 00079 #define LVL_RF setting2idx_builtin(RIG_LEVEL_RF) 00080 #define LVL_SQL setting2idx_builtin(RIG_LEVEL_SQL) 00081 #define LVL_IF setting2idx_builtin(RIG_LEVEL_IF) 00082 #define LVL_APF setting2idx_builtin(RIG_LEVEL_APF) 00083 #define LVL_NR setting2idx_builtin(RIG_LEVEL_NR) 00084 #define LVL_PBT_IN setting2idx_builtin(RIG_LEVEL_PBT_IN) 00085 #define LVL_PBT_OUT setting2idx_builtin(RIG_LEVEL_PBT_OUT) 00086 #define LVL_CWPITCH setting2idx_builtin(RIG_LEVEL_CWPITCH) 00087 #define LVL_RFPOWER setting2idx_builtin(RIG_LEVEL_RFPOWER) 00088 #define LVL_MICGAIN setting2idx_builtin(RIG_LEVEL_MICGAIN) 00089 #define LVL_KEYSPD setting2idx_builtin(RIG_LEVEL_KEYSPD) 00090 #define LVL_NOTCHF setting2idx_builtin(RIG_LEVEL_NOTCHF) 00091 #define LVL_COMP setting2idx_builtin(RIG_LEVEL_COMP) 00092 #define LVL_AGC setting2idx_builtin(RIG_LEVEL_AGC) 00093 #define LVL_BKINDL setting2idx_builtin(RIG_LEVEL_BKINDL) 00094 #define LVL_BALANCE setting2idx_builtin(RIG_LEVEL_BALANCE) 00095 #define LVL_METER setting2idx_builtin(RIG_LEVEL_METER) 00096 #define LVL_VOXGAIN setting2idx_builtin(RIG_LEVEL_VOXGAIN) 00097 #define LVL_VOXDELAY setting2idx_builtin(RIG_LEVEL_VOXDELAY) 00098 #define LVL_ANTIVOX setting2idx_builtin(RIG_LEVEL_ANTIVOX) 00099 00100 #define LVL_RAWSTR setting2idx_builtin(RIG_LEVEL_RAWSTR) 00101 #define LVL_SQLSTAT setting2idx_builtin(RIG_LEVEL_SQLSTAT) 00102 #define LVL_SWR setting2idx_builtin(RIG_LEVEL_SWR) 00103 #define LVL_ALC setting2idx_builtin(RIG_LEVEL_ALC) 00104 #define LVL_STRENGTH setting2idx_builtin(RIG_LEVEL_STRENGTH) 00105 /*#define LVL_BWC setting2idx_builtin(RIG_LEVEL_BWC)*/ 00106 00107 #define PARM_ANN setting2idx_builtin(RIG_PARM_ANN) 00108 #define PARM_APO setting2idx_builtin(RIG_PARM_APO) 00109 #define PARM_BACKLIGHT setting2idx_builtin(RIG_PARM_BACKLIGHT) 00110 #define PARM_BEEP setting2idx_builtin(RIG_PARM_BEEP) 00111 #define PARM_TIME setting2idx_builtin(RIG_PARM_TIME) 00112 #define PARM_BAT setting2idx_builtin(RIG_PARM_BAT) 00113 #define PARM_KEYLIGHT setting2idx_builtin(RIG_PARM_KEYLIGHT) 00114 00115 00116 #endif /* _IDX_BUILTIN_H */
Hamlib documentation for version 1.2.15 -- Thu Feb 2 2012 21:37:27
Project page: http://www.hamlib.org