FreeCalypso > hg > freecalypso-tools
changeset 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 | db7fc16bac1e |
files | rvinterf/tmsh/l1cmd.c rvinterf/tmsh/usercmd.c |
diffstat | 2 files changed, 64 insertions(+), 0 deletions(-) [+] |
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); +}
--- a/rvinterf/tmsh/usercmd.c Sun Feb 19 09:41:40 2017 +0000 +++ b/rvinterf/tmsh/usercmd.c Sun Feb 19 09:52:58 2017 +0000 @@ -38,6 +38,8 @@ extern int cmd_tminit(); extern int cmd_tmpkt(); extern int cmd_tms(); +extern int cmd_txpr(); +extern int cmd_txpw(); extern int cmd_version(); extern int cmd_w8(); extern int cmd_w16(); @@ -84,6 +86,8 @@ {"tminit", 0, 0, cmd_tminit}, {"tmpkt", 1, 253, cmd_tmpkt}, {"tms", 1, 1, cmd_tms}, + {"txpr", 1, 1, cmd_txpr}, + {"txpw", 2, 2, cmd_txpw}, {"version", 1, 1, cmd_version}, {"w8", 2, 246, cmd_w8}, {"w16", 2, 123, cmd_w16},