2020-10-30 19:13:52 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2020 by Federico Amedeo Izzo IU2NUO, *
|
|
|
|
* Niccolò Izzo IU2KIN, *
|
|
|
|
* Silvano Seva IU2KWO *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/> *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef UI_H
|
|
|
|
#define UI_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <state.h>
|
2020-11-28 08:53:44 +00:00
|
|
|
#include <keyboard.h>
|
2020-10-30 21:59:49 +00:00
|
|
|
#include <stdint.h>
|
2020-12-05 17:40:08 +00:00
|
|
|
#include <event.h>
|
2020-10-30 19:13:52 +00:00
|
|
|
|
2020-12-06 20:24:25 +00:00
|
|
|
#define MENU_NUM 6
|
|
|
|
#define MENU_LEN 10
|
|
|
|
|
2020-12-06 19:31:06 +00:00
|
|
|
enum uiScreen
|
|
|
|
{
|
|
|
|
MAIN_VFO = 0,
|
|
|
|
MAIN_MEM,
|
|
|
|
MENU_TOP,
|
|
|
|
MENU_ZONE,
|
|
|
|
MENU_CHANNEL,
|
|
|
|
MENU_CONTACTS,
|
|
|
|
MENU_SMS,
|
|
|
|
MENU_GPS,
|
2020-12-18 18:03:34 +00:00
|
|
|
MENU_SETTINGS,
|
|
|
|
LOW_BAT
|
2020-12-06 19:31:06 +00:00
|
|
|
};
|
|
|
|
|
2020-10-30 19:13:52 +00:00
|
|
|
/**
|
|
|
|
* This function initialises the User Interface, starting the
|
|
|
|
* Finite State Machine describing the user interaction.
|
|
|
|
*/
|
|
|
|
void ui_init();
|
|
|
|
|
2020-12-06 19:31:06 +00:00
|
|
|
/**
|
|
|
|
* This function writes the OpenRTX splash screen image into the framebuffer.
|
|
|
|
*/
|
|
|
|
void ui_drawSplashScreen();
|
|
|
|
|
2020-10-30 19:13:52 +00:00
|
|
|
/**
|
|
|
|
* This function advances the User Interface FSM, basing on the
|
2020-11-26 21:44:39 +00:00
|
|
|
* current radio state and the keys pressed.
|
2020-11-21 09:46:39 +00:00
|
|
|
* @param last_state: A local copy of the previous radio state
|
2020-12-05 17:40:08 +00:00
|
|
|
* @param event: An event from other threads
|
2020-11-26 21:44:39 +00:00
|
|
|
*/
|
2020-12-06 19:31:06 +00:00
|
|
|
void ui_updateFSM(event_t event);
|
2020-11-26 21:44:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function redraws the GUI based on the last radio state.
|
|
|
|
* @param last_state: A local copy of the previous radio state
|
2020-10-30 19:13:52 +00:00
|
|
|
* @return true if a screen refresh is needed after the update
|
|
|
|
*/
|
2020-11-26 21:44:39 +00:00
|
|
|
bool ui_updateGUI(state_t last_state);
|
2020-10-30 19:13:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function terminates the User Interface.
|
|
|
|
*/
|
|
|
|
void ui_terminate();
|
|
|
|
|
|
|
|
#endif /* UI_H */
|