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:
dudmuck
Date:
Wed Mar 04 19:33:21 2020 +0000
Revision:
8:f8918514ec50
Parent:
4:fa31fdf4ec8d
Child:
9:295e37c38fb3
sx126x: correctly control antenna switch, add sd_mode for 500KHz SF12 TX

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 2:ea9245bb1c53 4 static void cadDone(bool);
Wayne Roberts 2:ea9245bb1c53 5
Wayne Roberts 1:0817a150122b 6 static void chipModeChange(void);
Wayne Roberts 1:0817a150122b 7 static uint8_t tx_param_buf[2];
Wayne Roberts 1:0817a150122b 8 static uint8_t pa_config_buf[4];
Wayne Roberts 1:0817a150122b 9
Wayne Roberts 1:0817a150122b 10 static void rxDone(uint8_t size, float rssi, float snr);
Wayne Roberts 1:0817a150122b 11
Wayne Roberts 1:0817a150122b 12 static const menu_t gfsk_menu[];
Wayne Roberts 1:0817a150122b 13
Wayne Roberts 1:0817a150122b 14 static bool deviceSel_read(void);
Wayne Roberts 1:0817a150122b 15 static bool deviceSel_push(void);
Wayne Roberts 1:0817a150122b 16 static const toggle_item_t deviceSel_item;
Wayne Roberts 1:0817a150122b 17
Wayne Roberts 1:0817a150122b 18 static unsigned paDutyCycle_read(bool);
Wayne Roberts 1:0817a150122b 19 static menuMode_e paDutyCycle_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 20 static const dropdown_item_t paDutyCycle_item;
Wayne Roberts 1:0817a150122b 21
Wayne Roberts 1:0817a150122b 22 static unsigned hpMax_read(bool);
Wayne Roberts 1:0817a150122b 23 static menuMode_e hpMax_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 24 static const dropdown_item_t hpMax_item;
Wayne Roberts 1:0817a150122b 25
Wayne Roberts 1:0817a150122b 26 static void ocp_print(void);
Wayne Roberts 1:0817a150122b 27 static bool ocp_write(const char*);
Wayne Roberts 1:0817a150122b 28 static const value_item_t ocp_item;
Wayne Roberts 1:0817a150122b 29
Wayne Roberts 4:fa31fdf4ec8d 30 static void xta_print(void);
Wayne Roberts 4:fa31fdf4ec8d 31 static bool xta_write(const char*);
Wayne Roberts 4:fa31fdf4ec8d 32 static const value_item_t xta_item;
Wayne Roberts 4:fa31fdf4ec8d 33
Wayne Roberts 4:fa31fdf4ec8d 34 static void xtb_print(void);
Wayne Roberts 4:fa31fdf4ec8d 35 static bool xtb_write(const char*);
Wayne Roberts 4:fa31fdf4ec8d 36 static const value_item_t xtb_item;
Wayne Roberts 4:fa31fdf4ec8d 37
Wayne Roberts 1:0817a150122b 38 static unsigned lora_bw_read(bool);
Wayne Roberts 1:0817a150122b 39 static menuMode_e lora_bw_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 40 static const dropdown_item_t lora_bw_item;
Wayne Roberts 1:0817a150122b 41
Wayne Roberts 1:0817a150122b 42 static void lora_sf_print(void);
Wayne Roberts 1:0817a150122b 43 static bool lora_sf_write(const char*);
Wayne Roberts 1:0817a150122b 44 static const value_item_t lora_sf_item;
Wayne Roberts 1:0817a150122b 45
Wayne Roberts 1:0817a150122b 46 static unsigned lora_cr_read(bool);
Wayne Roberts 1:0817a150122b 47 static menuMode_e lora_cr_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 48 static const dropdown_item_t lora_cr_item;
Wayne Roberts 1:0817a150122b 49
Wayne Roberts 1:0817a150122b 50 static bool ppmOffset_read(void);
Wayne Roberts 1:0817a150122b 51 static bool ppmOffset_push(void);
Wayne Roberts 1:0817a150122b 52 static const toggle_item_t lora_ppmOffset_item;
Wayne Roberts 1:0817a150122b 53
Wayne Roberts 1:0817a150122b 54 static void lora_pblLen_print(void);
Wayne Roberts 1:0817a150122b 55 static bool lora_pblLen_write(const char*);
Wayne Roberts 1:0817a150122b 56 static const value_item_t lora_pblLen_item;
Wayne Roberts 1:0817a150122b 57
Wayne Roberts 1:0817a150122b 58 static bool lora_headerType_read(void);
Wayne Roberts 1:0817a150122b 59 static bool lora_headerType_push(void);
Wayne Roberts 1:0817a150122b 60 static const toggle_item_t lora_headerType_item;
Wayne Roberts 1:0817a150122b 61
Wayne Roberts 1:0817a150122b 62 static bool lora_crcon_read(void);
Wayne Roberts 1:0817a150122b 63 static bool lora_crcon_push(void);
Wayne Roberts 1:0817a150122b 64 static const toggle_item_t lora_crcon_item;
dudmuck 8:f8918514ec50 65
dudmuck 8:f8918514ec50 66 static bool lora_sdmode_read(void);
dudmuck 8:f8918514ec50 67 static bool lora_sdmode_push(void);
dudmuck 8:f8918514ec50 68 static const toggle_item_t lora_sdmode_item;
Wayne Roberts 1:0817a150122b 69
Wayne Roberts 1:0817a150122b 70 static bool lora_inviq_read(void);
Wayne Roberts 1:0817a150122b 71 static bool lora_inviq_push(void);
Wayne Roberts 1:0817a150122b 72 static const toggle_item_t lora_inviq_item;
Wayne Roberts 1:0817a150122b 73
Wayne Roberts 3:56fc764dee0a 74 static void lora_ppg_print(void);
Wayne Roberts 3:56fc764dee0a 75 static bool lora_ppg_write(const char*);
Wayne Roberts 3:56fc764dee0a 76 static const value_item_t lora_ppg_item;
Wayne Roberts 3:56fc764dee0a 77 static uint16_t ppg;
Wayne Roberts 3:56fc764dee0a 78
Wayne Roberts 2:ea9245bb1c53 79 static void cad_push(void);
Wayne Roberts 2:ea9245bb1c53 80 static const button_item_t lora_cad_item;
Wayne Roberts 2:ea9245bb1c53 81
Wayne Roberts 2:ea9245bb1c53 82 static uint8_t cadParams[7];
Wayne Roberts 2:ea9245bb1c53 83
Wayne Roberts 2:ea9245bb1c53 84 static unsigned lora_cadsymbs_read(bool);
Wayne Roberts 2:ea9245bb1c53 85 static menuMode_e lora_cadsymbs_write(unsigned sidx);
Wayne Roberts 2:ea9245bb1c53 86 static const dropdown_item_t lora_cadsymbs_item;
Wayne Roberts 2:ea9245bb1c53 87
Wayne Roberts 2:ea9245bb1c53 88 static void lora_cadpnratio_print(void);
Wayne Roberts 2:ea9245bb1c53 89 static bool lora_cadpnratio_write(const char*);
Wayne Roberts 2:ea9245bb1c53 90 static const value_item_t lora_cadpnratio_item;
Wayne Roberts 2:ea9245bb1c53 91
Wayne Roberts 2:ea9245bb1c53 92 static void lora_cadmin_print(void);
Wayne Roberts 2:ea9245bb1c53 93 static bool lora_cadmin_write(const char*);
Wayne Roberts 2:ea9245bb1c53 94 static const value_item_t lora_cadmin_item;
Wayne Roberts 2:ea9245bb1c53 95
Wayne Roberts 2:ea9245bb1c53 96 static bool lora_cadexit_read(void);
Wayne Roberts 2:ea9245bb1c53 97 static bool lora_cadexit_push(void);
Wayne Roberts 2:ea9245bb1c53 98 static const toggle_item_t lora_cadexit_item;
Wayne Roberts 2:ea9245bb1c53 99
Wayne Roberts 2:ea9245bb1c53 100 static void lora_cadtimeout_print(void);
Wayne Roberts 2:ea9245bb1c53 101 static bool lora_cadtimeout_write(const char*);
Wayne Roberts 2:ea9245bb1c53 102 static const value_item_t lora_cadtimeout_item;
Wayne Roberts 2:ea9245bb1c53 103
Wayne Roberts 2:ea9245bb1c53 104 /*************************************************/
Wayne Roberts 2:ea9245bb1c53 105
Wayne Roberts 1:0817a150122b 106 static void gfsk_bitrate_print(void);
Wayne Roberts 1:0817a150122b 107 static bool gfsk_bitrate_write(const char*);
Wayne Roberts 1:0817a150122b 108 static const value_item_t gfsk_bitrate_item;
Wayne Roberts 1:0817a150122b 109
Wayne Roberts 1:0817a150122b 110 static unsigned gfsk_bt_read(bool);
Wayne Roberts 1:0817a150122b 111 static menuMode_e gfsk_bt_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 112 static const dropdown_item_t gfsk_bt_item;
Wayne Roberts 1:0817a150122b 113
Wayne Roberts 1:0817a150122b 114 static unsigned gfsk_rxbw_read(bool);
Wayne Roberts 1:0817a150122b 115 static menuMode_e gfsk_rxbw_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 116 static const dropdown_item_t gfsk_rxbw_item;
Wayne Roberts 1:0817a150122b 117
Wayne Roberts 1:0817a150122b 118 static void gfsk_fdev_print(void);
Wayne Roberts 1:0817a150122b 119 static bool gfsk_fdev_write(const char*);
Wayne Roberts 1:0817a150122b 120 static const value_item_t gfsk_fdev_item;
Wayne Roberts 1:0817a150122b 121
Wayne Roberts 1:0817a150122b 122 static bool gfsk_fixLen_read(void);
Wayne Roberts 1:0817a150122b 123 static bool gfsk_fixLen_push(void);
Wayne Roberts 1:0817a150122b 124 static const toggle_item_t gfsk_fixLen_item;
Wayne Roberts 1:0817a150122b 125
Wayne Roberts 1:0817a150122b 126 static void gfsk_pblLen_print(void);
Wayne Roberts 1:0817a150122b 127 static bool gfsk_pblLen_write(const char*);
Wayne Roberts 1:0817a150122b 128 static const value_item_t gfsk_pblLen_item;
Wayne Roberts 1:0817a150122b 129
Wayne Roberts 1:0817a150122b 130 static unsigned gfsk_pblDetLen_read(bool);
Wayne Roberts 1:0817a150122b 131 static menuMode_e gfsk_pblDetLen_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 132 static const dropdown_item_t gfsk_pblDetLen_item;
Wayne Roberts 1:0817a150122b 133
Wayne Roberts 1:0817a150122b 134 static void gfsk_swl_print(void);
Wayne Roberts 1:0817a150122b 135 static bool gfsk_swl_write(const char*);
Wayne Roberts 1:0817a150122b 136 static const value_item_t gfsk_swl_item;
Wayne Roberts 1:0817a150122b 137
Wayne Roberts 1:0817a150122b 138 static void gfsk_syncword_print(void);
Wayne Roberts 1:0817a150122b 139 static bool gfsk_syncword_write(const char*);
Wayne Roberts 1:0817a150122b 140 static const value_item_t gfsk_syncword_item;
Wayne Roberts 1:0817a150122b 141
Wayne Roberts 1:0817a150122b 142 static unsigned gfsk_addrcomp_read(bool);
Wayne Roberts 1:0817a150122b 143 static menuMode_e gfsk_addrcomp_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 144 static const dropdown_item_t gfsk_addrcomp_item;
Wayne Roberts 1:0817a150122b 145
Wayne Roberts 1:0817a150122b 146 static void gfsk_nodeadrs_print(void);
Wayne Roberts 1:0817a150122b 147 static bool gfsk_nodeadrs_write(const char*);
Wayne Roberts 1:0817a150122b 148 static const value_item_t gfsk_nodeadrs_item;
Wayne Roberts 1:0817a150122b 149
Wayne Roberts 1:0817a150122b 150 static void gfsk_broadcast_print(void);
Wayne Roberts 1:0817a150122b 151 static bool gfsk_broadcast_write(const char*);
Wayne Roberts 1:0817a150122b 152 static const value_item_t gfsk_broadcast_item;
Wayne Roberts 1:0817a150122b 153
Wayne Roberts 1:0817a150122b 154 static unsigned gfsk_crctype_read(bool);
Wayne Roberts 1:0817a150122b 155 static menuMode_e gfsk_crctype_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 156 static const dropdown_item_t gfsk_crctype_item;
Wayne Roberts 1:0817a150122b 157
Wayne Roberts 1:0817a150122b 158 static bool gfsk_white_read(void);
Wayne Roberts 1:0817a150122b 159 static bool gfsk_white_push(void);
Wayne Roberts 1:0817a150122b 160 static const toggle_item_t gfsk_white_item;
Wayne Roberts 1:0817a150122b 161
Wayne Roberts 1:0817a150122b 162 static void gfsk_crcinit_print(void);
Wayne Roberts 1:0817a150122b 163 static bool gfsk_crcinit_write(const char*);
Wayne Roberts 1:0817a150122b 164 static const value_item_t gfsk_crcinit_item;
Wayne Roberts 1:0817a150122b 165
Wayne Roberts 1:0817a150122b 166 static void gfsk_crcpoly_print(void);
Wayne Roberts 1:0817a150122b 167 static bool gfsk_crcpoly_write(const char*);
Wayne Roberts 1:0817a150122b 168 static const value_item_t gfsk_crcpoly_item;
Wayne Roberts 1:0817a150122b 169
Wayne Roberts 1:0817a150122b 170 static void gfsk_whiteInit_print(void);
Wayne Roberts 1:0817a150122b 171 static bool gfsk_whiteInit_write(const char*);
Wayne Roberts 1:0817a150122b 172 static const value_item_t gfsk_whiteInit_item;
Wayne Roberts 2:ea9245bb1c53 173