summaryrefslogtreecommitdiff
path: root/software/hhd70dongle/hhd70dongle.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/hhd70dongle/hhd70dongle.c')
-rw-r--r--software/hhd70dongle/hhd70dongle.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/software/hhd70dongle/hhd70dongle.c b/software/hhd70dongle/hhd70dongle.c
index ce4e963..d1fb2db 100644
--- a/software/hhd70dongle/hhd70dongle.c
+++ b/software/hhd70dongle/hhd70dongle.c
@@ -110,6 +110,61 @@ static void print_status(void)
printf("%d.%01d dB\r\n", (uint16_t)(rssi / 2), (uint16_t)((rssi % 2)*5));
}
+static void dump_register_normalized(void)
+{
+ printf("IOCFG0: 0x%02X\r\n", cc1101_get_iocfg0());
+ printf("IOCFG1: 0x%02X\r\n", cc1101_get_iocfg1());
+ printf("IOCFG2: 0x%02X\r\n", cc1101_get_iocfg2());
+
+ printf("FIFOTHR: 0x%02X\r\n", cc1101_get_fifothr());
+
+ printf("SYNC: 0x%04X\r\n", cc1101_get_sync());
+ printf("PKTLEN: 0x%02X\r\n", cc1101_get_pktlen());
+ printf("PKTCTRL: 0x%04X\r\n", cc1101_get_pktctrl());
+ printf("ADDR: 0x%02X\r\n", cc1101_get_addr());
+
+ printf("CHANNR: 0x%02X\r\n", cc1101_get_channr());
+ printf("IFFREQ: 0x%02X\r\n", cc1101_get_iffreq());
+ printf("FREQ_OFFSET: 0x%02X\r\n", cc1101_get_freq_offset());
+ printf("FREQ: 0x%08lX\r\n", cc1101_get_freq());
+ printf("MODEMCFG: 0x%08lX\r\n", cc1101_get_modemcfg());
+ printf("DRATE_BW: 0x%04X\r\n", cc1101_get_drate_bw());
+ printf("DEVIATN: 0x%02X\r\n", cc1101_get_deviatn());
+
+ printf("MCSM: 0x%08lX\r\n", cc1101_get_mcsm());
+
+ printf("FOCCFG: 0x%02X\r\n", cc1101_get_foccfg());
+ printf("BSCFG: 0x%02X\r\n", cc1101_get_bscfg());
+ printf("AGCCTRL: 0x%08lX\r\n", cc1101_get_agcctrl());
+ printf("WOREVT: 0x%04X\r\n", cc1101_get_worevt());
+ printf("WORCTRL: 0x%02X\r\n", cc1101_get_worctrl());
+
+ printf("FREND: 0x%04X\r\n", cc1101_get_frend());
+ printf("FSCAL: 0x%08lX\r\n", cc1101_get_fscal());
+ printf("RCCTRL: 0x%04X\r\n", cc1101_get_rcctrl());
+
+ printf("FSTEST: 0x%02X\r\n", cc1101_get_fstest());
+ printf("PTEST: 0x%02X\r\n", cc1101_get_ptest());
+ printf("AGCTEST: 0x%02X\r\n", cc1101_get_agctest());
+ printf("TEST0: 0x%02X\r\n", cc1101_get_test0());
+ printf("TEST1: 0x%02X\r\n", cc1101_get_test1());
+ printf("TEST2: 0x%02X\r\n", cc1101_get_test2());
+
+ printf("PARTNUM: 0x%02X\r\n", cc1101_get_partnum());
+ printf("CHIP_VERSION: 0x%02X\r\n", cc1101_get_chip_version());
+ printf("FREQ_OFFSET_EST: 0x%02X\r\n", cc1101_get_freq_offset_est());
+ printf("LQI: 0x%02X\r\n", cc1101_get_lqi());
+ printf("RSSI: 0x%02X\r\n", cc1101_get_rssi());
+ printf("MARCSTATE: 0x%02X\r\n", cc1101_get_marcstate());
+ printf("WORTIME: 0x%04X\r\n", cc1101_get_wortime());
+ printf("PKT_STATUS: 0x%02X\r\n", cc1101_get_pkt_status());
+ printf("VCO_VC_DAC: 0x%02X\r\n", cc1101_get_vco_vc_dac());
+ printf("TX_BYTES: 0x%02X\r\n", cc1101_get_tx_bytes());
+ printf("RX_BYTES: 0x%02X\r\n", cc1101_get_rx_bytes());
+ printf("RCCTRL0: 0x%02X\r\n", cc1101_get_rcctrl0_status());
+ printf("RCCTRL1: 0x%02X\r\n", cc1101_get_rcctrl1_status());
+}
+
static void handle_cmd(uint8_t cmd)
{
switch(cmd) {
@@ -140,6 +195,7 @@ static void handle_cmd(uint8_t cmd)
case 'f': print_actual_freq(); break;
case 's': print_status(); break;
case 'D': cc1101_dump_register(); break;
+ case 'd': dump_register_normalized(); break;
default: printf("unknown command\r\n"); return;
}