2018-02-26 13:06:10 +00:00
|
|
|
/*
|
2019-06-17 18:27:55 +00:00
|
|
|
* This file is part of the Trezor project, https://trezor.io/
|
2018-02-26 13:06:10 +00:00
|
|
|
*
|
|
|
|
* Copyright (c) SatoshiLabs
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2017-12-17 00:09:45 +00:00
|
|
|
#ifndef __BOOTUI_H__
|
|
|
|
#define __BOOTUI_H__
|
|
|
|
|
|
|
|
#include "image.h"
|
2019-03-29 15:26:02 +00:00
|
|
|
#include "secbool.h"
|
2022-05-05 11:47:19 +00:00
|
|
|
#include "stdbool.h"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SCREEN_INTRO = 0,
|
|
|
|
SCREEN_MENU = 1,
|
|
|
|
SCREEN_WIPE_CONFIRM = 2,
|
|
|
|
SCREEN_FINGER_PRINT = 3,
|
|
|
|
SCREEN_WAIT_FOR_HOST = 4,
|
|
|
|
} screen_t;
|
2017-12-17 00:09:45 +00:00
|
|
|
|
2019-03-29 15:26:02 +00:00
|
|
|
void ui_screen_boot(const vendor_header* const vhdr,
|
|
|
|
const image_header* const hdr);
|
2018-01-25 12:21:04 +00:00
|
|
|
void ui_screen_boot_wait(int wait_seconds);
|
2017-12-17 00:09:45 +00:00
|
|
|
void ui_screen_boot_click(void);
|
|
|
|
|
2022-05-05 11:47:19 +00:00
|
|
|
void ui_screen_welcome(void);
|
|
|
|
|
|
|
|
uint32_t ui_screen_intro(const vendor_header* const vhdr,
|
|
|
|
const image_header* const hdr);
|
2018-01-25 13:16:21 +00:00
|
|
|
|
2022-05-05 11:47:19 +00:00
|
|
|
uint32_t ui_screen_menu(void);
|
2017-12-17 00:09:45 +00:00
|
|
|
|
2022-05-05 11:47:19 +00:00
|
|
|
uint32_t ui_screen_install_confirm_upgrade(const vendor_header* const vhdr,
|
|
|
|
const image_header* const hdr);
|
|
|
|
uint32_t ui_screen_install_confirm_newvendor_or_downgrade_wipe(
|
2020-03-24 17:53:08 +00:00
|
|
|
const vendor_header* const vhdr, const image_header* const hdr,
|
|
|
|
secbool downgrade_wipe);
|
2022-05-05 11:47:19 +00:00
|
|
|
void ui_screen_install_start();
|
2017-12-17 00:09:45 +00:00
|
|
|
void ui_screen_install_progress_erase(int pos, int len);
|
|
|
|
void ui_screen_install_progress_upload(int pos);
|
|
|
|
|
2022-05-05 11:47:19 +00:00
|
|
|
uint32_t ui_screen_wipe_confirm(void);
|
2017-12-17 00:09:45 +00:00
|
|
|
void ui_screen_wipe(void);
|
|
|
|
void ui_screen_wipe_progress(int pos, int len);
|
|
|
|
|
2018-01-25 13:44:03 +00:00
|
|
|
void ui_screen_done(int restart_seconds, secbool full_redraw);
|
2017-12-17 00:09:45 +00:00
|
|
|
|
|
|
|
void ui_screen_fail(void);
|
|
|
|
|
|
|
|
void ui_fadein(void);
|
|
|
|
void ui_fadeout(void);
|
2022-05-05 11:47:19 +00:00
|
|
|
void ui_set_initial_setup(bool initial);
|
|
|
|
|
|
|
|
void ui_screen_boot_empty(bool firmware_present, bool fading);
|
2017-12-17 00:09:45 +00:00
|
|
|
|
2020-12-28 11:52:35 +00:00
|
|
|
// clang-format off
|
2019-03-29 15:26:02 +00:00
|
|
|
#define INPUT_CANCEL 0x01 // Cancel button
|
|
|
|
#define INPUT_CONFIRM 0x02 // Confirm button
|
|
|
|
#define INPUT_LONG_CONFIRM 0x04 // Long Confirm button
|
|
|
|
#define INPUT_INFO 0x08 // Info icon
|
2020-12-28 11:52:35 +00:00
|
|
|
// clang-format on
|
|
|
|
|
2018-01-25 13:16:21 +00:00
|
|
|
int ui_user_input(int zones);
|
2018-01-24 16:00:25 +00:00
|
|
|
|
2017-12-17 00:09:45 +00:00
|
|
|
#endif
|