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
Wayne Roberts 1:0817a150122b 3 static void chipModeChange(void);
Wayne Roberts 2:ea9245bb1c53 4 static void cadDone(bool);
Wayne Roberts 1:0817a150122b 5
Wayne Roberts 1:0817a150122b 6 static const menu_t gfsk_menu[];
Wayne Roberts 1:0817a150122b 7 static const menu_t flrc_menu[];
Wayne Roberts 1:0817a150122b 8
Wayne Roberts 1:0817a150122b 9 static void rxDone(uint8_t size, const pktStatus_t*);
Wayne Roberts 1:0817a150122b 10
Wayne Roberts 1:0817a150122b 11 static unsigned lora_bw_read(bool);
Wayne Roberts 1:0817a150122b 12 static menuMode_e lora_bw_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 13 static const dropdown_item_t lora_bw_item;
Wayne Roberts 1:0817a150122b 14
Wayne Roberts 2:ea9245bb1c53 15 static unsigned lora_cr_read(bool);
Wayne Roberts 2:ea9245bb1c53 16 static menuMode_e lora_cr_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 17 static const dropdown_item_t lora_cr_item;
Wayne Roberts 1:0817a150122b 18
Wayne Roberts 1:0817a150122b 19 static void lora_sf_print(void);
Wayne Roberts 1:0817a150122b 20 static bool lora_sf_write(const char*);
Wayne Roberts 1:0817a150122b 21 static const value_item_t lora_sf_item;
Wayne Roberts 1:0817a150122b 22
Wayne Roberts 2:ea9245bb1c53 23 static void cad_push(void);
Wayne Roberts 2:ea9245bb1c53 24 static const button_item_t lora_cad_item;
Wayne Roberts 2:ea9245bb1c53 25
Wayne Roberts 2:ea9245bb1c53 26 static unsigned lora_cadsymbs_read(bool);
Wayne Roberts 2:ea9245bb1c53 27 static menuMode_e lora_cadsymbs_write(unsigned sidx);
Wayne Roberts 2:ea9245bb1c53 28 static const dropdown_item_t lora_cadsymbs_item;
Wayne Roberts 2:ea9245bb1c53 29
Wayne Roberts 2:ea9245bb1c53 30 /*************************************************/
Wayne Roberts 2:ea9245bb1c53 31
Wayne Roberts 2:ea9245bb1c53 32 static void modindex_print(void);
Wayne Roberts 2:ea9245bb1c53 33 static bool modindex_write(const char*);
Wayne Roberts 2:ea9245bb1c53 34 static const value_item_t gfsk_modindex_item;
Wayne Roberts 2:ea9245bb1c53 35
Wayne Roberts 2:ea9245bb1c53 36 static unsigned gfsk_flrc_bt_read(bool);
Wayne Roberts 2:ea9245bb1c53 37 static menuMode_e gfsk_flrc_bt_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 38 static const dropdown_item_t gfsk_flrc_bt_item;
Wayne Roberts 1:0817a150122b 39
Wayne Roberts 2:ea9245bb1c53 40 static unsigned gfsk_flrc_pl_read(bool);
Wayne Roberts 2:ea9245bb1c53 41 static menuMode_e gfsk_flrc_pl_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 42 static const dropdown_item_t gfsk_flrc_preamble_item;
Wayne Roberts 1:0817a150122b 43
Wayne Roberts 2:ea9245bb1c53 44 static unsigned gfsk_flrc_bpsbw_read(bool);
Wayne Roberts 2:ea9245bb1c53 45 static menuMode_e gfsk_flrc_bpsbw_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 46 static const dropdown_item_t flrc_bitrate_item;
Wayne Roberts 1:0817a150122b 47 static const dropdown_item_t gfsk_bitrate_item;
Wayne Roberts 1:0817a150122b 48
Wayne Roberts 2:ea9245bb1c53 49 static unsigned gfsk_synclen_read(bool);
Wayne Roberts 2:ea9245bb1c53 50 static menuMode_e gfsk_synclen_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 51 static const dropdown_item_t gfsk_synclen_item;
Wayne Roberts 1:0817a150122b 52
Wayne Roberts 1:0817a150122b 53 static bool gfsk_flrc_fixvar_read(void);
Wayne Roberts 1:0817a150122b 54 static bool gfsk_flrc_fixvar_push(void);
Wayne Roberts 1:0817a150122b 55 static const toggle_item_t gfsk_flrc_fixvar_item;
Wayne Roberts 1:0817a150122b 56
Wayne Roberts 2:ea9245bb1c53 57 static unsigned gfsk_flrc_crclen_read(bool);
Wayne Roberts 2:ea9245bb1c53 58 static menuMode_e gfsk_flrc_crclen_write (unsigned sidx);
Wayne Roberts 1:0817a150122b 59 static const dropdown_item_t gfsk_flrc_crclen_item;
Wayne Roberts 1:0817a150122b 60
Wayne Roberts 1:0817a150122b 61 static bool gfsk_flrc_whit_read(void);
Wayne Roberts 1:0817a150122b 62 static bool gfsk_flrc_whit_push(void);
Wayne Roberts 1:0817a150122b 63 static const toggle_item_t gfsk_flrc_whit_item;
Wayne Roberts 1:0817a150122b 64
Wayne Roberts 1:0817a150122b 65 static void gfsk_flrc_crcinit_print(void);
Wayne Roberts 1:0817a150122b 66 static bool gfsk_flrc_crcinit_write (const char*);
Wayne Roberts 1:0817a150122b 67 static const value_item_t gfsk_flrc_crcinit_item;
Wayne Roberts 1:0817a150122b 68
Wayne Roberts 1:0817a150122b 69 static void gfsk_flrc_crcpoly_print(void);
Wayne Roberts 1:0817a150122b 70 static bool gfsk_flrc_crcpoly_write(const char*);
Wayne Roberts 1:0817a150122b 71 static const value_item_t gfsk_flrc_crcpoly_item;
Wayne Roberts 1:0817a150122b 72
Wayne Roberts 1:0817a150122b 73 static bool gfsk_flrc_sync1en_read(void);
Wayne Roberts 1:0817a150122b 74 static bool gfsk_flrc_sync2en_read(void);
Wayne Roberts 1:0817a150122b 75 static bool gfsk_flrc_sync3en_read(void);
Wayne Roberts 1:0817a150122b 76 static bool gfsk_flrc_sync1en_push(void);
Wayne Roberts 1:0817a150122b 77 static bool gfsk_flrc_sync2en_push(void);
Wayne Roberts 1:0817a150122b 78 static bool gfsk_flrc_sync3en_push(void);
Wayne Roberts 1:0817a150122b 79 static const toggle_item_t gfsk_flrc_sync1en_item;
Wayne Roberts 1:0817a150122b 80 static const toggle_item_t gfsk_flrc_sync2en_item;
Wayne Roberts 1:0817a150122b 81 static const toggle_item_t gfsk_flrc_sync3en_item;
Wayne Roberts 1:0817a150122b 82
Wayne Roberts 1:0817a150122b 83 static void gfsk_flrc_sync1_print(void);
Wayne Roberts 1:0817a150122b 84 static void gfsk_flrc_sync2_print(void);
Wayne Roberts 1:0817a150122b 85 static void gfsk_flrc_sync3_print(void);
Wayne Roberts 1:0817a150122b 86 static bool gfsk_flrc_sync1_write(const char*);
Wayne Roberts 1:0817a150122b 87 static bool gfsk_flrc_sync2_write(const char*);
Wayne Roberts 1:0817a150122b 88 static bool gfsk_flrc_sync3_write(const char*);
Wayne Roberts 1:0817a150122b 89 static const value_item_t gfsk_flrc_sync1_item;
Wayne Roberts 1:0817a150122b 90 static const value_item_t gfsk_flrc_sync2_item;
Wayne Roberts 1:0817a150122b 91 static const value_item_t gfsk_flrc_sync3_item;
Wayne Roberts 1:0817a150122b 92
Wayne Roberts 1:0817a150122b 93 static void lora_pblLen_print(void);
Wayne Roberts 1:0817a150122b 94 static bool lora_pblLen_write(const char*);
Wayne Roberts 1:0817a150122b 95 static const value_item_t lora_pblLen_item;
Wayne Roberts 1:0817a150122b 96
Wayne Roberts 1:0817a150122b 97 static bool lora_fixlen_read(void);
Wayne Roberts 1:0817a150122b 98 static bool lora_fixlen_push(void);
Wayne Roberts 1:0817a150122b 99 static const toggle_item_t lora_fixlen_item;
Wayne Roberts 1:0817a150122b 100
Wayne Roberts 1:0817a150122b 101 static bool lora_crcon_read(void);
Wayne Roberts 1:0817a150122b 102 static bool lora_crcon_push(void);
Wayne Roberts 1:0817a150122b 103 static const toggle_item_t lora_crcon_item;
Wayne Roberts 1:0817a150122b 104
Wayne Roberts 1:0817a150122b 105 static bool lora_iqinv_read(void);
Wayne Roberts 1:0817a150122b 106 static bool lora_iqinv_push(void);
Wayne Roberts 1:0817a150122b 107 static const toggle_item_t lora_iqinv_item;
Wayne Roberts 1:0817a150122b 108
Wayne Roberts 2:ea9245bb1c53 109 static unsigned flrc_cr_read(bool);
Wayne Roberts 2:ea9245bb1c53 110 static menuMode_e flrc_cr_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 111 static const dropdown_item_t flrc_cr_item;
Wayne Roberts 1:0817a150122b 112
Wayne Roberts 2:ea9245bb1c53 113 static unsigned flrc_synclen_read(bool);
Wayne Roberts 2:ea9245bb1c53 114 static menuMode_e flrc_synclen_write(unsigned sidx);
Wayne Roberts 1:0817a150122b 115 static const dropdown_item_t flrc_synclen_item;