FreeCalypso > hg > freecalypso-tools
changeset 130:d3e2b619ff89
fc-tmsh: mpw and mpr implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 19 Feb 2017 17:04:14 +0000 |
parents | bf610ca0f1b1 |
children | cae9cb333c2c |
files | rvinterf/tmsh/l1cmd.c rvinterf/tmsh/usercmd.c |
diffstat | 2 files changed, 81 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/rvinterf/tmsh/l1cmd.c Sun Feb 19 16:10:25 2017 +0000 +++ b/rvinterf/tmsh/l1cmd.c Sun Feb 19 17:04:14 2017 +0000 @@ -491,3 +491,80 @@ send_etm_cmd(cmdpkt, 2); return(0); } + +static struct kwtab misc_param_arg[] = { + {"adc-interval", ADC_INTERVAL}, + {"adc-enable", ADC_ENA_FLAG}, + {"converted-adc0", CONVERTED_ADC0}, + {"converted-adc1", CONVERTED_ADC1}, + {"converted-adc2", CONVERTED_ADC2}, + {"converted-adc3", CONVERTED_ADC3}, + {"converted-adc4", CONVERTED_ADC4}, + {"converted-adc5", CONVERTED_ADC5}, + {"converted-adc6", CONVERTED_ADC6}, + {"converted-adc7", CONVERTED_ADC7}, + {"converted-adc8", CONVERTED_ADC8}, + {"raw-adc0", RAW_ADC0}, + {"raw-adc1", RAW_ADC1}, + {"raw-adc2", RAW_ADC2}, + {"raw-adc3", RAW_ADC3}, + {"raw-adc4", RAW_ADC4}, + {"raw-adc5", RAW_ADC5}, + {"raw-adc6", RAW_ADC6}, + {"raw-adc7", RAW_ADC7}, + {"raw-adc8", RAW_ADC8}, + {"adc0-coeff-a", ADC0_COEFF_A}, + {"adc1-coeff-a", ADC1_COEFF_A}, + {"adc2-coeff-a", ADC2_COEFF_A}, + {"adc3-coeff-a", ADC3_COEFF_A}, + {"adc4-coeff-a", ADC4_COEFF_A}, + {"adc5-coeff-a", ADC5_COEFF_A}, + {"adc6-coeff-a", ADC6_COEFF_A}, + {"adc7-coeff-a", ADC7_COEFF_A}, + {"adc8-coeff-a", ADC8_COEFF_A}, + {"adc0-coeff-b", ADC0_COEFF_B}, + {"adc1-coeff-b", ADC1_COEFF_B}, + {"adc2-coeff-b", ADC2_COEFF_B}, + {"adc3-coeff-b", ADC3_COEFF_B}, + {"adc4-coeff-b", ADC4_COEFF_B}, + {"adc5-coeff-b", ADC5_COEFF_B}, + {"adc6-coeff-b", ADC6_COEFF_B}, + {"adc7-coeff-b", ADC7_COEFF_B}, + {"adc8-coeff-b", ADC8_COEFF_B}, + {"sleep-mode", SLEEP_MODE}, + {"current-tm-mode", CURRENT_TM_MODE}, + {0, 0} +}; + +cmd_mpw(argc, argv) + char **argv; +{ + u16 index, value; + u_char cmdpkt[7]; + + if (keyword_or_num(argv[1], misc_param_arg, &index)) + return(ERROR_USAGE); + value = strtol(argv[2], 0, 0); + cmdpkt[1] = MISC_PARAM_WRITE; + cmdpkt[2] = index; + cmdpkt[3] = index >> 8; + cmdpkt[4] = value; + cmdpkt[5] = value >> 8; + send_etm_cmd(cmdpkt, 5); + return(0); +} + +cmd_mpr(argc, argv) + char **argv; +{ + u16 index; + u_char cmdpkt[5]; + + if (keyword_or_num(argv[1], misc_param_arg, &index)) + return(ERROR_USAGE); + cmdpkt[1] = MISC_PARAM_READ; + cmdpkt[2] = index; + cmdpkt[3] = index >> 8; + send_etm_cmd(cmdpkt, 3); + return(0); +}
--- a/rvinterf/tmsh/usercmd.c Sun Feb 19 16:10:25 2017 +0000 +++ b/rvinterf/tmsh/usercmd.c Sun Feb 19 17:04:14 2017 +0000 @@ -18,6 +18,8 @@ extern int cmd_check_ffs1(); extern int cmd_dieid(); extern int cmd_ffs2(); +extern int cmd_mpr(); +extern int cmd_mpw(); extern int cmd_omr(); extern int cmd_ping(); extern int cmd_r8(); @@ -67,6 +69,8 @@ {"etmpkt", 1, 253, cmd_tmpkt}, {"exit", 0, 0, cmd_exit}, {"ffs2", 1, 3, cmd_ffs2}, + {"mpr", 1, 1, cmd_mpr}, + {"mpw", 2, 2, cmd_mpw}, {"omr", 2, 2, cmd_omr}, {"ping", 0, 2, cmd_ping}, {"quit", 0, 0, cmd_exit},