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_lr1110_private.h

Committer:
dudmuck
Date:
2021-09-16
Revision:
14:14b9e1c08bfc
Parent:
10:db4e11a55bda

File content as of revision 14:14b9e1c08bfc:

        static char chip_ver[];
        static void initRfSwDIO(void);
        static const button_item_t dbg_item;
        static void dbg_push(void);

        #define NB_RXBW     21
        static rxbw_t rxbws[NB_RXBW];
        static unsigned my_round(float);
        static uint8_t pktType;

        static const menu_t gfsk_menu[];
        static const menu_t none_menu[];

        static void rxDone(uint8_t size, float rssi, float snr);

        static unsigned recalCnt;
        /****************** common: **********************/

        static bool PaSel_read(void);
        static bool PaSel_push(void);
        static const toggle_item_t PaSel_item;

        static bool RegPASupply_read(void);
        static bool RegPASupply_push(void);
        static const toggle_item_t RegPASupply_item;

        static void PaDutyCycle_print(void);
        static bool PaDutyCycle_write(const char*);
        static const value_item_t PaDutyCycle_item;

        static void PaHPSel_print(void);
        static bool PaHPSel_write(const char*);
        static const value_item_t PaHPSel_item;

        static void txTimeout_print(void);
        static bool txTimeout_write(const char*);
        static const value_item_t txTimeout_item;

        /******************* none: ***********************/
        static bool DIO10en_read(void);
        static bool DIO10en_push(void);
        static const toggle_item_t DIO10en_item;

        static bool DIO8en_read(void);
        static bool DIO8en_push(void);
        static const toggle_item_t DIO8en_item;

        static bool DIO7en_read(void);
        static bool DIO7en_push(void);
        static const toggle_item_t DIO7en_item;

        static bool DIO6en_read(void);
        static bool DIO6en_push(void);
        static const toggle_item_t DIO6en_item;

        static bool DIO5en_read(void);
        static bool DIO5en_push(void);
        static const toggle_item_t DIO5en_item;

        static bool DIO5stby_read(void);
        static bool DIO5stby_push(void);
        static const toggle_item_t DIO5stby_item;

        static bool DIO6stby_read(void);
        static bool DIO6stby_push(void);
        static const toggle_item_t DIO6stby_item;

        static bool DIO7stby_read(void);
        static bool DIO7stby_push(void);
        static const toggle_item_t DIO7stby_item;

        static bool DIO8stby_read(void);
        static bool DIO8stby_push(void);
        static const toggle_item_t DIO8stby_item;

        static bool DIO10stby_read(void);
        static bool DIO10stby_push(void);
        static const toggle_item_t DIO10stby_item;

        static bool DIO5rx_read(void);
        static bool DIO5rx_push(void);
        static const toggle_item_t DIO5rx_item;

        static bool DIO6rx_read(void);
        static bool DIO6rx_push(void);
        static const toggle_item_t DIO6rx_item;

        static bool DIO7rx_read(void);
        static bool DIO7rx_push(void);
        static const toggle_item_t DIO7rx_item;

        static bool DIO8rx_read(void);
        static bool DIO8rx_push(void);
        static const toggle_item_t DIO8rx_item;

        static bool DIO10rx_read(void);
        static bool DIO10rx_push(void);
        static const toggle_item_t DIO10rx_item;

        static bool DIO5tx_read(void);
        static bool DIO5tx_push(void);
        static const toggle_item_t DIO5tx_item;

        static bool DIO6tx_read(void);
        static bool DIO6tx_push(void);
        static const toggle_item_t DIO6tx_item;

        static bool DIO7tx_read(void);
        static bool DIO7tx_push(void);
        static const toggle_item_t DIO7tx_item;

        static bool DIO8tx_read(void);
        static bool DIO8tx_push(void);
        static const toggle_item_t DIO8tx_item;

        static bool DIO10tx_read(void);
        static bool DIO10tx_push(void);
        static const toggle_item_t DIO10tx_item;

        static bool DIO5txhp_read(void);
        static bool DIO5txhp_push(void);
        static const toggle_item_t DIO5txhp_item;

        static bool DIO6txhp_read(void);
        static bool DIO6txhp_push(void);
        static const toggle_item_t DIO6txhp_item;

        static bool DIO7txhp_read(void);
        static bool DIO7txhp_push(void);
        static const toggle_item_t DIO7txhp_item;

        static bool DIO8txhp_read(void);
        static bool DIO8txhp_push(void);
        static const toggle_item_t DIO8txhp_item;

        static bool DIO10txhp_read(void);
        static bool DIO10txhp_push(void);
        static const toggle_item_t DIO10txhp_item;

        static bool DIO5gnss_read(void);
        static bool DIO5gnss_push(void);
        static const toggle_item_t DIO5gnss_item;

        static bool DIO6gnss_read(void);
        static bool DIO6gnss_push(void);
        static const toggle_item_t DIO6gnss_item;

        static bool DIO7gnss_read(void);
        static bool DIO7gnss_push(void);
        static const toggle_item_t DIO7gnss_item;

        static bool DIO8gnss_read(void);
        static bool DIO8gnss_push(void);
        static const toggle_item_t DIO8gnss_item;

        static bool DIO10gnss_read(void);
        static bool DIO10gnss_push(void);
        static const toggle_item_t DIO10gnss_item;

        static bool DIO5wifi_read(void);
        static bool DIO5wifi_push(void);
        static const toggle_item_t DIO5wifi_item;

        static bool DIO6wifi_read(void);
        static bool DIO6wifi_push(void);
        static const toggle_item_t DIO6wifi_item;

        static bool DIO7wifi_read(void);
        static bool DIO7wifi_push(void);
        static const toggle_item_t DIO7wifi_item;

        static bool DIO8wifi_read(void);
        static bool DIO8wifi_push(void);
        static const toggle_item_t DIO8wifi_item;

        static bool DIO10wifi_read(void);
        static bool DIO10wifi_push(void);
        static const toggle_item_t DIO10wifi_item;

        /******************* wifi: ***********************/

        static void wifiScan_push(void);
        static const button_item_t wifiScan_item;

        /******************* gnss: ***********************/

        static void gnssAutonomous_push(void);
        static const button_item_t gnssAutonomous_item;

        static void gnssAssisted_push(void);
        static const button_item_t gnssAssisted_item;

        /******************* lora: ************************/

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

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

        static unsigned lora_cr_read(bool);
        static menuMode_e lora_cr_write(unsigned sidx);
        static const dropdown_item_t lora_cr_item;

        static bool ppmOffset_read(void);
        static bool ppmOffset_push(void);
        static const toggle_item_t lora_ppmOffset_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_headerType_read(void);
        static bool lora_headerType_push(void);
        static const toggle_item_t lora_headerType_item;

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

        static bool lora_inviq_read(void);
        static bool lora_inviq_push(void);
        static const toggle_item_t lora_inviq_item;

        static bool lora_sync_read(void);
        static bool lora_sync_push(void);
        static const toggle_item_t lora_sync_item;

        /******************* gfsk: ***********************/

        static void gfsk_bitrate_print(void);
        static bool gfsk_bitrate_write(const char*);
        static const value_item_t gfsk_bitrate_item;

        static unsigned gfsk_bt_read(bool);
        static menuMode_e gfsk_bt_write(unsigned sidx);
        static const dropdown_item_t gfsk_bt_item;

        static void gfsk_rxbw_print(void);
        static bool gfsk_rxbw_write(const char*);
        static const value_item_t gfsk_rxbw_item;

        static void gfsk_fdev_print(void);
        static bool gfsk_fdev_write(const char*);
        static const value_item_t gfsk_fdev_item;

        static bool gfsk_fixLen_read(void);
        static bool gfsk_fixLen_push(void);
        static const toggle_item_t gfsk_fixLen_item;

        static void gfsk_pblLen_print(void);
        static bool gfsk_pblLen_write(const char*);
        static const value_item_t gfsk_pblLen_item;

        static unsigned gfsk_pblDetLen_read(bool);
        static menuMode_e gfsk_pblDetLen_write(unsigned sidx);
        static const dropdown_item_t gfsk_pblDetLen_item;

        static void gfsk_syncWord_print(void);
        static bool gfsk_syncWord_write(const char*);
        static const value_item_t gfsk_syncWord_item;

        static unsigned gfsk_addrcomp_read(bool);
        static menuMode_e gfsk_addrcomp_write(unsigned sidx);
        static const dropdown_item_t gfsk_addrcomp_item;

        static void gfsk_nodeadrs_print(void);
        static bool gfsk_nodeadrs_write(const char*);
        static const value_item_t gfsk_nodeadrs_item;

        static void gfsk_broadcast_print(void);
        static bool gfsk_broadcast_write(const char*);
        static const value_item_t gfsk_broadcast_item;

        static bool gfsk_varlen_read(void);
        static bool gfsk_varlen_push(void);
        static const toggle_item_t gfsk_varlen_item;

        static void gfsk_syncLen_print(void);
        static bool gfsk_syncLen_write(const char*);
        static const value_item_t gfsk_syncLen_item;

        static const char* const gfsk_crcType_strs[];
        static unsigned gfsk_crcType_read(bool);
        static menuMode_e gfsk_crcType_write(unsigned sidx);
        static const dropdown_item_t gfsk_crcType_item;

        static bool gfsk_dcfree_read(void);
        static bool gfsk_dcfree_push(void);
        static const toggle_item_t gfsk_dcfree_item;

        static void gfsk_crcinit_print(void);
        static bool gfsk_crcinit_write(const char*);
        static const value_item_t gfsk_crcinit_item;

        static void gfsk_crcpoly_print(void);
        static bool gfsk_crcpoly_write(const char*);
        static const value_item_t gfsk_crcpoly_item;

        /***********************************************/
        static void rxBuffer_push(void);
        static const button_item_t rxBufferStatus_item;

        static void getStats_push(void);
        static const button_item_t getStats_item;