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.

radio_sx128x_private.h

Committer:
Wayne Roberts
Date:
2018-08-20
Revision:
1:0817a150122b
Child:
2:ea9245bb1c53

File content as of revision 1:0817a150122b:

        static uint8_t pktType;

        static void chipModeChange(void);

        static const menu_t gfsk_menu[];
        static const menu_t flrc_menu[];

        static void rxDone(uint8_t size, const pktStatus_t*);

        static unsigned lora_bw_read(bool);
        static menuMode_e lora_bw_write(unsigned sidx);
        static const dropdown_item_t lora_bw_item;

        static unsigned lora_cr_read_cb(bool);
        static menuMode_e lora_cr_write_cb(unsigned sidx);
        static const dropdown_item_t lora_cr_item;

        static void modindex_print(void);
        static bool modindex_write(const char*);
        static const value_item_t gfsk_modindex_item;

        static void lora_sf_print(void);
        static bool lora_sf_write(const char*);
        static const value_item_t lora_sf_item;

        static unsigned gfsk_flrc_bt_read_cb(bool);
        static menuMode_e gfsk_flrc_bt_write_cb(unsigned sidx);
        static const dropdown_item_t gfsk_flrc_bt_item;

        static unsigned gfsk_flrc_pl_read_cb(bool);
        static menuMode_e gfsk_flrc_pl_write_cb(unsigned sidx);
        static const dropdown_item_t gfsk_flrc_preamble_item;

        static unsigned gfsk_flrc_bpsbw_read_cb(bool);
        static menuMode_e gfsk_flrc_bpsbw_write_cb(unsigned sidx);
        static const dropdown_item_t flrc_bitrate_item;
        static const dropdown_item_t gfsk_bitrate_item;

        static unsigned gfsk_synclen_read_cb(bool);
        static menuMode_e gfsk_synclen_write_cb(unsigned sidx);
        static const dropdown_item_t gfsk_synclen_item;

        static bool gfsk_flrc_fixvar_read(void);
        static bool gfsk_flrc_fixvar_push(void);
        static const toggle_item_t gfsk_flrc_fixvar_item;

        static unsigned gfsk_flrc_crclen_read_cb(bool);
        static menuMode_e gfsk_flrc_crclen_write_cb (unsigned sidx);
        static const dropdown_item_t gfsk_flrc_crclen_item;

        static bool gfsk_flrc_whit_read(void);
        static bool gfsk_flrc_whit_push(void);
        static const toggle_item_t gfsk_flrc_whit_item;

        static void gfsk_flrc_crcinit_print(void);
        static bool gfsk_flrc_crcinit_write (const char*);
        static const value_item_t gfsk_flrc_crcinit_item;

        static void gfsk_flrc_crcpoly_print(void);
        static bool gfsk_flrc_crcpoly_write(const char*);
        static const value_item_t gfsk_flrc_crcpoly_item;

        static bool gfsk_flrc_sync1en_read(void);
        static bool gfsk_flrc_sync2en_read(void);
        static bool gfsk_flrc_sync3en_read(void);
        static bool gfsk_flrc_sync1en_push(void);
        static bool gfsk_flrc_sync2en_push(void);
        static bool gfsk_flrc_sync3en_push(void);
        static const toggle_item_t gfsk_flrc_sync1en_item;
        static const toggle_item_t gfsk_flrc_sync2en_item;
        static const toggle_item_t gfsk_flrc_sync3en_item;

        static void gfsk_flrc_sync1_print(void);
        static void gfsk_flrc_sync2_print(void);
        static void gfsk_flrc_sync3_print(void);
        static bool gfsk_flrc_sync1_write(const char*);
        static bool gfsk_flrc_sync2_write(const char*);
        static bool gfsk_flrc_sync3_write(const char*);
        static const value_item_t gfsk_flrc_sync1_item;
        static const value_item_t gfsk_flrc_sync2_item;
        static const value_item_t gfsk_flrc_sync3_item;

        static void lora_pblLen_print(void);
        static bool lora_pblLen_write(const char*);
        static const value_item_t lora_pblLen_item;

        static bool lora_fixlen_read(void);
        static bool lora_fixlen_push(void);
        static const toggle_item_t lora_fixlen_item;

        static bool lora_crcon_read(void);
        static bool lora_crcon_push(void);
        static const toggle_item_t lora_crcon_item;

        static bool lora_iqinv_read(void);
        static bool lora_iqinv_push(void);
        static const toggle_item_t lora_iqinv_item;

        static unsigned flrc_cr_read_cb(bool);
        static menuMode_e flrc_cr_write_cb(unsigned sidx);
        static const dropdown_item_t flrc_cr_item;

        static unsigned flrc_synclen_read_cb(bool);
        static menuMode_e flrc_synclen_write_cb(unsigned sidx);
        static const dropdown_item_t flrc_synclen_item;