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:
Wed Aug 22 09:50:32 2018 -0700
Revision:
2:ea9245bb1c53
Parent:
1:0817a150122b
Child:
3:56fc764dee0a
add LoRa CAD function

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 1:0817a150122b 30 static unsigned lora_bw_read(bool);
Wayne Roberts 1:0817a150122b 31 static menuMode_e lora_bw_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 32 static const dropdown_item_t lora_bw_item;
Wayne Roberts 1:0817a150122b 33
Wayne Roberts 1:0817a150122b 34 static void lora_sf_print(void);
Wayne Roberts 1:0817a150122b 35 static bool lora_sf_write(const char*);
Wayne Roberts 1:0817a150122b 36 static const value_item_t lora_sf_item;
Wayne Roberts 1:0817a150122b 37
Wayne Roberts 1:0817a150122b 38 static unsigned lora_cr_read(bool);
Wayne Roberts 1:0817a150122b 39 static menuMode_e lora_cr_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 40 static const dropdown_item_t lora_cr_item;
Wayne Roberts 1:0817a150122b 41
Wayne Roberts 1:0817a150122b 42 static bool ppmOffset_read(void);
Wayne Roberts 1:0817a150122b 43 static bool ppmOffset_push(void);
Wayne Roberts 1:0817a150122b 44 static const toggle_item_t lora_ppmOffset_item;
Wayne Roberts 1:0817a150122b 45
Wayne Roberts 1:0817a150122b 46 static void lora_pblLen_print(void);
Wayne Roberts 1:0817a150122b 47 static bool lora_pblLen_write(const char*);
Wayne Roberts 1:0817a150122b 48 static const value_item_t lora_pblLen_item;
Wayne Roberts 1:0817a150122b 49
Wayne Roberts 1:0817a150122b 50 static bool lora_headerType_read(void);
Wayne Roberts 1:0817a150122b 51 static bool lora_headerType_push(void);
Wayne Roberts 1:0817a150122b 52 static const toggle_item_t lora_headerType_item;
Wayne Roberts 1:0817a150122b 53
Wayne Roberts 1:0817a150122b 54 static bool lora_crcon_read(void);
Wayne Roberts 1:0817a150122b 55 static bool lora_crcon_push(void);
Wayne Roberts 1:0817a150122b 56 static const toggle_item_t lora_crcon_item;
Wayne Roberts 1:0817a150122b 57
Wayne Roberts 1:0817a150122b 58 static bool lora_inviq_read(void);
Wayne Roberts 1:0817a150122b 59 static bool lora_inviq_push(void);
Wayne Roberts 1:0817a150122b 60 static const toggle_item_t lora_inviq_item;
Wayne Roberts 1:0817a150122b 61
Wayne Roberts 2:ea9245bb1c53 62 static void cad_push(void);
Wayne Roberts 2:ea9245bb1c53 63 static const button_item_t lora_cad_item;
Wayne Roberts 2:ea9245bb1c53 64
Wayne Roberts 2:ea9245bb1c53 65 static uint8_t cadParams[7];
Wayne Roberts 2:ea9245bb1c53 66
Wayne Roberts 2:ea9245bb1c53 67 static unsigned lora_cadsymbs_read(bool);
Wayne Roberts 2:ea9245bb1c53 68 static menuMode_e lora_cadsymbs_write(unsigned sidx);
Wayne Roberts 2:ea9245bb1c53 69 static const dropdown_item_t lora_cadsymbs_item;
Wayne Roberts 2:ea9245bb1c53 70
Wayne Roberts 2:ea9245bb1c53 71 static void lora_cadpnratio_print(void);
Wayne Roberts 2:ea9245bb1c53 72 static bool lora_cadpnratio_write(const char*);
Wayne Roberts 2:ea9245bb1c53 73 static const value_item_t lora_cadpnratio_item;
Wayne Roberts 2:ea9245bb1c53 74
Wayne Roberts 2:ea9245bb1c53 75 static void lora_cadmin_print(void);
Wayne Roberts 2:ea9245bb1c53 76 static bool lora_cadmin_write(const char*);
Wayne Roberts 2:ea9245bb1c53 77 static const value_item_t lora_cadmin_item;
Wayne Roberts 2:ea9245bb1c53 78
Wayne Roberts 2:ea9245bb1c53 79 static bool lora_cadexit_read(void);
Wayne Roberts 2:ea9245bb1c53 80 static bool lora_cadexit_push(void);
Wayne Roberts 2:ea9245bb1c53 81 static const toggle_item_t lora_cadexit_item;
Wayne Roberts 2:ea9245bb1c53 82
Wayne Roberts 2:ea9245bb1c53 83 static void lora_cadtimeout_print(void);
Wayne Roberts 2:ea9245bb1c53 84 static bool lora_cadtimeout_write(const char*);
Wayne Roberts 2:ea9245bb1c53 85 static const value_item_t lora_cadtimeout_item;
Wayne Roberts 2:ea9245bb1c53 86
Wayne Roberts 2:ea9245bb1c53 87 /*************************************************/
Wayne Roberts 2:ea9245bb1c53 88
Wayne Roberts 1:0817a150122b 89 static void gfsk_bitrate_print(void);
Wayne Roberts 1:0817a150122b 90 static bool gfsk_bitrate_write(const char*);
Wayne Roberts 1:0817a150122b 91 static const value_item_t gfsk_bitrate_item;
Wayne Roberts 1:0817a150122b 92
Wayne Roberts 1:0817a150122b 93 static unsigned gfsk_bt_read(bool);
Wayne Roberts 1:0817a150122b 94 static menuMode_e gfsk_bt_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 95 static const dropdown_item_t gfsk_bt_item;
Wayne Roberts 1:0817a150122b 96
Wayne Roberts 1:0817a150122b 97 static unsigned gfsk_rxbw_read(bool);
Wayne Roberts 1:0817a150122b 98 static menuMode_e gfsk_rxbw_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 99 static const dropdown_item_t gfsk_rxbw_item;
Wayne Roberts 1:0817a150122b 100
Wayne Roberts 1:0817a150122b 101 static void gfsk_fdev_print(void);
Wayne Roberts 1:0817a150122b 102 static bool gfsk_fdev_write(const char*);
Wayne Roberts 1:0817a150122b 103 static const value_item_t gfsk_fdev_item;
Wayne Roberts 1:0817a150122b 104
Wayne Roberts 1:0817a150122b 105 static bool gfsk_fixLen_read(void);
Wayne Roberts 1:0817a150122b 106 static bool gfsk_fixLen_push(void);
Wayne Roberts 1:0817a150122b 107 static const toggle_item_t gfsk_fixLen_item;
Wayne Roberts 1:0817a150122b 108
Wayne Roberts 1:0817a150122b 109 static void gfsk_pblLen_print(void);
Wayne Roberts 1:0817a150122b 110 static bool gfsk_pblLen_write(const char*);
Wayne Roberts 1:0817a150122b 111 static const value_item_t gfsk_pblLen_item;
Wayne Roberts 1:0817a150122b 112
Wayne Roberts 1:0817a150122b 113 static unsigned gfsk_pblDetLen_read(bool);
Wayne Roberts 1:0817a150122b 114 static menuMode_e gfsk_pblDetLen_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 115 static const dropdown_item_t gfsk_pblDetLen_item;
Wayne Roberts 1:0817a150122b 116
Wayne Roberts 1:0817a150122b 117 static void gfsk_swl_print(void);
Wayne Roberts 1:0817a150122b 118 static bool gfsk_swl_write(const char*);
Wayne Roberts 1:0817a150122b 119 static const value_item_t gfsk_swl_item;
Wayne Roberts 1:0817a150122b 120
Wayne Roberts 1:0817a150122b 121 static void gfsk_syncword_print(void);
Wayne Roberts 1:0817a150122b 122 static bool gfsk_syncword_write(const char*);
Wayne Roberts 1:0817a150122b 123 static const value_item_t gfsk_syncword_item;
Wayne Roberts 1:0817a150122b 124
Wayne Roberts 1:0817a150122b 125 static unsigned gfsk_addrcomp_read(bool);
Wayne Roberts 1:0817a150122b 126 static menuMode_e gfsk_addrcomp_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 127 static const dropdown_item_t gfsk_addrcomp_item;
Wayne Roberts 1:0817a150122b 128
Wayne Roberts 1:0817a150122b 129 static void gfsk_nodeadrs_print(void);
Wayne Roberts 1:0817a150122b 130 static bool gfsk_nodeadrs_write(const char*);
Wayne Roberts 1:0817a150122b 131 static const value_item_t gfsk_nodeadrs_item;
Wayne Roberts 1:0817a150122b 132
Wayne Roberts 1:0817a150122b 133 static void gfsk_broadcast_print(void);
Wayne Roberts 1:0817a150122b 134 static bool gfsk_broadcast_write(const char*);
Wayne Roberts 1:0817a150122b 135 static const value_item_t gfsk_broadcast_item;
Wayne Roberts 1:0817a150122b 136
Wayne Roberts 1:0817a150122b 137 static unsigned gfsk_crctype_read(bool);
Wayne Roberts 1:0817a150122b 138 static menuMode_e gfsk_crctype_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 139 static const dropdown_item_t gfsk_crctype_item;
Wayne Roberts 1:0817a150122b 140
Wayne Roberts 1:0817a150122b 141 static bool gfsk_white_read(void);
Wayne Roberts 1:0817a150122b 142 static bool gfsk_white_push(void);
Wayne Roberts 1:0817a150122b 143 static const toggle_item_t gfsk_white_item;
Wayne Roberts 1:0817a150122b 144
Wayne Roberts 1:0817a150122b 145 static void gfsk_crcinit_print(void);
Wayne Roberts 1:0817a150122b 146 static bool gfsk_crcinit_write(const char*);
Wayne Roberts 1:0817a150122b 147 static const value_item_t gfsk_crcinit_item;
Wayne Roberts 1:0817a150122b 148
Wayne Roberts 1:0817a150122b 149 static void gfsk_crcpoly_print(void);
Wayne Roberts 1:0817a150122b 150 static bool gfsk_crcpoly_write(const char*);
Wayne Roberts 1:0817a150122b 151 static const value_item_t gfsk_crcpoly_item;
Wayne Roberts 1:0817a150122b 152
Wayne Roberts 1:0817a150122b 153 static void gfsk_whiteInit_print(void);
Wayne Roberts 1:0817a150122b 154 static bool gfsk_whiteInit_write(const char*);
Wayne Roberts 1:0817a150122b 155 static const value_item_t gfsk_whiteInit_item;
Wayne Roberts 2:ea9245bb1c53 156