| 1 | /*********************************************************************** |
| 2 | * Langford Utility |
| 3 | * |
| 4 | * This utility programs, reads, and provides access to, (most) of the |
| 5 | * onboard chips and devices. This abstracts bit-banging, and reading |
| 6 | * datasheets and provides a straightforward means of adjusting things. |
| 7 | * |
| 8 | * (c) 2013 Per Vices Corporation |
| 9 | * |
| 10 | * See LICENSE.txt for license and copyright information. |
| 11 | ************************************************************************/ |
| 12 | |
| 13 | /*To add a new ioctl function, be sure to add it to the help message and the command handler*/ |
| 14 | |
| 15 | #include <iostream> |
| 16 | #include <string> |
| 17 | #include <fcntl.h> |
| 18 | #include <unistd.h> |
| 19 | #include <sys/ioctl.h> |
| 20 | #include <sys/stat.h> |
| 21 | #include <sys/types.h> |
| 22 | #include <stdlib.h> |
| 23 | #include "langford_ioctl.h"cxx . . $ `<file>/langford_ioctl.h`/ |
| 24 | |
| 25 | using namespace std; |
| 26 | |
| 27 | |
| 28 | int maincxx . . $ main(afcd3168fc1188a4).(int argc, char **argv) { |
| 29 | int DevFD; |
| 30 | int Cmd; |
| 31 | unsigned long long val; |
| 32 | int rc = 0; |
| 33 | stringcxx . . $ std/string# CmdStrcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).; |
| 34 | |
| 35 | if ((argc < 3) || (argc > 4)) { |
| 36 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Usage:" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 37 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\t" <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). argv[0] <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " device_name Pin [Value]" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 38 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Pin can be any of:" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 39 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tN21at0, N22at0, N3GAIN" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 40 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tN61CE, N61DATA, N61CLK, N61LE, N61MUXOUT, N61LD" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 41 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tN62CE, N62DATA, N62CLK, N62LE, N62MUXOUT, N62LD" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 42 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tN3ENB, N3HILO, NASRxA, NASTxA" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 43 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tN7CLK, N7CS, N7SDI, N7SDO" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 44 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tDACIQSel, DACReset, DACCSB, DACSDIO, DACSClk, DACSDO" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 45 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tADCAnOE, ADCAPD, ADCASClk, ADCASDIO, ADCAnCS" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 46 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tADCBnOE, ADCBPD, ADCBSClk, ADCBSDIO, ADCBnCS" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 47 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tRXPhase, TXPhase" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 48 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tRXDecEn, TXIntEn" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 49 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tRXRevFreq, TXRevFreq" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 50 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tRxDspEn, TxDspEn" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 51 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tNRXTALSEL, NRVCOSEL" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 52 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tRxFifoClr, TxFifoClr" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 53 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tRxIsSigned, TxIsSigned" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 54 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tRxBaseband" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 55 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\tGPIOout, GPIOin" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 56 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "To set a value, enter a numerical value in the Value field." <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 57 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "To read a value, leave Value blank." <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 58 | return 1; |
| 59 | }; |
| 60 | |
| 61 | DevFD = open(argv[1], O_RDWRcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:45:9`!); |
| 62 | if (!DevFD) { |
| 63 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Cannot open " <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). argv[1] <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 64 | return 1; |
| 65 | }; |
| 66 | |
| 67 | CmdStr =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). argv[2]; |
| 68 | |
| 69 | /*Command handler*/ |
| 70 | if (argc == 3) { |
| 71 | //Read a value |
| 72 | if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N21at0") {Cmd = IOCTL_GET_N21at0cxx . . $ `langford_ioctl.h:19:9`!;} |
| 73 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N22at0") {Cmd = IOCTL_GET_N22at0cxx . . $ `langford_ioctl.h:21:9`!;} |
| 74 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N3GAIN") {Cmd = IOCTL_GET_N3GAINcxx . . $ `langford_ioctl.h:23:9`!;} |
| 75 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61CE") {Cmd = IOCTL_GET_N61CEcxx . . $ `langford_ioctl.h:27:9`!;} |
| 76 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61DATA") {Cmd = IOCTL_GET_N61DATAcxx . . $ `langford_ioctl.h:29:9`!;} |
| 77 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61CLK") {Cmd = IOCTL_GET_N61CLKcxx . . $ `langford_ioctl.h:31:9`!;} |
| 78 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61LE") {Cmd = IOCTL_GET_N61LEcxx . . $ `langford_ioctl.h:33:9`!;} |
| 79 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62CE") {Cmd = IOCTL_GET_N62CEcxx . . $ `langford_ioctl.h:35:9`!;} |
| 80 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62DATA") {Cmd = IOCTL_GET_N62DATAcxx . . $ `langford_ioctl.h:37:9`!;} |
| 81 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62CLK") {Cmd = IOCTL_GET_N62CLKcxx . . $ `langford_ioctl.h:39:9`!;} |
| 82 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62LE") {Cmd = IOCTL_GET_N62LEcxx . . $ `langford_ioctl.h:41:9`!;} |
| 83 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N3ENB") {Cmd = IOCTL_GET_N3ENBcxx . . $ `langford_ioctl.h:43:9`!;} |
| 84 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N3HILO") {Cmd = IOCTL_GET_N3HILOcxx . . $ `langford_ioctl.h:45:9`!;} |
| 85 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "NASRxA") {Cmd = IOCTL_GET_NASRxAcxx . . $ `langford_ioctl.h:47:9`!;} |
| 86 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "NASTxA") {Cmd = IOCTL_GET_NASTxAcxx . . $ `langford_ioctl.h:49:9`!;} |
| 87 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N7CLK") {Cmd = IOCTL_GET_N7CLKcxx . . $ `langford_ioctl.h:51:9`!;} |
| 88 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N7CS") {Cmd = IOCTL_GET_N7CScxx . . $ `langford_ioctl.h:53:9`!;} |
| 89 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N7SDI") {Cmd = IOCTL_GET_N7SDIcxx . . $ `langford_ioctl.h:55:9`!;} |
| 90 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61MUXOUT") {Cmd = IOCTL_GET_N61MUXOUTcxx . . $ `langford_ioctl.h:90:9`!;} |
| 91 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61LD") {Cmd = IOCTL_GET_N61LDcxx . . $ `langford_ioctl.h:91:9`!;} |
| 92 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62MUXOUT") {Cmd = IOCTL_GET_N62MUXOUTcxx . . $ `langford_ioctl.h:92:9`!;} |
| 93 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62LD") {Cmd = IOCTL_GET_N62LDcxx . . $ `langford_ioctl.h:93:9`!;} |
| 94 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N7SDO") {Cmd = IOCTL_GET_N7SDOcxx . . $ `langford_ioctl.h:94:9`!;} |
| 95 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACIQSel") {Cmd = IOCTL_GET_DACIQSelcxx . . $ `langford_ioctl.h:57:9`!;} |
| 96 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACReset") {Cmd = IOCTL_GET_DACResetcxx . . $ `langford_ioctl.h:59:9`!;} |
| 97 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACCSB") {Cmd = IOCTL_GET_DACCSBcxx . . $ `langford_ioctl.h:61:9`!;} |
| 98 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACSDIO") {Cmd = IOCTL_GET_DACSDIOcxx . . $ `langford_ioctl.h:63:9`!;} |
| 99 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACSClk") {Cmd = IOCTL_GET_DACSClkcxx . . $ `langford_ioctl.h:65:9`!;} |
| 100 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACSDO") {Cmd = IOCTL_GET_DACSDOcxx . . $ `langford_ioctl.h:87:9`!;} |
| 101 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCAnOE") {Cmd = IOCTL_GET_ADCAnOEcxx . . $ `langford_ioctl.h:67:9`!;} |
| 102 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCAPD") {Cmd = IOCTL_GET_ADCAPDcxx . . $ `langford_ioctl.h:69:9`!;} |
| 103 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCASClk") {Cmd = IOCTL_GET_ADCASClkcxx . . $ `langford_ioctl.h:71:9`!;} |
| 104 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCASDIO") {Cmd = IOCTL_GET_ADCASDIOcxx . . $ `langford_ioctl.h:73:9`!;} |
| 105 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCAnCS") {Cmd = IOCTL_GET_ADCAnCScxx . . $ `langford_ioctl.h:75:9`!;} |
| 106 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBnOE") {Cmd = IOCTL_GET_ADCBnOEcxx . . $ `langford_ioctl.h:77:9`!;} |
| 107 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBPD") {Cmd = IOCTL_GET_ADCBPDcxx . . $ `langford_ioctl.h:79:9`!;} |
| 108 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBSClk") {Cmd = IOCTL_GET_ADCBSClkcxx . . $ `langford_ioctl.h:81:9`!;} |
| 109 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBSDIO") {Cmd = IOCTL_GET_ADCBSDIOcxx . . $ `langford_ioctl.h:83:9`!;} |
| 110 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBnCS") {Cmd = IOCTL_GET_ADCBnCScxx . . $ `langford_ioctl.h:85:9`!;} |
| 111 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RXPhase") {Cmd = IOCTL_GET_RXPhasecxx . . $ `langford_ioctl.h:97:9`!;} |
| 112 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TXPhase") {Cmd = IOCTL_GET_TXPhasecxx . . $ `langford_ioctl.h:100:9`!;} |
| 113 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RXDecEn") {Cmd = IOCTL_GET_RXDecEncxx . . $ `langford_ioctl.h:103:9`!;} |
| 114 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TXIntEn") {Cmd = IOCTL_GET_TXIntEncxx . . $ `langford_ioctl.h:105:9`!;} |
| 115 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RXRevFreq") {Cmd = IOCTL_GET_RXRevFreqcxx . . $ `langford_ioctl.h:107:9`!;} |
| 116 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TXRevFreq") {Cmd = IOCTL_GET_TXRevFreqcxx . . $ `langford_ioctl.h:109:9`!;} |
| 117 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RxDspEn") {Cmd = IOCTL_GET_RxDspEncxx . . $ `langford_ioctl.h:111:9`!;} |
| 118 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TxDspEn") {Cmd = IOCTL_GET_TxDspEncxx . . $ `langford_ioctl.h:113:9`!;} |
| 119 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "NRXTALSEL") {Cmd = IOCTL_GET_NRXTALSELcxx . . $ `langford_ioctl.h:115:9`!;} |
| 120 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "NRVCOSEL") {Cmd = IOCTL_GET_NRVCOSELcxx . . $ `langford_ioctl.h:117:9`!;} |
| 121 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RxFifoClr") {Cmd = IOCTL_GET_RxFifoClrcxx . . $ `langford_ioctl.h:119:9`!;} |
| 122 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TxFifoClr") {Cmd = IOCTL_GET_TxFifoClrcxx . . $ `langford_ioctl.h:121:9`!;} |
| 123 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RxIsSigned"){Cmd = IOCTL_GET_RxIsSignedcxx . . $ `langford_ioctl.h:123:9`!;} |
| 124 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TxIsSigned"){Cmd = IOCTL_GET_TxIsSignedcxx . . $ `langford_ioctl.h:125:9`!;} |
| 125 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RxBaseband"){Cmd = IOCTL_GET_RxBasebandcxx . . $ `langford_ioctl.h:129:9`!;} |
| 126 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "GPIOin"){Cmd = IOCTL_GET_GPIOincxx . . $ `langford_ioctl.h:95:9`!;} |
| 127 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "GPIOout"){Cmd = IOCTL_GET_GPIOoutcxx . . $ `langford_ioctl.h:127:9`!;} |
| 128 | else { |
| 129 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Cannot read pin " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). CmdStr <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 130 | return 1; |
| 131 | }; |
| 132 | rc |= ioctl(DevFD, Cmd, &val); |
| 133 | coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(88df5bef833f7f83). CmdStr <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " is set to " <<cxx . . $ std/basic_ostream#`operator<<`(a2e659b753987ede). val <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 134 | } else if (argc == 4) { |
| 135 | //Write a value |
| 136 | if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N21at0") {Cmd = IOCTL_SET_N21at0cxx . . $ `langford_ioctl.h:20:9`!;} |
| 137 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N22at0") {Cmd = IOCTL_SET_N22at0cxx . . $ `langford_ioctl.h:22:9`!;} |
| 138 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N3GAIN") {Cmd = IOCTL_SET_N3GAINcxx . . $ `langford_ioctl.h:25:9`!;} |
| 139 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61CE") {Cmd = IOCTL_SET_N61CEcxx . . $ `langford_ioctl.h:28:9`!;} |
| 140 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61DATA") {Cmd = IOCTL_SET_N61DATAcxx . . $ `langford_ioctl.h:30:9`!;} |
| 141 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61CLK") {Cmd = IOCTL_SET_N61CLKcxx . . $ `langford_ioctl.h:32:9`!;} |
| 142 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N61LE") {Cmd = IOCTL_SET_N61LEcxx . . $ `langford_ioctl.h:34:9`!;} |
| 143 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62CE") {Cmd = IOCTL_SET_N62CEcxx . . $ `langford_ioctl.h:36:9`!;} |
| 144 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62DATA") {Cmd = IOCTL_SET_N62DATAcxx . . $ `langford_ioctl.h:38:9`!;} |
| 145 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62CLK") {Cmd = IOCTL_SET_N62CLKcxx . . $ `langford_ioctl.h:40:9`!;} |
| 146 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N62LE") {Cmd = IOCTL_SET_N62LEcxx . . $ `langford_ioctl.h:42:9`!;} |
| 147 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N3ENB") {Cmd = IOCTL_SET_N3ENBcxx . . $ `langford_ioctl.h:44:9`!;} |
| 148 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N3HILO") {Cmd = IOCTL_SET_N3HILOcxx . . $ `langford_ioctl.h:46:9`!;} |
| 149 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "NASRxA") {Cmd = IOCTL_SET_NASRxAcxx . . $ `langford_ioctl.h:48:9`!;} |
| 150 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "NASTxA") {Cmd = IOCTL_SET_NASTxAcxx . . $ `langford_ioctl.h:50:9`!;} |
| 151 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N7CLK") {Cmd = IOCTL_SET_N7CLKcxx . . $ `langford_ioctl.h:52:9`!;} |
| 152 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N7CS") {Cmd = IOCTL_SET_N7CScxx . . $ `langford_ioctl.h:54:9`!;} |
| 153 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "N7SDI") {Cmd = IOCTL_SET_N7SDIcxx . . $ `langford_ioctl.h:56:9`!;} |
| 154 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACIQSel") {Cmd = IOCTL_SET_DACIQSelcxx . . $ `langford_ioctl.h:58:9`!;} |
| 155 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACReset") {Cmd = IOCTL_SET_DACResetcxx . . $ `langford_ioctl.h:60:9`!;} |
| 156 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACCSB") {Cmd = IOCTL_SET_DACCSBcxx . . $ `langford_ioctl.h:62:9`!;} |
| 157 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACSDIO") {Cmd = IOCTL_SET_DACSDIOcxx . . $ `langford_ioctl.h:64:9`!;} |
| 158 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACSClk") {Cmd = IOCTL_SET_DACSClkcxx . . $ `langford_ioctl.h:66:9`!;} |
| 159 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "DACSDO") {Cmd = IOCTL_SET_DACSDOcxx . . $ `langford_ioctl.h:88:9`!;} |
| 160 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCAnOE") {Cmd = IOCTL_SET_ADCAnOEcxx . . $ `langford_ioctl.h:68:9`!;} |
| 161 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCAPD") {Cmd = IOCTL_SET_ADCAPDcxx . . $ `langford_ioctl.h:70:9`!;} |
| 162 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCASClk") {Cmd = IOCTL_SET_ADCASClkcxx . . $ `langford_ioctl.h:72:9`!;} |
| 163 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCASDIO") {Cmd = IOCTL_SET_ADCASDIOcxx . . $ `langford_ioctl.h:74:9`!;} |
| 164 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCAnCS") {Cmd = IOCTL_SET_ADCAnCScxx . . $ `langford_ioctl.h:76:9`!;} |
| 165 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBnOE") {Cmd = IOCTL_SET_ADCBnOEcxx . . $ `langford_ioctl.h:78:9`!;} |
| 166 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBPD") {Cmd = IOCTL_SET_ADCBPDcxx . . $ `langford_ioctl.h:80:9`!;} |
| 167 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBSClk") {Cmd = IOCTL_SET_ADCBSClkcxx . . $ `langford_ioctl.h:82:9`!;} |
| 168 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBSDIO") {Cmd = IOCTL_SET_ADCBSDIOcxx . . $ `langford_ioctl.h:84:9`!;} |
| 169 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ADCBnCS") {Cmd = IOCTL_SET_ADCBnCScxx . . $ `langford_ioctl.h:86:9`!;} |
| 170 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RXPhase") {Cmd = IOCTL_SET_RXPhasecxx . . $ `langford_ioctl.h:98:9`!;} |
| 171 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TXPhase") {Cmd = IOCTL_SET_TXPhasecxx . . $ `langford_ioctl.h:101:9`!;} |
| 172 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RXDecEn") {Cmd = IOCTL_SET_RXDecEncxx . . $ `langford_ioctl.h:104:9`!;} |
| 173 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TXIntEn") {Cmd = IOCTL_SET_TXIntEncxx . . $ `langford_ioctl.h:106:9`!;} |
| 174 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RXRevFreq") {Cmd = IOCTL_SET_RXRevFreqcxx . . $ `langford_ioctl.h:108:9`!;} |
| 175 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TXRevFreq") {Cmd = IOCTL_SET_TXRevFreqcxx . . $ `langford_ioctl.h:110:9`!;} |
| 176 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RxDspEn") {Cmd = IOCTL_SET_RxDspEncxx . . $ `langford_ioctl.h:112:9`!;} |
| 177 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TxDspEn") {Cmd = IOCTL_SET_TxDspEncxx . . $ `langford_ioctl.h:114:9`!;} |
| 178 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "NRXTALSEL") {Cmd = IOCTL_SET_NRXTALSELcxx . . $ `langford_ioctl.h:116:9`!;} |
| 179 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "NRVCOSEL") {Cmd = IOCTL_SET_NRVCOSELcxx . . $ `langford_ioctl.h:118:9`!;} |
| 180 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RxFifoClr") {Cmd = IOCTL_SET_RxFifoClrcxx . . $ `langford_ioctl.h:120:9`!;} |
| 181 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TxFifoClr") {Cmd = IOCTL_SET_TxFifoClrcxx . . $ `langford_ioctl.h:122:9`!;} |
| 182 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RxIsSigned"){Cmd = IOCTL_SET_RxIsSignedcxx . . $ `langford_ioctl.h:124:9`!;} |
| 183 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "TxIsSigned"){Cmd = IOCTL_SET_TxIsSignedcxx . . $ `langford_ioctl.h:126:9`!;} |
| 184 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "RxBaseband"){Cmd = IOCTL_SET_RxBasebandcxx . . $ `langford_ioctl.h:130:9`!;} |
| 185 | else if (CmdStr ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "GPIOout"){Cmd = IOCTL_SET_GPIOoutcxx . . $ `langford_ioctl.h:128:9`!;} |
| 186 | else { |
| 187 | cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Cannot write pin " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). CmdStr <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 188 | return 1; |
| 189 | }; |
| 190 | val = strtoulcxx . . $ strtoul(335a43d87d12a1b6).(argv[3], 0, 0); |
| 191 | rc |= ioctl(DevFD, Cmd, &val); |
| 192 | coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(88df5bef833f7f83). CmdStr <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " set to " <<cxx . . $ std/basic_ostream#`operator<<`(a2e659b753987ede). val <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 193 | }; |
| 194 | |
| 195 | close(DevFD); |
| 196 | |
| 197 | coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Return code from io_ctl calls: " <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). rc <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).; |
| 198 | |
| 199 | return rc; |
| 200 | }; |