Text menu driven ANSI/VT100 console test utility for LoRa transceivers

radio chip selection

Radio chip driver is not included, allowing choice of radio device.
If you're using SX1272 or SX1276, then import sx127x driver into your program.
if you're using SX1261 or SX1262, then import sx126x driver into your program.
if you're using SX1280, then import sx1280 driver into your program.
if you're using LR1110, then import LR1110 driver into your program.
If you're using NAmote72 or Murata discovery, then you must import only sx127x driver.
If you're using Type1SJ select target DISCO_L072CZ_LRWAN1 and import sx126x driver into your program.

This is VT100 text-based menu driven test program for SX12xx transceiver devices.
Serial console is divided into horizontally into top half and bottom half.
The bottom half serves as scrolling area to log activity.
The top half serves as menu, to configure the radio.
For all devices, the serial console operates at 115200 8N1, and requires terminal with ANSI-VT100 capability, such as putty/teraterm/minicom etc.
Use program only with keyboard up/down/left/right keys. Enter to change an item, or number for value item. Some items are single bit, requiring only enter key to toggle. Others with fixed choices give a drop-down menu.

Committer:
Wayne Roberts
Date:
Mon Aug 20 18:13:09 2018 -0700
Revision:
1:0817a150122b
Child:
2:ea9245bb1c53
add source files

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wayne Roberts 1:0817a150122b 1 static uint8_t pktType;
Wayne Roberts 1:0817a150122b 2 static uint8_t bw_idx;
Wayne Roberts 1:0817a150122b 3
Wayne Roberts 1:0817a150122b 4 static void chipModeChange(void);
Wayne Roberts 1:0817a150122b 5 static uint8_t tx_param_buf[2];
Wayne Roberts 1:0817a150122b 6 static uint8_t pa_config_buf[4];
Wayne Roberts 1:0817a150122b 7
Wayne Roberts 1:0817a150122b 8 static void rxDone(uint8_t size, float rssi, float snr);
Wayne Roberts 1:0817a150122b 9
Wayne Roberts 1:0817a150122b 10 static const menu_t gfsk_menu[];
Wayne Roberts 1:0817a150122b 11
Wayne Roberts 1:0817a150122b 12 static bool deviceSel_read(void);
Wayne Roberts 1:0817a150122b 13 static bool deviceSel_push(void);
Wayne Roberts 1:0817a150122b 14 static const toggle_item_t deviceSel_item;
Wayne Roberts 1:0817a150122b 15
Wayne Roberts 1:0817a150122b 16 static unsigned paDutyCycle_read(bool);
Wayne Roberts 1:0817a150122b 17 static menuMode_e paDutyCycle_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 18 static const dropdown_item_t paDutyCycle_item;
Wayne Roberts 1:0817a150122b 19
Wayne Roberts 1:0817a150122b 20 static unsigned hpMax_read(bool);
Wayne Roberts 1:0817a150122b 21 static menuMode_e hpMax_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 22 static const dropdown_item_t hpMax_item;
Wayne Roberts 1:0817a150122b 23
Wayne Roberts 1:0817a150122b 24 static void ocp_print(void);
Wayne Roberts 1:0817a150122b 25 static bool ocp_write(const char*);
Wayne Roberts 1:0817a150122b 26 static const value_item_t ocp_item;
Wayne Roberts 1:0817a150122b 27
Wayne Roberts 1:0817a150122b 28 static unsigned lora_bw_read(bool);
Wayne Roberts 1:0817a150122b 29 static menuMode_e lora_bw_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 30 static const dropdown_item_t lora_bw_item;
Wayne Roberts 1:0817a150122b 31
Wayne Roberts 1:0817a150122b 32 static void lora_sf_print(void);
Wayne Roberts 1:0817a150122b 33 static bool lora_sf_write(const char*);
Wayne Roberts 1:0817a150122b 34 static const value_item_t lora_sf_item;
Wayne Roberts 1:0817a150122b 35
Wayne Roberts 1:0817a150122b 36 static unsigned lora_cr_read(bool);
Wayne Roberts 1:0817a150122b 37 static menuMode_e lora_cr_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 38 static const dropdown_item_t lora_cr_item;
Wayne Roberts 1:0817a150122b 39
Wayne Roberts 1:0817a150122b 40 static bool ppmOffset_read(void);
Wayne Roberts 1:0817a150122b 41 static bool ppmOffset_push(void);
Wayne Roberts 1:0817a150122b 42 static const toggle_item_t lora_ppmOffset_item;
Wayne Roberts 1:0817a150122b 43
Wayne Roberts 1:0817a150122b 44 static void lora_pblLen_print(void);
Wayne Roberts 1:0817a150122b 45 static bool lora_pblLen_write(const char*);
Wayne Roberts 1:0817a150122b 46 static const value_item_t lora_pblLen_item;
Wayne Roberts 1:0817a150122b 47
Wayne Roberts 1:0817a150122b 48 static bool lora_headerType_read(void);
Wayne Roberts 1:0817a150122b 49 static bool lora_headerType_push(void);
Wayne Roberts 1:0817a150122b 50 static const toggle_item_t lora_headerType_item;
Wayne Roberts 1:0817a150122b 51
Wayne Roberts 1:0817a150122b 52 static bool lora_crcon_read(void);
Wayne Roberts 1:0817a150122b 53 static bool lora_crcon_push(void);
Wayne Roberts 1:0817a150122b 54 static const toggle_item_t lora_crcon_item;
Wayne Roberts 1:0817a150122b 55
Wayne Roberts 1:0817a150122b 56 static bool lora_inviq_read(void);
Wayne Roberts 1:0817a150122b 57 static bool lora_inviq_push(void);
Wayne Roberts 1:0817a150122b 58 static const toggle_item_t lora_inviq_item;
Wayne Roberts 1:0817a150122b 59
Wayne Roberts 1:0817a150122b 60 static void gfsk_bitrate_print(void);
Wayne Roberts 1:0817a150122b 61 static bool gfsk_bitrate_write(const char*);
Wayne Roberts 1:0817a150122b 62 static const value_item_t gfsk_bitrate_item;
Wayne Roberts 1:0817a150122b 63
Wayne Roberts 1:0817a150122b 64 static unsigned gfsk_bt_read(bool);
Wayne Roberts 1:0817a150122b 65 static menuMode_e gfsk_bt_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 66 static const dropdown_item_t gfsk_bt_item;
Wayne Roberts 1:0817a150122b 67
Wayne Roberts 1:0817a150122b 68 static unsigned gfsk_rxbw_read(bool);
Wayne Roberts 1:0817a150122b 69 static menuMode_e gfsk_rxbw_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 70 static const dropdown_item_t gfsk_rxbw_item;
Wayne Roberts 1:0817a150122b 71
Wayne Roberts 1:0817a150122b 72 static void gfsk_fdev_print(void);
Wayne Roberts 1:0817a150122b 73 static bool gfsk_fdev_write(const char*);
Wayne Roberts 1:0817a150122b 74 static const value_item_t gfsk_fdev_item;
Wayne Roberts 1:0817a150122b 75
Wayne Roberts 1:0817a150122b 76 static bool gfsk_fixLen_read(void);
Wayne Roberts 1:0817a150122b 77 static bool gfsk_fixLen_push(void);
Wayne Roberts 1:0817a150122b 78 static const toggle_item_t gfsk_fixLen_item;
Wayne Roberts 1:0817a150122b 79
Wayne Roberts 1:0817a150122b 80 static void gfsk_pblLen_print(void);
Wayne Roberts 1:0817a150122b 81 static bool gfsk_pblLen_write(const char*);
Wayne Roberts 1:0817a150122b 82 static const value_item_t gfsk_pblLen_item;
Wayne Roberts 1:0817a150122b 83
Wayne Roberts 1:0817a150122b 84 static unsigned gfsk_pblDetLen_read(bool);
Wayne Roberts 1:0817a150122b 85 static menuMode_e gfsk_pblDetLen_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 86 static const dropdown_item_t gfsk_pblDetLen_item;
Wayne Roberts 1:0817a150122b 87
Wayne Roberts 1:0817a150122b 88 static void gfsk_swl_print(void);
Wayne Roberts 1:0817a150122b 89 static bool gfsk_swl_write(const char*);
Wayne Roberts 1:0817a150122b 90 static const value_item_t gfsk_swl_item;
Wayne Roberts 1:0817a150122b 91
Wayne Roberts 1:0817a150122b 92 static void gfsk_syncword_print(void);
Wayne Roberts 1:0817a150122b 93 static bool gfsk_syncword_write(const char*);
Wayne Roberts 1:0817a150122b 94 static const value_item_t gfsk_syncword_item;
Wayne Roberts 1:0817a150122b 95
Wayne Roberts 1:0817a150122b 96 static unsigned gfsk_addrcomp_read(bool);
Wayne Roberts 1:0817a150122b 97 static menuMode_e gfsk_addrcomp_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 98 static const dropdown_item_t gfsk_addrcomp_item;
Wayne Roberts 1:0817a150122b 99
Wayne Roberts 1:0817a150122b 100 static void gfsk_nodeadrs_print(void);
Wayne Roberts 1:0817a150122b 101 static bool gfsk_nodeadrs_write(const char*);
Wayne Roberts 1:0817a150122b 102 static const value_item_t gfsk_nodeadrs_item;
Wayne Roberts 1:0817a150122b 103
Wayne Roberts 1:0817a150122b 104 static void gfsk_broadcast_print(void);
Wayne Roberts 1:0817a150122b 105 static bool gfsk_broadcast_write(const char*);
Wayne Roberts 1:0817a150122b 106 static const value_item_t gfsk_broadcast_item;
Wayne Roberts 1:0817a150122b 107
Wayne Roberts 1:0817a150122b 108 static unsigned gfsk_crctype_read(bool);
Wayne Roberts 1:0817a150122b 109 static menuMode_e gfsk_crctype_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 110 static const dropdown_item_t gfsk_crctype_item;
Wayne Roberts 1:0817a150122b 111
Wayne Roberts 1:0817a150122b 112 static bool gfsk_white_read(void);
Wayne Roberts 1:0817a150122b 113 static bool gfsk_white_push(void);
Wayne Roberts 1:0817a150122b 114 static const toggle_item_t gfsk_white_item;
Wayne Roberts 1:0817a150122b 115
Wayne Roberts 1:0817a150122b 116 static void gfsk_crcinit_print(void);
Wayne Roberts 1:0817a150122b 117 static bool gfsk_crcinit_write(const char*);
Wayne Roberts 1:0817a150122b 118 static const value_item_t gfsk_crcinit_item;
Wayne Roberts 1:0817a150122b 119
Wayne Roberts 1:0817a150122b 120 static void gfsk_crcpoly_print(void);
Wayne Roberts 1:0817a150122b 121 static bool gfsk_crcpoly_write(const char*);
Wayne Roberts 1:0817a150122b 122 static const value_item_t gfsk_crcpoly_item;
Wayne Roberts 1:0817a150122b 123
Wayne Roberts 1:0817a150122b 124 static void gfsk_whiteInit_print(void);
Wayne Roberts 1:0817a150122b 125 static bool gfsk_whiteInit_write(const char*);
Wayne Roberts 1:0817a150122b 126 static const value_item_t gfsk_whiteInit_item;