FreeCalypso > hg > freecalypso-tools
diff rvinterf/tmsh/l1cmd.c @ 126:777172bcea3c
fc-tmsh: txpw and txpr implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 19 Feb 2017 09:52:58 +0000 |
parents | ca4fa5681f08 |
children | d76970e1895e |
line wrap: on
line diff
--- a/rvinterf/tmsh/l1cmd.c Sun Feb 19 09:41:40 2017 +0000 +++ b/rvinterf/tmsh/l1cmd.c Sun Feb 19 09:52:58 2017 +0000 @@ -393,3 +393,63 @@ send_etm_cmd(cmdpkt, 3); return(0); } + +static struct kwtab tx_param_arg[] = { + {"pwr-level", TX_PWR_LEVEL}, + {"apc-dac", TX_APC_DAC}, + {"ramp-template", TX_RAMP_TEMPLATE}, + {"chan-cal-table", TX_CHAN_CAL_TABLE}, + {"burst-type", TX_BURST_TYPE}, + {"burst-data", TX_BURST_DATA}, + {"timing-advance", TX_TIMING_ADVANCE}, + {"training-seq", TX_TRAINING_SEQ}, + {"pwr-skip", TX_PWR_SKIP}, + {"flags-cal", TX_FLAGS_CAL}, + {"flags-platform", TX_FLAGS_PLATFORM}, + {"flags-iq-swap", TX_FLAGS_IQ_SWAP}, + {"flags-all", TX_FLAGS_ALL}, + {"gprs-power0", TX_GPRS_POWER0}, + {"gprs-power1", TX_GPRS_POWER1}, + {"gprs-power2", TX_GPRS_POWER2}, + {"gprs-power3", TX_GPRS_POWER3}, + {"gprs-power4", TX_GPRS_POWER4}, + {"gprs-power5", TX_GPRS_POWER5}, + {"gprs-power6", TX_GPRS_POWER6}, + {"gprs-power7", TX_GPRS_POWER7}, + {"gprs-slots", TX_GPRS_SLOTS}, + {"gprs-coding", TX_GPRS_CODING}, + {0, 0} +}; + +cmd_txpw(argc, argv) + char **argv; +{ + u16 index, value; + u_char cmdpkt[7]; + + if (keyword_or_num(argv[1], tx_param_arg, &index)) + return(ERROR_USAGE); + value = strtol(argv[2], 0, 0); + cmdpkt[1] = TX_PARAM_WRITE; + cmdpkt[2] = index; + cmdpkt[3] = index >> 8; + cmdpkt[4] = value; + cmdpkt[5] = value >> 8; + send_etm_cmd(cmdpkt, 5); + return(0); +} + +cmd_txpr(argc, argv) + char **argv; +{ + u16 index; + u_char cmdpkt[5]; + + if (keyword_or_num(argv[1], tx_param_arg, &index)) + return(ERROR_USAGE); + cmdpkt[1] = TX_PARAM_READ; + cmdpkt[2] = index; + cmdpkt[3] = index >> 8; + send_etm_cmd(cmdpkt, 3); + return(0); +}