@ -0,0 +1,7 @@ |
|||||
|
--- |
||||
|
# We'll use defaults from the LLVM style, but with 4 columns indentation. |
||||
|
BasedOnStyle: Mozilla |
||||
|
IndentWidth: 4 |
||||
|
--- |
||||
|
Language: Cpp |
||||
|
ColumnLimit: 120 |
@ -0,0 +1,16 @@ |
|||||
|
{ |
||||
|
"configurations": [ |
||||
|
{ |
||||
|
"name": "Linux", |
||||
|
"includePath": [ |
||||
|
"${workspaceFolder}/**" |
||||
|
], |
||||
|
"defines": [], |
||||
|
"compilerPath": "/usr/bin/gcc", |
||||
|
"cStandard": "gnu11", |
||||
|
"cppStandard": "gnu++14", |
||||
|
"intelliSenseMode": "gcc-x64" |
||||
|
} |
||||
|
], |
||||
|
"version": 4 |
||||
|
} |
@ -1,20 +0,0 @@ |
|||||
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||
//
|
|
||||
// SPDX-FileCopyrightText: 2018 Coinkite, Inc.
|
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
|
||||
//
|
|
||||
// Backlight driver for LED
|
|
||||
|
|
||||
#ifndef STM32_BACKLIGHT_H |
|
||||
#define STM32_BACKLIGHT_H |
|
||||
|
|
||||
#include "stm32h7xx_hal.h" |
|
||||
|
|
||||
#include <stdio.h> |
|
||||
#include <stdlib.h> |
|
||||
|
|
||||
void backlight_init(void); |
|
||||
void backlight_intensity(uint16_t intensity); |
|
||||
|
|
||||
#endif //STM32_BACKLIGHT_H
|
|
@ -0,0 +1 @@ |
|||||
|
version_info.c |
@ -0,0 +1,142 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
//
|
||||
|
// Autogenerated - Do not edit!
|
||||
|
//
|
||||
|
|
||||
|
#include "bootloader_graphics.h" |
||||
|
|
||||
|
uint8_t splash_data[] = { |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x00, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfe, 0x00, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfe, 0x00, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfe, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x0f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x0f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x7f, 0xfe, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x3f, 0xfc, 0x00, 0x07, 0xff, 0x80, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
||||
|
0xff, 0x80, 0x0f, 0x80, 0x0e, 0x0e, 0x01, 0xc0, 0x70, 0x1f, 0xe0, 0x00, 0x10, 0x03, 0xff, 0x80, 0x70, 0x00, 0xf8, 0x01, 0xc0, 0x70, |
||||
|
0xff, 0x80, 0x1f, 0xc0, 0x0e, 0x0e, 0x01, 0xc0, 0x70, 0x1f, 0xf0, 0x00, 0x38, 0x03, 0xff, 0x80, 0x70, 0x01, 0xfc, 0x01, 0xc0, 0x70, |
||||
|
0xff, 0x80, 0x3f, 0xe0, 0x0e, 0x0e, 0x01, 0xe0, 0x70, 0x1f, 0xf8, 0x00, 0x38, 0x03, 0xff, 0x80, 0x70, 0x03, 0xfe, 0x01, 0xe0, 0x70, |
||||
|
0xe0, 0x00, 0x78, 0xf0, 0x0e, 0x0e, 0x01, 0xf0, 0x70, 0x1c, 0x3c, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x70, 0x07, 0x8f, 0x01, 0xf0, 0x70, |
||||
|
0xe0, 0x00, 0xf0, 0x78, 0x0e, 0x0e, 0x01, 0xf8, 0x70, 0x1c, 0x1e, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x70, 0x0f, 0x07, 0x81, 0xf8, 0x70, |
||||
|
0xfe, 0x00, 0xe0, 0x38, 0x0e, 0x0e, 0x01, 0xfc, 0x70, 0x1c, 0x0e, 0x00, 0xfe, 0x00, 0x38, 0x00, 0x70, 0x0e, 0x03, 0x81, 0xfc, 0x70, |
||||
|
0xfe, 0x00, 0xe0, 0x38, 0x0e, 0x0e, 0x01, 0xde, 0x70, 0x1c, 0x0e, 0x00, 0xee, 0x00, 0x38, 0x00, 0x70, 0x0e, 0x03, 0x81, 0xde, 0x70, |
||||
|
0xfe, 0x00, 0xe0, 0x38, 0x0e, 0x0e, 0x01, 0xcf, 0x70, 0x1c, 0x0e, 0x01, 0xef, 0x00, 0x38, 0x00, 0x70, 0x0e, 0x03, 0x81, 0xcf, 0x70, |
||||
|
0xe0, 0x00, 0xf0, 0x78, 0x0e, 0x0e, 0x01, 0xc7, 0xf0, 0x1c, 0x1e, 0x01, 0xc7, 0x00, 0x38, 0x00, 0x70, 0x0f, 0x07, 0x81, 0xc7, 0xf0, |
||||
|
0xe0, 0x00, 0x78, 0xf0, 0x0f, 0x1e, 0x01, 0xc3, 0xf0, 0x1c, 0x3c, 0x03, 0xc7, 0x80, 0x38, 0x00, 0x70, 0x07, 0x8f, 0x01, 0xc3, 0xf0, |
||||
|
0xe0, 0x00, 0x3f, 0xe0, 0x07, 0xfc, 0x01, 0xc1, 0xf0, 0x1f, 0xf8, 0x03, 0x83, 0x80, 0x38, 0x00, 0x70, 0x03, 0xfe, 0x01, 0xc1, 0xf0, |
||||
|
0xe0, 0x00, 0x1f, 0xc0, 0x07, 0xfc, 0x01, 0xc0, 0xf0, 0x1f, 0xf0, 0x07, 0x83, 0xc0, 0x38, 0x00, 0x70, 0x01, 0xfc, 0x01, 0xc0, 0xf0, |
||||
|
0xe0, 0x00, 0x0f, 0x80, 0x03, 0xf8, 0x01, 0xc0, 0x70, 0x1f, 0xe0, 0x07, 0x01, 0xc0, 0x38, 0x00, 0x70, 0x00, 0xf8, 0x01, 0xc0, 0x70, |
||||
|
}; |
||||
|
Image splash_img = { 172, 129, 22, splash_data }; |
||||
|
|
@ -0,0 +1,17 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
//
|
||||
|
// Autogenerated - Do not edit!
|
||||
|
//
|
||||
|
|
||||
|
#include <stdint.h> |
||||
|
|
||||
|
typedef struct _Image { |
||||
|
int16_t width; |
||||
|
int16_t height; |
||||
|
int16_t byte_width; |
||||
|
uint8_t* data; |
||||
|
} Image; |
||||
|
|
||||
|
extern Image splash_img; |
@ -0,0 +1,19 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc.
|
||||
|
// <hello@foundationdevices.com> SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
// splash.c - Splash screen shown at during initialization
|
||||
|
|
||||
|
#include "display.h" |
||||
|
|
||||
|
#include "bootloader_graphics.h" |
||||
|
|
||||
|
void show_splash(char* message) |
||||
|
{ |
||||
|
uint16_t x = SCREEN_WIDTH / 2 - splash_img.width / 2; |
||||
|
uint16_t y = SCREEN_HEIGHT / 2 - splash_img.height / 2; |
||||
|
|
||||
|
display_clear(0); |
||||
|
display_image(x, y, splash_img.width, splash_img.height, splash_img.data, DRAW_MODE_NORMAL); |
||||
|
display_text(message, CENTER_X, SCREEN_HEIGHT - 68, &FontSmall, false); |
||||
|
display_show(); |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc.
|
||||
|
// <hello@foundationdevices.com> SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
// splash.h - Splash screen shown at during initialization
|
||||
|
|
||||
|
extern void show_splash(char* message); |
@ -0,0 +1,86 @@ |
|||||
|
/* |
||||
|
SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com> |
||||
|
SPDX-License-Identifier: GPL-3.0-or-later |
||||
|
|
||||
|
SPDX-FileCopyrightText: 2018 Coinkite, Inc. <coldcardwallet.com> |
||||
|
SPDX-License-Identifier: GPL-3.0-only |
||||
|
*/ |
||||
|
.thumb |
||||
|
.syntax unified |
||||
|
|
||||
|
.global Reset_Handler |
||||
|
.type Reset_Handler, %function |
||||
|
|
||||
|
Reset_Handler: |
||||
|
|
||||
|
/* Load the stack pointer */ |
||||
|
ldr sp, =_estack |
||||
|
|
||||
|
/* Initialise the data section */ |
||||
|
ldr r1, =_sidata |
||||
|
ldr r2, =_sdata |
||||
|
ldr r3, =_edata |
||||
|
b .data_copy_entry |
||||
|
.data_copy_loop: |
||||
|
ldr r0, [r1], #4 /* Should be 4-aligned to be as fast as possible */ |
||||
|
str r0, [r2], #4 |
||||
|
.data_copy_entry: |
||||
|
cmp r2, r3 |
||||
|
bcc .data_copy_loop |
||||
|
|
||||
|
/* Zero out the BSS section */ |
||||
|
movs r0, #0 |
||||
|
ldr r1, =_sbss |
||||
|
ldr r2, =_ebss |
||||
|
b .bss_zero_entry |
||||
|
.bss_zero_loop: |
||||
|
str r0, [r1], #4 /* Should be 4-aligned to be as fast as possible */ |
||||
|
.bss_zero_entry: |
||||
|
cmp r1, r2 |
||||
|
bcc .bss_zero_loop |
||||
|
|
||||
|
/* Initialise the sram section */ |
||||
|
ldr r1, =_siram |
||||
|
ldr r2, =_sram |
||||
|
ldr r3, =_eram |
||||
|
b .ram_copy_entry |
||||
|
.ram_copy_loop: |
||||
|
ldr r0, [r1], #4 /* Should be 4-aligned to be as fast as possible */ |
||||
|
str r0, [r2], #4 |
||||
|
.ram_copy_entry: |
||||
|
cmp r2, r3 |
||||
|
bcc .ram_copy_loop |
||||
|
|
||||
|
bl main |
||||
|
|
||||
|
/* |
||||
|
* get a ptr to real code |
||||
|
* load R1 with 0x08020800 value: start of firmware |
||||
|
*/ |
||||
|
movw r1, (0x08020800 >> 12) |
||||
|
lsl r1, 12 |
||||
|
orr.w r1, r1, #0x800 |
||||
|
|
||||
|
/* set stack pointer to their preference */ |
||||
|
ldr r0, [r1] |
||||
|
mov sp, r0 |
||||
|
|
||||
|
/* Disabled |
||||
|
* We cannot change to user mode here because the micropython code |
||||
|
* depends on being in supervisor mode. SystemInit() is invoked |
||||
|
* from the Reset_Handler() and the vector table (along with other |
||||
|
* SCB accesses) is set at the start of stm32_main()...both |
||||
|
* important things in the startup processing. |
||||
|
*/ |
||||
|
/* We are in supervisor mode out of reset...drop down to user mode */ |
||||
|
/* |
||||
|
mrs r3, CONTROL |
||||
|
orr.w r3, r3, #1 |
||||
|
msr CONTROL, r3 |
||||
|
*/ |
||||
|
/* Read reset vector, and jump to it. */ |
||||
|
mov r0, 1 /* set reset_mode arg: 1=normal? */ |
||||
|
ldr lr, [r1, 4] |
||||
|
bx lr |
||||
|
|
||||
|
.end |
@ -0,0 +1,243 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc.
|
||||
|
// <hello@foundationdevices.com> SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
// ui.c - Simple UI elements for the bootloader
|
||||
|
|
||||
|
#include <string.h> |
||||
|
|
||||
|
#include "ui.h" |
||||
|
#include "gpio.h" |
||||
|
#include "delay.h" |
||||
|
#include "utils.h" |
||||
|
#include "display.h" |
||||
|
#include "passport_fonts.h" |
||||
|
#include "ring_buffer.h" |
||||
|
#include "lcd-sharp-ls018B7dh02.h" |
||||
|
|
||||
|
#define HEADER_HEIGHT 40 |
||||
|
#define FOOTER_HEIGHT 32 |
||||
|
#define SIDE_MARGIN 4 |
||||
|
#define TOP_MARGIN 4 |
||||
|
|
||||
|
void ui_draw_header(char* title) { |
||||
|
uint16_t title_y = 10; |
||||
|
|
||||
|
// Title
|
||||
|
display_text(title, CENTER_X, title_y, &FontSmall, false); |
||||
|
|
||||
|
// Divider
|
||||
|
display_fill_rect(0, HEADER_HEIGHT-4, SCREEN_WIDTH, 2, 1); |
||||
|
} |
||||
|
|
||||
|
void ui_draw_button(uint16_t x, uint16_t y, uint16_t w, uint16_t h, char* label, bool is_pressed) { |
||||
|
if (is_pressed) { |
||||
|
display_fill_rect(x, y, w, h, 1); |
||||
|
} else { |
||||
|
display_rect(x, y, w, h, 1); |
||||
|
} |
||||
|
|
||||
|
// Measure text and center it in the button
|
||||
|
uint16_t label_width = display_measure_text(label, &FontTiny); |
||||
|
|
||||
|
x = x + (w / 2 - label_width / 2); |
||||
|
y = y + (h / 2 - FontTiny.ascent / 2); |
||||
|
|
||||
|
display_text(label, x, y - 1, &FontTiny, is_pressed); |
||||
|
} |
||||
|
|
||||
|
void ui_draw_footer(char* left_btn, bool is_left_pressed, char* right_btn, bool is_right_pressed) { |
||||
|
|
||||
|
uint16_t btn_w = SCREEN_WIDTH / 2; |
||||
|
|
||||
|
// Draw left button
|
||||
|
ui_draw_button(-1, SCREEN_HEIGHT - FOOTER_HEIGHT + 1, btn_w + 1, |
||||
|
FOOTER_HEIGHT, left_btn, is_left_pressed); |
||||
|
|
||||
|
// Draw right button
|
||||
|
ui_draw_button(btn_w - 1, SCREEN_HEIGHT - FOOTER_HEIGHT + 1, |
||||
|
btn_w + 2, FOOTER_HEIGHT, right_btn, is_right_pressed); |
||||
|
} |
||||
|
|
||||
|
void ui_draw_wrapped_text(uint16_t x, uint16_t y, uint16_t max_width, char* text, bool center) { |
||||
|
// Buffer to hold each wrapped line
|
||||
|
char line[80]; |
||||
|
uint16_t curr_y = y; |
||||
|
|
||||
|
while (*text != 0) { |
||||
|
uint16_t sp = 0; |
||||
|
uint16_t last_space = 0; |
||||
|
uint16_t line_width = 0; |
||||
|
uint16_t first_non_space = 0; |
||||
|
uint16_t text_len = strlen(text); |
||||
|
uint16_t sp_skip = 0; |
||||
|
|
||||
|
// Skip leading spaces
|
||||
|
while (true) { |
||||
|
if (text[sp] == ' ') { |
||||
|
sp++; |
||||
|
first_non_space = sp; |
||||
|
} else if (text[sp] == '\n') { |
||||
|
sp++; |
||||
|
first_non_space = sp; |
||||
|
curr_y += FontSmall.leading; |
||||
|
} else { |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
while (sp < text_len) { |
||||
|
char ch = text[sp]; |
||||
|
if (ch == ' ') { |
||||
|
last_space = sp; |
||||
|
} |
||||
|
else if (ch == '\n') { |
||||
|
// Time to break the line - Skip over this character after copying and rendering the line with sp_skip
|
||||
|
sp_skip = 1; |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
uint16_t ch_width = display_get_char_width(ch, &FontSmall); |
||||
|
line_width += ch_width; |
||||
|
if (line_width >= max_width) { |
||||
|
// If we found a space, we can break there, but if we didn't
|
||||
|
// then just break before we go over.
|
||||
|
if (last_space != 0) { |
||||
|
sp = last_space; |
||||
|
} |
||||
|
break; |
||||
|
} |
||||
|
sp++; |
||||
|
} |
||||
|
|
||||
|
// Copy to prepare for rendering
|
||||
|
strncpy(line, text + first_non_space, sp-first_non_space); |
||||
|
line[sp-first_non_space] = 0; |
||||
|
text = text + sp + sp_skip; |
||||
|
|
||||
|
|
||||
|
// Draw the line
|
||||
|
display_text(line, center ? CENTER_X : SIDE_MARGIN, curr_y, &FontSmall, false); |
||||
|
|
||||
|
curr_y += FontSmall.leading; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#ifndef DEBUG |
||||
|
static bool poll_for_key(uint8_t* p_key, bool* p_is_key_down) { |
||||
|
uint8_t key; |
||||
|
uint8_t count = ring_buffer_dequeue(&key); |
||||
|
|
||||
|
if (count == 0) { |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
*p_key = key & 0x7F; |
||||
|
*p_is_key_down = (key & 0x80) ? true : false; |
||||
|
|
||||
|
return true; |
||||
|
} |
||||
|
#endif // DEBUG
|
||||
|
|
||||
|
// Show message and then delay or wait for button press
|
||||
|
bool ui_show_message(char* title, char* message, char* left_btn, char *right_btn, bool center) { |
||||
|
bool exit = false; |
||||
|
bool result = false; |
||||
|
bool is_left_pressed = false; |
||||
|
bool is_right_pressed = false; |
||||
|
|
||||
|
do { |
||||
|
display_clear(0); |
||||
|
|
||||
|
// Draw the text
|
||||
|
ui_draw_wrapped_text(SIDE_MARGIN, HEADER_HEIGHT + TOP_MARGIN, SCREEN_WIDTH - SIDE_MARGIN * 2, message, center); |
||||
|
|
||||
|
// Draw the header
|
||||
|
ui_draw_header(title); |
||||
|
|
||||
|
// Draw the footer
|
||||
|
ui_draw_footer(left_btn, is_left_pressed, right_btn, is_right_pressed); |
||||
|
display_show(); |
||||
|
|
||||
|
#ifdef DEBUG |
||||
|
delay_ms(5000); |
||||
|
result = true; |
||||
|
} while (exit); |
||||
|
#else |
||||
|
// Only poll if we are not exiting
|
||||
|
if (!exit) { |
||||
|
// Poll for key
|
||||
|
uint8_t key; |
||||
|
bool is_key_down; |
||||
|
bool key_read; |
||||
|
do { |
||||
|
key_read = poll_for_key(&key, &is_key_down); |
||||
|
} while (!key_read); |
||||
|
|
||||
|
// Handle key
|
||||
|
if (key_read) { |
||||
|
if (is_key_down) { |
||||
|
switch (key) { |
||||
|
case 99: // 'y'
|
||||
|
is_right_pressed = true; |
||||
|
break; |
||||
|
|
||||
|
case 113: // 'x'
|
||||
|
is_left_pressed = true; |
||||
|
break; |
||||
|
} |
||||
|
} else { |
||||
|
switch (key) { |
||||
|
case 99: // 'y'
|
||||
|
is_right_pressed = false; |
||||
|
exit = true; |
||||
|
result = true; |
||||
|
continue; |
||||
|
|
||||
|
case 113: // 'x'
|
||||
|
is_left_pressed = false; |
||||
|
exit = true; |
||||
|
result = false; |
||||
|
continue; |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
delay_ms(50); |
||||
|
} |
||||
|
} |
||||
|
} while (!exit); |
||||
|
#endif // DEBUG
|
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
// Show the error message and give user the option to SHUTDOWN, or view
|
||||
|
// CONTACT information. Then have option to go BACK to the error.
|
||||
|
// NOTE: This function never returns!
|
||||
|
void ui_show_fatal_error(char* error) { |
||||
|
bool show_error = true; |
||||
|
|
||||
|
while (true) { |
||||
|
if (show_error) { |
||||
|
// Show the error
|
||||
|
if (ui_show_message("Fatal Error", error, "CONTACT", "SHUTDOWN", true)) { |
||||
|
display_clean_shutdown(); |
||||
|
} else { |
||||
|
show_error = false; |
||||
|
} |
||||
|
} else { |
||||
|
// Show Contact Info
|
||||
|
if (ui_show_message("Contact", "\nContact us at:\n\nhello@foundationdevices.com", |
||||
|
"BACK", "SHUTDOWN", true)) { |
||||
|
display_clean_shutdown(); |
||||
|
} else { |
||||
|
show_error = true; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
void ui_show_hex_buffer(char* title, uint8_t* data, uint32_t length) { |
||||
|
char buf[512]; |
||||
|
bytes_to_hex_str(data, length, buf, 8, '\n'); |
||||
|
ui_show_message(title, buf, "SHUTDOWN", "CONTINUE", true); |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc.
|
||||
|
// <hello@foundationdevices.com> SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
// ui.h - Simple UI elements for the bootloader
|
||||
|
|
||||
|
#include <stdint.h> |
||||
|
#include <stdbool.h> |
||||
|
|
||||
|
// UI elements
|
||||
|
void ui_draw_header(char* title); |
||||
|
void ui_draw_footer(char* left_btn, bool is_left_pressed, char* right_btn, bool is_right_pressed); |
||||
|
void ui_draw_button(uint16_t x, uint16_t y, uint16_t w, uint16_t h, char* label, bool is_pressed); |
||||
|
void ui_draw_wrapped_text(uint16_t x, uint16_t y, uint16_t max_width, char* text, bool center); |
||||
|
bool ui_show_message(char* title, char* message, char* left_btn, char*right_btn, bool center); |
||||
|
void ui_show_fatal_error(char* message); |
||||
|
void ui_show_hex_buffer(char* title, uint8_t* buf, uint32_t length); |
@ -0,0 +1,6 @@ |
|||||
|
// SPDX-FileCopyrightText: 2021 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
|
||||
|
extern char *build_date; |
||||
|
extern char *build_version; |
@ -0,0 +1,196 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc.
|
||||
|
// <hello@foundationdevices.com> SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
// busy_bar.c - Timer and rendering code for busy bar
|
||||
|
#include <string.h> |
||||
|
#include <math.h> |
||||
|
#include "display.h" |
||||
|
#include "firmware_graphics.h" |
||||
|
|
||||
|
#define BUSY_BAR_HEIGHT 34 |
||||
|
|
||||
|
static TIM_HandleTypeDef htim7; |
||||
|
|
||||
|
#ifdef SINE_WAVE_BUSY_BAR |
||||
|
#define NUM_BUSY_BAR_FRAMES 24 |
||||
|
#define NUM_BUSY_BAR_FRAMES_TO_RENDER 20 |
||||
|
static int busy_bar_frames[NUM_BUSY_BAR_FRAMES] = {6,5,4,3,2,1,0,1,2,3,4,5,6,5,4,3,2,1,0,1,2,3,4,5}; |
||||
|
|
||||
|
#define NUM_BUSY_BAR_IMAGES 7 |
||||
|
static Image* busy_bar_images[NUM_BUSY_BAR_IMAGES] = { |
||||
|
&busybar1_img, |
||||
|
&busybar2_img, |
||||
|
&busybar3_img, |
||||
|
&busybar4_img, |
||||
|
&busybar5_img, |
||||
|
&busybar6_img, |
||||
|
&busybar7_img, |
||||
|
}; |
||||
|
|
||||
|
#define X_OFFSET_PER_IMAGE 20 |
||||
|
#define DIRECTION_RIGHT_TO_LEFT 1 |
||||
|
#define DIRECTION_LEFT_TO_RIGHT 2 |
||||
|
|
||||
|
static float sin_offset = 0.0; |
||||
|
static void busy_bar(void) |
||||
|
{ |
||||
|
int16_t start_y = SCREEN_HEIGHT - BUSY_BAR_HEIGHT; |
||||
|
uint16_t direction = DIRECTION_LEFT_TO_RIGHT; |
||||
|
|
||||
|
// Draw white area for the background since we only draw black pixels below
|
||||
|
display_fill_rect(0, start_y, SCREEN_WIDTH, BUSY_BAR_HEIGHT, 0); |
||||
|
|
||||
|
for (int16_t i=0; i<NUM_BUSY_BAR_FRAMES_TO_RENDER; i++) { |
||||
|
int16_t x = (X_OFFSET_PER_IMAGE * i) - 10; |
||||
|
uint16_t image_index = 1; //busy_bar_frames[i];
|
||||
|
float v = (float)x + sin_offset; // Offset for animation
|
||||
|
float s = sin(v); |
||||
|
int16_t scaled = (int16_t)(s * 7.0f); |
||||
|
int16_t y = (int16_t)(scaled + start_y + 8); |
||||
|
|
||||
|
display_image(x + ((int16_t)(sin_offset * 2.0) % X_OFFSET_PER_IMAGE), y, busy_bar_images[image_index]->width, busy_bar_images[image_index]->height, busy_bar_images[image_index]->data, DRAW_MODE_WHITE_ONLY); |
||||
|
} |
||||
|
|
||||
|
display_show_lines(start_y, start_y + SCREEN_HEIGHT - 1); |
||||
|
sin_offset += 1.0; |
||||
|
|
||||
|
// Rotate frame indexes
|
||||
|
if (direction == DIRECTION_RIGHT_TO_LEFT) { |
||||
|
int first = busy_bar_frames[0]; |
||||
|
for (int16_t i=0; i<NUM_BUSY_BAR_FRAMES - 1; i++) { |
||||
|
busy_bar_frames[i] = busy_bar_frames[i+1]; |
||||
|
} |
||||
|
busy_bar_frames[NUM_BUSY_BAR_FRAMES-1] = first; |
||||
|
} else { |
||||
|
int last = busy_bar_frames[NUM_BUSY_BAR_FRAMES-1]; |
||||
|
for (int16_t i=NUM_BUSY_BAR_FRAMES - 1; i>0; i--) { |
||||
|
busy_bar_frames[i] = busy_bar_frames[i-1]; |
||||
|
} |
||||
|
busy_bar_frames[0] = last; |
||||
|
} |
||||
|
} |
||||
|
#endif |
||||
|
|
||||
|
#define KNIGHT_RIDER_BUSY_BAR |
||||
|
#ifdef KNIGHT_RIDER_BUSY_BAR |
||||
|
|
||||
|
#define NUM_BUSY_BAR_IMAGES 6 |
||||
|
#define X_OFFSET_PER_IMAGE 23 |
||||
|
|
||||
|
typedef struct _bal_info_t { |
||||
|
Image* image; |
||||
|
int16_t x_pos; |
||||
|
int8_t direction; |
||||
|
} ball_info_t; |
||||
|
|
||||
|
ball_info_t ball_info[NUM_BUSY_BAR_IMAGES] = { |
||||
|
// {&busybar7_img, 0, 1},
|
||||
|
{&busybar6_img, 0, 1}, |
||||
|
{&busybar5_img, 0, 1}, |
||||
|
{&busybar4_img, 0, 1}, |
||||
|
{&busybar3_img, 0, 1}, |
||||
|
{&busybar2_img, 0, 1}, |
||||
|
{&busybar1_img, 0, 1}, |
||||
|
}; |
||||
|
|
||||
|
static bool first_activation = true; |
||||
|
|
||||
|
static void busy_bar_reset_animation(void) { |
||||
|
for (int16_t i=0; i<NUM_BUSY_BAR_IMAGES; i++) { |
||||
|
ball_info[i].x_pos = -(X_OFFSET_PER_IMAGE*i); |
||||
|
ball_info[i].direction = 1; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
static void busy_bar(void) |
||||
|
{ |
||||
|
int16_t start_y = SCREEN_HEIGHT - BUSY_BAR_HEIGHT; |
||||
|
int16_t x_offset = (X_OFFSET_PER_IMAGE - ball_info[0].image->width) / 2; |
||||
|
|
||||
|
// Don't draw this the first time we show it on the splash screen -- looks better
|
||||
|
if (!first_activation) { |
||||
|
// Draw a black separator line (should be exactly where the footer line is)
|
||||
|
display_fill_rect(0, start_y, SCREEN_WIDTH, 1, 1); |
||||
|
} |
||||
|
|
||||
|
// Draw white area for the background since we only draw black pixels below
|
||||
|
display_fill_rect(0, start_y + 1, SCREEN_WIDTH, BUSY_BAR_HEIGHT - 1, 0); |
||||
|
|
||||
|
// Vertical offset to center busy bar
|
||||
|
int16_t voffset = (BUSY_BAR_HEIGHT / 2) - (ball_info[0].image->height/2); |
||||
|
|
||||
|
for (int16_t i=0; i<NUM_BUSY_BAR_IMAGES; i++) { |
||||
|
display_image(ball_info[i].x_pos + x_offset, start_y + voffset, ball_info[i].image->width, ball_info[i].image->height, ball_info[i].image->data, DRAW_MODE_WHITE_ONLY); |
||||
|
|
||||
|
// Move this ball for next time
|
||||
|
ball_info[i].x_pos += X_OFFSET_PER_IMAGE * ball_info[i].direction; |
||||
|
if ((ball_info[i].x_pos < 0 && ball_info[i].direction == -1) || |
||||
|
(ball_info[i].x_pos > SCREEN_WIDTH && ball_info[i].direction == 1)) { |
||||
|
ball_info[i].direction = -ball_info[i].direction; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
int16_t end_y = start_y + BUSY_BAR_HEIGHT - 1; |
||||
|
display_show_lines(start_y, end_y); |
||||
|
} |
||||
|
#endif |
||||
|
|
||||
|
void TIM7_IRQHandler(void) |
||||
|
{ |
||||
|
if (__HAL_TIM_GET_FLAG(&htim7, TIM_FLAG_UPDATE) != RESET) |
||||
|
{ |
||||
|
if (__HAL_TIM_GET_ITSTATUS(&htim7, TIM_IT_UPDATE) != RESET) |
||||
|
{ |
||||
|
__HAL_TIM_CLEAR_FLAG(&htim7, TIM_FLAG_UPDATE); |
||||
|
busy_bar(); |
||||
|
} |
||||
|
} |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
void busy_bar_start(void) |
||||
|
{ |
||||
|
busy_bar_reset_animation(); |
||||
|
HAL_NVIC_EnableIRQ(TIM7_IRQn); |
||||
|
HAL_TIM_Base_Start_IT(&htim7); |
||||
|
} |
||||
|
|
||||
|
void busy_bar_stop(void) |
||||
|
{ |
||||
|
HAL_TIM_Base_Stop_IT(&htim7); |
||||
|
HAL_NVIC_DisableIRQ(TIM7_IRQn); |
||||
|
first_activation = false; |
||||
|
} |
||||
|
|
||||
|
void busy_bar_init(void) |
||||
|
{ |
||||
|
TIM_ClockConfigTypeDef sClockSourceConfig = {0}; |
||||
|
TIM_MasterConfigTypeDef sMasterConfig = {0}; |
||||
|
uint16_t prescaler; |
||||
|
uint32_t period; |
||||
|
|
||||
|
__TIM7_CLK_ENABLE(); |
||||
|
|
||||
|
/* Fixed interrupt frequency of 1 Hz */ |
||||
|
prescaler = 24000 - 1; |
||||
|
period = 1000 - 1; |
||||
|
|
||||
|
htim7.Instance = TIM7; |
||||
|
htim7.Init.Prescaler = prescaler; |
||||
|
htim7.Init.CounterMode = TIM_COUNTERMODE_UP; |
||||
|
htim7.Init.Period = period; |
||||
|
htim7.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; |
||||
|
htim7.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; |
||||
|
HAL_TIM_Base_Init(&htim7); |
||||
|
|
||||
|
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; |
||||
|
HAL_TIM_ConfigClockSource(&htim7, &sClockSourceConfig); |
||||
|
|
||||
|
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; |
||||
|
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; |
||||
|
HAL_TIMEx_MasterConfigSynchronization(&htim7, &sMasterConfig); |
||||
|
|
||||
|
__HAL_TIM_CLEAR_FLAG(&htim7, TIM_SR_UIF); |
||||
|
|
||||
|
HAL_NVIC_SetPriority(TIM7_IRQn, 10, 0); |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
// busy_bar.h - Timer and rendering code for busy bar
|
||||
|
#pragma once |
||||
|
|
||||
|
extern void busy_bar_init(void); |
||||
|
extern void busy_bar_start(void); |
||||
|
extern void busy_bar_stop(void); |
@ -0,0 +1,269 @@ |
|||||
|
// SPDX-FileCopyrightText: 2021 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
|
||||
|
#include <stdint.h> |
||||
|
|
||||
|
typedef struct { |
||||
|
uint32_t keypad_digits; |
||||
|
uint16_t offsets; |
||||
|
} word_info_t; |
||||
|
|
||||
|
word_info_t bytewords_word_info[] = { |
||||
|
{2225, 0x4900}, // back
|
||||
|
{2243, 0x2800}, // acid
|
||||
|
{2253, 0x1900}, // able
|
||||
|
{2253, 0x4800}, // bald
|
||||
|
{2256, 0x8800}, // calm
|
||||
|
{2274, 0x8d00}, // cash
|
||||
|
{2276, 0x4900}, // barn
|
||||
|
{2287, 0x8300}, // cats
|
||||
|
{2358, 0x5800}, // belt
|
||||
|
{2382, 0x5000}, // beta
|
||||
|
{2427, 0x6300}, // bias
|
||||
|
{2433, 0x9600}, // chef
|
||||
|
{2489, 0xa200}, // city
|
||||
|
{2529, 0xa000}, // claw
|
||||
|
{2576, 0x2e00}, // also
|
||||
|
{2583, 0x6500}, // blue
|
||||
|
{2633, 0xa100}, // code
|
||||
|
{2639, 0x6200}, // body
|
||||
|
{2652, 0xa800}, // cola
|
||||
|
{2665, 0xa900}, // cook
|
||||
|
{2678, 0xac00}, // cost
|
||||
|
{2724, 0x2900}, // arch
|
||||
|
{2724, 0x6000}, // brag
|
||||
|
{2739, 0x0500}, // apex
|
||||
|
{2739, 0x6400}, // brew
|
||||
|
{2782, 0x1400}, // aqua
|
||||
|
{2789, 0xa500}, // crux
|
||||
|
{2852, 0x5900}, // bulb
|
||||
|
{2866, 0x0800}, // atom
|
||||
|
{2868, 0x1400}, // aunt
|
||||
|
{2875, 0x9a00}, // curl
|
||||
|
{2877, 0x9c00}, // cusp
|
||||
|
{2899, 0x5f00}, // buzz
|
||||
|
{2926, 0xa100}, // cyan
|
||||
|
{2929, 0x0200}, // away
|
||||
|
{2947, 0x1b00}, // axis
|
||||
|
{3224, 0x4900}, // each
|
||||
|
{3228, 0x8800}, // fact
|
||||
|
{3246, 0x6600}, // echo
|
||||
|
{3247, 0x8a00}, // fair
|
||||
|
{3275, 0x0900}, // dark
|
||||
|
{3279, 0x4e00}, // easy
|
||||
|
{3282, 0x0000}, // data
|
||||
|
{3297, 0x0b00}, // days
|
||||
|
{3343, 0x4100}, // edge
|
||||
|
{3354, 0x1a00}, // deli
|
||||
|
{3376, 0x9900}, // fern
|
||||
|
{3423, 0x2900}, // dice
|
||||
|
{3438, 0x2400}, // diet
|
||||
|
{3447, 0xa300}, // figs
|
||||
|
{3456, 0xa800}, // film
|
||||
|
{3474, 0xad00}, // fish
|
||||
|
{3499, 0xaf00}, // fizz
|
||||
|
{3527, 0xa000}, // flap
|
||||
|
{3539, 0xa400}, // flew
|
||||
|
{3589, 0xa500}, // flux
|
||||
|
{3667, 0x2a00}, // door
|
||||
|
{3696, 0x2100}, // down
|
||||
|
{3699, 0xa600}, // foxy
|
||||
|
{3729, 0x2000}, // draw
|
||||
|
{3733, 0xa500}, // free
|
||||
|
{3742, 0x4a00}, // epic
|
||||
|
{3764, 0xa800}, // frog
|
||||
|
{3767, 0x2800}, // drop
|
||||
|
{3786, 0x2400}, // drum
|
||||
|
{3835, 0x9600}, // fuel
|
||||
|
{3836, 0x6500}, // even
|
||||
|
{3855, 0x1a00}, // dull
|
||||
|
{3863, 0x9400}, // fund
|
||||
|
{3889, 0x1200}, // duty
|
||||
|
{3926, 0x5000}, // exam
|
||||
|
{3937, 0x6700}, // eyes
|
||||
|
{3948, 0x5800}, // exit
|
||||
|
{4233, 0xa400}, // iced
|
||||
|
{4252, 0x0800}, // gala
|
||||
|
{4253, 0x4a00}, // half
|
||||
|
{4263, 0x0100}, // game
|
||||
|
{4264, 0x4400}, // hang
|
||||
|
{4273, 0x4800}, // hard
|
||||
|
{4295, 0x4100}, // hawk
|
||||
|
{4327, 0x1200}, // gear
|
||||
|
{4328, 0x5000}, // heat
|
||||
|
{4332, 0x8400}, // idea
|
||||
|
{4353, 0x8900}, // idle
|
||||
|
{4357, 0x5800}, // help
|
||||
|
{4367, 0x1300}, // gems
|
||||
|
{4438, 0x2800}, // gift
|
||||
|
{4444, 0x6100}, // high
|
||||
|
{4455, 0x6a00}, // hill
|
||||
|
{4475, 0x2a00}, // girl
|
||||
|
{4569, 0x2800}, // glow
|
||||
|
{4624, 0x9900}, // inch
|
||||
|
{4659, 0x6a00}, // holy
|
||||
|
{4659, 0x9600}, // inky
|
||||
|
{4663, 0x2800}, // good
|
||||
|
{4673, 0x6100}, // hope
|
||||
|
{4676, 0x6900}, // horn
|
||||
|
{4686, 0x9200}, // into
|
||||
|
{4729, 0x2200}, // gray
|
||||
|
{4746, 0x2800}, // grim
|
||||
|
{4747, 0xab00}, // iris
|
||||
|
{4766, 0xa900}, // iron
|
||||
|
{4836, 0x8400}, // item
|
||||
|
{4874, 0x1d00}, // gush
|
||||
|
{4878, 0x1900}, // guru
|
||||
|
{4887, 0x5300}, // huts
|
||||
|
{4976, 0x2a00}, // gyro
|
||||
|
{5233, 0x0100}, // jade
|
||||
|
{5262, 0x8100}, // lamb
|
||||
|
{5282, 0x8800}, // lava
|
||||
|
{5299, 0x0f00}, // jazz
|
||||
|
{5299, 0x8e00}, // lazy
|
||||
|
{5323, 0x9200}, // leaf
|
||||
|
{5337, 0x5400}, // keep
|
||||
|
{5347, 0x9300}, // legs
|
||||
|
{5366, 0x5600}, // keno
|
||||
|
{5378, 0x5000}, // kept
|
||||
|
{5397, 0x5b00}, // keys
|
||||
|
{5425, 0x6900}, // kick
|
||||
|
{5427, 0xa200}, // liar
|
||||
|
{5456, 0x6900}, // kiln
|
||||
|
{5464, 0x6400}, // king
|
||||
|
{5466, 0xa900}, // lion
|
||||
|
{5467, 0xa000}, // limp
|
||||
|
{5478, 0xac00}, // list
|
||||
|
{5483, 0x6100}, // kite
|
||||
|
{5494, 0x6200}, // kiwi
|
||||
|
{5646, 0x2900}, // join
|
||||
|
{5646, 0xa200}, // logo
|
||||
|
{5658, 0x2800}, // jolt
|
||||
|
{5662, 0x5900}, // knob
|
||||
|
{5683, 0xa400}, // loud
|
||||
|
{5683, 0xa900}, // love
|
||||
|
{5695, 0x2200}, // jowl
|
||||
|
{5825, 0x9900}, // luck
|
||||
|
{5828, 0x9100}, // luau
|
||||
|
{5836, 0x1200}, // judo
|
||||
|
{5847, 0x1300}, // jugs
|
||||
|
{5864, 0x9400}, // lung
|
||||
|
{5865, 0x1500}, // junk
|
||||
|
{5867, 0x1000}, // jump
|
||||
|
{5879, 0x1a00}, // jury
|
||||
|
{6239, 0x9600}, // obey
|
||||
|
{6245, 0x4a00}, // nail
|
||||
|
{6246, 0x0900}, // main
|
||||
|
{6263, 0x9900}, // oboe
|
||||
|
{6269, 0x0600}, // many
|
||||
|
{6284, 0x0100}, // math
|
||||
|
{6289, 0x4a00}, // navy
|
||||
|
{6293, 0x0d00}, // maze
|
||||
|
{6333, 0x5400}, // need
|
||||
|
{6366, 0x1200}, // memo
|
||||
|
{6368, 0x1500}, // menu
|
||||
|
{6369, 0x1800}, // meow
|
||||
|
{6397, 0x5300}, // news
|
||||
|
{6398, 0x5400}, // next
|
||||
|
{6453, 0x2800}, // mild
|
||||
|
{6468, 0x2400}, // mint
|
||||
|
{6477, 0x2f00}, // miss
|
||||
|
{6648, 0x8800}, // omit
|
||||
|
{6665, 0x2500}, // monk
|
||||
|
{6666, 0x6900}, // noon
|
||||
|
{6683, 0x6100}, // note
|
||||
|
{6699, 0x9900}, // onyx
|
||||
|
{6736, 0x8500}, // open
|
||||
|
{6825, 0xa200}, // oval
|
||||
|
{6862, 0x5100}, // numb
|
||||
|
{6957, 0x8b00}, // owls
|
||||
|
{7223, 0x8900}, // race
|
||||
|
{7227, 0xe200}, // scar
|
||||
|
{7233, 0xc900}, // safe
|
||||
|
{7242, 0xc000}, // saga
|
||||
|
{7243, 0x0800}, // paid
|
||||
|
{7267, 0x8000}, // ramp
|
||||
|
{7278, 0x0800}, // part
|
||||
|
{7325, 0x1900}, // peck
|
||||
|
{7325, 0x9200}, // real
|
||||
|
{7336, 0x9200}, // redo
|
||||
|
{7387, 0xd300}, // sets
|
||||
|
{7424, 0xa900}, // rich
|
||||
|
{7455, 0xe900}, // silk
|
||||
|
{7529, 0x2200}, // play
|
||||
|
{7539, 0xd400}, // skew
|
||||
|
{7568, 0xe800}, // slot
|
||||
|
{7587, 0x2700}, // plus
|
||||
|
{7623, 0xa000}, // road
|
||||
|
{7625, 0xa900}, // rock
|
||||
|
{7627, 0xe000}, // soap
|
||||
|
{7636, 0x2400}, // poem
|
||||
|
{7656, 0xea00}, // solo
|
||||
|
{7663, 0xaa00}, // roof
|
||||
|
{7664, 0xe400}, // song
|
||||
|
{7665, 0x2a00}, // pool
|
||||
|
{7673, 0x2d00}, // pose
|
||||
|
{7823, 0x5000}, // quad
|
||||
|
{7829, 0x9600}, // ruby
|
||||
|
{7833, 0x1a00}, // puff
|
||||
|
{7846, 0x9900}, // ruin
|
||||
|
{7849, 0x5b00}, // quiz
|
||||
|
{7862, 0x1000}, // puma
|
||||
|
{7867, 0x9700}, // runs
|
||||
|
{7873, 0xda00}, // surf
|
||||
|
{7877, 0x1a00}, // purr
|
||||
|
{7878, 0x9c00}, // rust
|
||||
|
{7882, 0xc500}, // stub
|
||||
|
{7926, 0xc100}, // swan
|
||||
|
{8226, 0x0a00}, // taco
|
||||
|
{8275, 0x0d00}, // task
|
||||
|
{8278, 0x8c00}, // vast
|
||||
|
{8294, 0x0600}, // taxi
|
||||
|
{8368, 0x1400}, // tent
|
||||
|
{8379, 0x9a00}, // very
|
||||
|
{8386, 0x9200}, // veto
|
||||
|
{8423, 0xa500}, // vibe
|
||||
|
{8425, 0xa200}, // vial
|
||||
|
{8433, 0x2400}, // tied
|
||||
|
{8439, 0xa400}, // view
|
||||
|
{8459, 0x4a00}, // ugly
|
||||
|
{8463, 0x2100}, // time
|
||||
|
{8469, 0x2600}, // tiny
|
||||
|
{8472, 0xac00}, // visa
|
||||
|
{8636, 0x5200}, // undo
|
||||
|
{8643, 0xa800}, // void
|
||||
|
{8645, 0x2a00}, // toil
|
||||
|
{8648, 0x5800}, // unit
|
||||
|
{8662, 0x2100}, // tomb
|
||||
|
{8697, 0x2b00}, // toys
|
||||
|
{8697, 0xa300}, // vows
|
||||
|
{8737, 0x7600}, // user
|
||||
|
{8743, 0x6100}, // urge
|
||||
|
{8747, 0x2800}, // trip
|
||||
|
{8862, 0x1400}, // tuna
|
||||
|
{8946, 0x0900}, // twin
|
||||
|
{9255, 0x0a00}, // wall
|
||||
|
{9263, 0x0400}, // wand
|
||||
|
{9265, 0x8500}, // yank
|
||||
|
{9276, 0x0800}, // warm
|
||||
|
{9277, 0x0c00}, // wasp
|
||||
|
{9277, 0xc300}, // zaps
|
||||
|
{9283, 0x0900}, // wave
|
||||
|
{9296, 0x8100}, // yawn
|
||||
|
{9299, 0x0600}, // waxy
|
||||
|
{9327, 0x1700}, // webs
|
||||
|
{9355, 0x9a00}, // yell
|
||||
|
{9376, 0xda00}, // zero
|
||||
|
{9378, 0xdc00}, // zest
|
||||
|
{9428, 0x1000}, // what
|
||||
|
{9436, 0x1500}, // when
|
||||
|
{9449, 0x1b00}, // whiz
|
||||
|
{9462, 0xe600}, // zinc
|
||||
|
{9642, 0xa000}, // yoga
|
||||
|
{9653, 0x2a00}, // wolf
|
||||
|
{9663, 0xe500}, // zone
|
||||
|
{9666, 0xe800}, // zoom
|
||||
|
{9675, 0x2900}, // work
|
||||
|
{9878, 0x9800} // yurt
|
||||
|
}; |
@ -1,4 +0,0 @@ |
|||||
--- |
|
||||
BreakBeforeBraces: Allman |
|
||||
|
|
||||
... |
|
@ -0,0 +1,187 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc.
|
||||
|
// <hello@foundationdevices.com> SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
// display.c - Display rendering functions for the Passport bootloader
|
||||
|
#include <string.h> |
||||
|
|
||||
|
#include "display.h" |
||||
|
#include "keypad-adp-5587.h" |
||||
|
#include "gpio.h" |
||||
|
|
||||
|
static uint8_t disp_buf[SCREEN_BYTES_PER_LINE * SCREEN_HEIGHT]; |
||||
|
|
||||
|
static uint8_t get_image_pixel(int16_t x, int16_t y, uint16_t w, uint16_t h, uint8_t* image, uint8_t default_color) |
||||
|
{ |
||||
|
if (x < 0 || x >= w || y < 0 || y >= h) { |
||||
|
return default_color; |
||||
|
} |
||||
|
|
||||
|
uint16_t w_bytes = (w + 7) / 8; |
||||
|
uint16_t offset = (y * w_bytes) + x / 8; |
||||
|
uint8_t bit = 1 << (7 - x % 8); |
||||
|
|
||||
|
return ((image[offset] & bit) == 0) ? 0 : 1; |
||||
|
} |
||||
|
|
||||
|
static void set_pixel(int16_t x, int16_t y, uint8_t c) |
||||
|
{ |
||||
|
if (x < 0 || x >= SCREEN_WIDTH || y < 0 || y >= SCREEN_HEIGHT) { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
uint16_t offset = (y * SCREEN_BYTES_PER_LINE) + x / 8; |
||||
|
uint8_t bit = 1 << (7 - x % 8); |
||||
|
if (c == 1) { |
||||
|
disp_buf[offset] |= bit; |
||||
|
} else { |
||||
|
disp_buf[offset] &= ~bit; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
uint16_t display_measure_text(char* text, Font* font) |
||||
|
{ |
||||
|
uint16_t width = 0; |
||||
|
uint16_t slen = strlen(text); |
||||
|
for (int i=0; i<slen; i++){ |
||||
|
GlyphInfo glyphInfo; |
||||
|
glyph_lookup(font, text[i], &glyphInfo); |
||||
|
width += glyphInfo.advance; |
||||
|
} |
||||
|
return width; |
||||
|
} |
||||
|
|
||||
|
void display_fill_rect(int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color) |
||||
|
{ |
||||
|
for (int dy = y; dy < y + h; dy++) { |
||||
|
for (int dx = x; dx < x + w; dx++) { |
||||
|
set_pixel(dx, dy, color); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
void display_text(char* text, int16_t x, int16_t y, Font* font, bool invert) |
||||
|
{ |
||||
|
if (x == CENTER_X) { |
||||
|
uint16_t text_width = display_measure_text(text, font); |
||||
|
x = SCREEN_WIDTH/2 - text_width/2; |
||||
|
} |
||||
|
|
||||
|
uint16_t slen = strlen(text); |
||||
|
for (int i=0; i<slen; i++) { |
||||
|
GlyphInfo glyphInfo; |
||||
|
glyph_lookup(font, text[i], &glyphInfo); |
||||
|
|
||||
|
// y + font.ascent - fn.h - fn.y
|
||||
|
display_image(x + glyphInfo.x, y + font->ascent - glyphInfo.h - glyphInfo.y, glyphInfo.w, glyphInfo.h, glyphInfo.bitmap, |
||||
|
invert ? DRAW_MODE_WHITE_ONLY | DRAW_MODE_INVERT : DRAW_MODE_WHITE_ONLY); |
||||
|
x += glyphInfo.advance; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
uint16_t display_get_char_width(char ch, Font* font) |
||||
|
{ |
||||
|
GlyphInfo glyphInfo; |
||||
|
glyph_lookup(font, ch, &glyphInfo); |
||||
|
return glyphInfo.advance; |
||||
|
} |
||||
|
|
||||
|
void display_rect(int16_t x, int16_t y, int16_t w, int16_t h, u_int8_t color) |
||||
|
{ |
||||
|
// Draw the top and bottom
|
||||
|
int16_t y_bottom = y + h - 1; |
||||
|
for (int dx = x; dx < x + w; dx++) { |
||||
|
set_pixel(dx, y, color); |
||||
|
set_pixel(dx, y_bottom, color); |
||||
|
} |
||||
|
|
||||
|
// Draw the sides - repeats the top and bottom pixels to avoid special case
|
||||
|
// code for short rectangles
|
||||
|
int16_t x_right = x + w - 1; |
||||
|
for (int dy = y; dy < y + w; dy++) { |
||||
|
set_pixel(x, dy, color); |
||||
|
set_pixel(x_right, dy, color); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// Very simple and inefficient image drawing, but should be fast enough for our
|
||||
|
// limited use.
|
||||
|
void display_image(uint16_t x, uint16_t y, uint16_t image_w, uint16_t image_h, uint8_t* image, uint8_t mode) |
||||
|
{ |
||||
|
// Iterate over the image bounds
|
||||
|
for (int dy = 0; dy < image_h; dy++) { |
||||
|
for (int dx = 0; dx < image_w; dx++) { |
||||
|
uint8_t color = get_image_pixel(dx, dy, image_w, image_h, image, 0); |
||||
|
if (((mode & DRAW_MODE_BLACK_ONLY) && color == 1) || ((mode & DRAW_MODE_WHITE_ONLY) && color == 0)) { |
||||
|
// Skip this pixel if we are not supposed to draw it
|
||||
|
continue; |
||||
|
} |
||||
|
if (mode & DRAW_MODE_INVERT) { |
||||
|
color = !color; |
||||
|
} |
||||
|
|
||||
|
set_pixel(x + dx, y + dy, color); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// Assumes it's the only thing on these lines, so it does not retain any other
|
||||
|
// image that might have been rendered there.
|
||||
|
void display_progress_bar(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t percent) |
||||
|
{ |
||||
|
// Clear whole line first
|
||||
|
display_fill_rect(0, y, SCREEN_WIDTH-1, h, 0); |
||||
|
|
||||
|
display_fill_rect(x, y, w, h, 1); |
||||
|
display_fill_rect(x + 2, y + 2, w - 4, h - 4, 0); |
||||
|
display_fill_rect(x + 3, y + 3, (w * percent) / 100 - 6, h - 6, 1); |
||||
|
} |
||||
|
|
||||
|
void display_show(void) |
||||
|
{ |
||||
|
// Disable IRQs so keypad events don't interrupt display drawing
|
||||
|
__disable_irq(); |
||||
|
lcd_update(disp_buf, true); |
||||
|
__enable_irq(); |
||||
|
|
||||
|
#ifndef DEBUG |
||||
|
// Clear the keypad interrupt so that it will retrigger if it had any events while
|
||||
|
// interrupts were disabled, else it will hang the controller since it's waiting
|
||||
|
// for the previous interrupt to be acknowledged.
|
||||
|
keypad_write(KBD_ADDR, KBD_REG_INT_STAT, 0xFF); |
||||
|
#endif /* DEBUG */ |
||||
|
} |
||||
|
|
||||
|
void display_show_lines(uint16_t y_start, uint16_t y_end) |
||||
|
{ |
||||
|
if (y_start >= SCREEN_HEIGHT) { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (y_end >= SCREEN_HEIGHT) { |
||||
|
y_end = SCREEN_HEIGHT - 1; |
||||
|
} |
||||
|
|
||||
|
for (uint16_t y=y_start; y<=y_end; y++) { |
||||
|
lcd_prebuffer_line(y, &disp_buf[y * SCREEN_BYTES_PER_LINE], true); |
||||
|
} |
||||
|
|
||||
|
lcd_update_line_range(y_start, y_end); |
||||
|
} |
||||
|
|
||||
|
void display_clear(uint8_t color) |
||||
|
{ |
||||
|
memset(disp_buf, color == 0 ? 0x00 : 0xFF, SCREEN_BYTES_PER_LINE * SCREEN_HEIGHT); |
||||
|
} |
||||
|
|
||||
|
void display_init(bool clear) |
||||
|
{ |
||||
|
lcd_init(clear); |
||||
|
} |
||||
|
|
||||
|
// Clear the memory display and then shutdown
|
||||
|
void display_clean_shutdown() |
||||
|
{ |
||||
|
display_clear(0); |
||||
|
display_show(); |
||||
|
passport_shutdown(); |
||||
|
} |
@ -0,0 +1,845 @@ |
|||||
|
// Passport wallet font definitions in C
|
||||
|
// Autogenerated by bdf-to-passport.py: DO NOT EDIT
|
||||
|
#include "passport_fonts.h" |
||||
|
|
||||
|
// Lookup GlyphInfo for a single codepoint or return None
|
||||
|
bool glyph_lookup(Font* font, uint8_t cp, GlyphInfo* glyph_info) { |
||||
|
for (int i=0; i<font->num_codepoint_ranges; i++) { |
||||
|
Codepoints* cp_entry = &font->codepoints[i]; |
||||
|
if (cp < cp_entry->range_start || cp > cp_entry->range_end-1) { |
||||
|
continue; |
||||
|
} |
||||
|
|
||||
|
int offset = cp_entry->bitmap_offsets[cp - cp_entry->range_start]; |
||||
|
|
||||
|
uint8_t bbox_offset = font->bitmaps[offset]; |
||||
|
glyph_info->x = font->bboxes[bbox_offset].x; |
||||
|
glyph_info->y = font->bboxes[bbox_offset].y; |
||||
|
glyph_info->w = font->bboxes[bbox_offset].w; |
||||
|
glyph_info->h = font->bboxes[bbox_offset].h; |
||||
|
glyph_info->advance = font->bboxes[bbox_offset].advance; |
||||
|
|
||||
|
glyph_info->bitmap = font->bitmaps + offset + 1; |
||||
|
|
||||
|
return true; |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
BBox FontTiny_bboxes[] = { |
||||
|
{ 0, 0, 0, 0, 0, 0 }, |
||||
|
{ 0, 0, 1, 1, 4, 1 }, |
||||
|
{ 1, 0, 2, 11, 4, 11 }, |
||||
|
{ 1, 7, 5, 4, 6, 4 }, |
||||
|
{ 0, 0, 10, 10, 11, 20 }, |
||||
|
{ 1, -2, 7, 15, 9, 15 }, |
||||
|
{ 1, 0, 11, 11, 13, 22 }, |
||||
|
{ 1, 0, 9, 11, 11, 22 }, |
||||
|
{ 1, 7, 2, 4, 3, 4 }, |
||||
|
{ 1, -3, 4, 14, 5, 14 }, |
||||
|
{ 0, -3, 4, 14, 5, 14 }, |
||||
|
{ 0, 4, 7, 7, 6, 7 }, |
||||
|
{ 1, 2, 6, 6, 9, 6 }, |
||||
|
{ 1, -2, 2, 5, 4, 5 }, |
||||
|
{ 1, 3, 4, 2, 6, 2 }, |
||||
|
{ 1, 0, 2, 2, 4, 2 }, |
||||
|
{ 0, -1, 7, 14, 6, 14 }, |
||||
|
{ 1, 0, 8, 11, 10, 11 }, |
||||
|
{ 0, 0, 4, 11, 5, 11 }, |
||||
|
{ 0, 0, 8, 11, 9, 11 }, |
||||
|
{ 0, 0, 10, 11, 10, 22 }, |
||||
|
{ 0, 0, 9, 11, 9, 22 }, |
||||
|
{ 1, 0, 2, 8, 4, 8 }, |
||||
|
{ 1, -2, 2, 10, 4, 10 }, |
||||
|
{ 1, 2, 7, 7, 9, 7 }, |
||||
|
{ 1, 2, 7, 6, 9, 6 }, |
||||
|
{ 1, 0, 7, 11, 9, 11 }, |
||||
|
{ 0, -3, 15, 14, 15, 28 }, |
||||
|
{ 2, 0, 8, 11, 10, 11 }, |
||||
|
{ 0, 0, 6, 11, 7, 11 }, |
||||
|
{ 1, 0, 12, 11, 14, 22 }, |
||||
|
{ 1, 0, 11, 11, 12, 22 }, |
||||
|
{ 1, -2, 11, 13, 12, 26 }, |
||||
|
{ 1, 0, 8, 11, 9, 11 }, |
||||
|
{ 0, 0, 11, 11, 11, 22 }, |
||||
|
{ 1, 0, 15, 11, 17, 22 }, |
||||
|
{ -1, -2, 7, 14, 6, 14 }, |
||||
|
{ 0, -1, 7, 1, 7, 1 }, |
||||
|
{ 2, 9, 3, 2, 9, 2 }, |
||||
|
{ 1, 0, 7, 8, 9, 8 }, |
||||
|
{ 1, 0, 9, 11, 10, 22 }, |
||||
|
{ 0, 0, 8, 8, 9, 8 }, |
||||
|
{ 1, 0, 8, 8, 10, 8 }, |
||||
|
{ 0, 0, 6, 11, 6, 11 }, |
||||
|
{ 0, -3, 9, 11, 10, 22 }, |
||||
|
{ -2, -3, 5, 14, 4, 14 }, |
||||
|
{ 1, 0, 14, 8, 15, 16 }, |
||||
|
{ 1, -3, 9, 11, 10, 22 }, |
||||
|
{ 0, -3, 11, 11, 10, 22 }, |
||||
|
{ 1, 0, 6, 8, 8, 8 }, |
||||
|
{ 1, 0, 6, 10, 7, 10 }, |
||||
|
{ 0, 0, 9, 8, 9, 16 }, |
||||
|
{ 0, 0, 13, 8, 14, 16 }, |
||||
|
{ 0, -3, 9, 11, 9, 22 }, |
||||
|
{ 1, -3, 4, 14, 6, 14 }, |
||||
|
{ 1, -3, 2, 14, 5, 14 }, |
||||
|
{ 1, 3, 7, 4, 9, 4 }, |
||||
|
{ 1, 0, 7, 9, 9, 9 }, |
||||
|
{ 1, 5, 5, 6, 6, 6 }, |
||||
|
{ 4, 9, 3, 2, 9, 2 }, |
||||
|
{ 1, -3, 8, 11, 10, 11 }, |
||||
|
{ 2, 2, 5, 6, 9, 6 }, |
||||
|
}; |
||||
|
|
||||
|
uint16_t FontTiny_codepoints_0[] = { 1,3,15,20,41,57,80,103,108,123,138,146,153,159,162,165,180,192,204,216,228,251,263,286,309,321,344,353,364,372,379,387,399,428,451,474,497,520,532,544,567,579,591,603,615,627,650,662,685,697,724,736,748,760,783,806,829,852,875,887,902,917,932,939,941,944,953,976,985,1008,1017,1029,1052,1064,1076,1091,1103,1115,1132,1141,1150,1173,1196,1205,1214,1225,1234,1251,1268,1277,1300,1309,1324,1339,1354, }; |
||||
|
uint16_t FontTiny_codepoints_1[] = { 1359,1369,1376,1383,1386, }; |
||||
|
uint16_t FontTiny_codepoints_2[] = { 1398, }; |
||||
|
|
||||
|
Codepoints FontTiny_codepoints[] = { |
||||
|
{ 32, 127, FontTiny_codepoints_0 }, |
||||
|
{ 177, 182, FontTiny_codepoints_1 }, |
||||
|
{ 215, 216, FontTiny_codepoints_2 }, |
||||
|
}; |
||||
|
|
||||
|
uint8_t FontTiny_bitmaps[] = { |
||||
|
0xAA, // Dummy first entry
|
||||
|
|
||||
|
0x01, // $0020 offset = 1
|
||||
|
0x00, |
||||
|
|
||||
|
0x02, // $0021 offset = 3
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xC0, |
||||
|
|
||||
|
0x03, // $0022 offset = 15
|
||||
|
0xD8,0xD8,0xD8,0xD8, |
||||
|
|
||||
|
0x04, // $0023 offset = 20
|
||||
|
0x19,0x80,0x19,0x80,0x7F,0xC0,0x7F,0xC0,0x33,0x00,0x33,0x00,0xFF,0x80,0xFF,0x80,0x66,0x00,0x66,0x00, |
||||
|
|
||||
|
0x05, // $0024 offset = 41
|
||||
|
0x10,0x10,0x7C,0xFE,0xD2,0xD0,0xF0,0x7C,0x1E,0x16,0x96,0xFE,0x7C,0x10,0x10, |
||||
|
|
||||
|
0x06, // $0025 offset = 57
|
||||
|
0x60,0x80,0x91,0x80,0x93,0x00,0x93,0x00,0x96,0x00,0x64,0xC0,0x0D,0x20,0x19,0x20,0x11,0x20,0x31,0x20,0x60,0xC0, |
||||
|
|
||||
|
0x07, // $0026 offset = 80
|
||||
|
0x3C,0x00,0x7E,0x00,0x66,0x00,0x66,0x00,0x3C,0x00,0x79,0x00,0xCD,0x80,0xCD,0x80,0xC7,0x00,0xFF,0x80,0x7D,0x80, |
||||
|
|
||||
|
0x08, // $0027 offset = 103
|
||||
|
0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x09, // $0028 offset = 108
|
||||
|
0x30,0x60,0x60,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE0,0x60,0x60,0x30, |
||||
|
|
||||
|
0x0a, // $0029 offset = 123
|
||||
|
0xC0,0x60,0x60,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x60,0x60,0xC0, |
||||
|
|
||||
|
0x0b, // $002A offset = 138
|
||||
|
0x10,0x54,0x38,0xFE,0x38,0x54,0x10, |
||||
|
|
||||
|
0x0c, // $002B offset = 146
|
||||
|
0x30,0x30,0xFC,0xFC,0x30,0x30, |
||||
|
|
||||
|
0x0d, // $002C offset = 153
|
||||
|
0xC0,0xC0,0xC0,0x80,0x80, |
||||
|
|
||||
|
0x0e, // $002D offset = 159
|
||||
|
0xF0,0xF0, |
||||
|
|
||||
|
0x0f, // $002E offset = 162
|
||||
|
0xC0,0xC0, |
||||
|
|
||||
|
0x10, // $002F offset = 165
|
||||
|
0x06,0x06,0x0C,0x0C,0x18,0x18,0x18,0x30,0x30,0x30,0x60,0x60,0xC0,0xC0, |
||||
|
|
||||
|
0x11, // $0030 offset = 180
|
||||
|
0x3C,0x7E,0xE7,0xC3,0xC3,0xC3,0xC3,0xC3,0xE7,0x7E,0x3C, |
||||
|
|
||||
|
0x12, // $0031 offset = 192
|
||||
|
0xF0,0xF0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, |
||||
|
|
||||
|
0x13, // $0032 offset = 204
|
||||
|
0x3C,0xFE,0x47,0x03,0x07,0x0E,0x1C,0x38,0x70,0xFF,0xFF, |
||||
|
|
||||
|
0x13, // $0033 offset = 216
|
||||
|
0xFF,0xFF,0x0E,0x0C,0x1C,0x1E,0x07,0x03,0x47,0xFF,0x7C, |
||||
|
|
||||
|
0x14, // $0034 offset = 228
|
||||
|
0x06,0x00,0x0E,0x00,0x0C,0x00,0x18,0x00,0x38,0x00,0x33,0x00,0x73,0x00,0xFF,0xC0,0xFF,0xC0,0x03,0x00,0x03,0x00, |
||||
|
|
||||
|
0x13, // $0035 offset = 251
|
||||
|
0x7F,0x7F,0x60,0x60,0x7C,0x7F,0x07,0x03,0x43,0xFF,0x7C, |
||||
|
|
||||
|
0x15, // $0036 offset = 263
|
||||
|
0x1F,0x00,0x3F,0x00,0x70,0x00,0x60,0x00,0xEE,0x00,0xFF,0x00,0xF3,0x80,0xE1,0x80,0x73,0x80,0x3F,0x00,0x1E,0x00, |
||||
|
|
||||
|
0x15, // $0037 offset = 286
|
||||
|
0xFF,0x80,0xFF,0x80,0xC3,0x00,0x07,0x00,0x06,0x00,0x0E,0x00,0x0E,0x00,0x0C,0x00,0x1C,0x00,0x18,0x00,0x38,0x00, |
||||
|
|
||||
|
0x11, // $0038 offset = 309
|
||||
|
0x3C,0x7E,0xC3,0xC3,0x7E,0x7E,0xC3,0xC3,0xC3,0x7E,0x3C, |
||||
|
|
||||
|
0x15, // $0039 offset = 321
|
||||
|
0x3C,0x00,0x7E,0x00,0xE7,0x00,0xC3,0x00,0xE7,0x80,0x7F,0x80,0x3B,0x80,0x03,0x00,0x07,0x00,0x7E,0x00,0x7C,0x00, |
||||
|
|
||||
|
0x16, // $003A offset = 344
|
||||
|
0xC0,0xC0,0x00,0x00,0x00,0x00,0xC0,0xC0, |
||||
|
|
||||
|
0x17, // $003B offset = 353
|
||||
|
0xC0,0xC0,0x00,0x00,0x00,0xC0,0xC0,0xC0,0x80,0x80, |
||||
|
|
||||
|
0x18, // $003C offset = 364
|
||||
|
0x06,0x1E,0x78,0xC0,0x78,0x1E,0x06, |
||||
|
|
||||
|
0x19, // $003D offset = 372
|
||||
|
0xFE,0xFE,0x00,0x00,0xFE,0xFE, |
||||
|
|
||||
|
0x18, // $003E offset = 379
|
||||
|
0xC0,0xF0,0x3C,0x06,0x3C,0xF0,0xC0, |
||||
|
|
||||
|
0x1a, // $003F offset = 387
|
||||
|
0x78,0xFC,0xC6,0x06,0x0C,0x18,0x30,0x30,0x00,0x30,0x30, |
||||
|
|
||||
|
0x1b, // $0040 offset = 399
|
||||
|
0x0F,0xE0,0x1C,0x70,0x30,0x18,0x63,0x6C,0x67,0xE4,0xCC,0x66,0xCC,0x66,0xCC,0x66,0xCC,0x64,0x6F,0xFC,0x67,0xB8,0x30,0x00,0x1C,0x60,0x0F,0xC0, |
||||
|
|
||||
|
0x07, // $0041 offset = 428
|
||||
|
0x08,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x36,0x00,0x63,0x00,0x63,0x00,0x7F,0x00,0xE3,0x80,0xC1,0x80,0xC1,0x80, |
||||
|
|
||||
|
0x07, // $0042 offset = 451
|
||||
|
0xFE,0x00,0xFF,0x00,0xC3,0x00,0xC3,0x00,0xFE,0x00,0xFF,0x00,0xC3,0x00,0xC3,0x80,0xC3,0x80,0xFF,0x00,0xFE,0x00, |
||||
|
|
||||
|
0x07, // $0043 offset = 474
|
||||
|
0x1F,0x00,0x7F,0x80,0xE1,0x80,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xE1,0x80,0x7F,0x80,0x1F,0x00, |
||||
|
|
||||
|
0x07, // $0044 offset = 497
|
||||
|
0xFC,0x00,0xFF,0x00,0xC3,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC3,0x80,0xFF,0x00,0xFC,0x00, |
||||
|
|
||||
|
0x1a, // $0045 offset = 520
|
||||
|
0xFE,0xFE,0xC0,0xC0,0xFC,0xFC,0xC0,0xC0,0xC0,0xFE,0xFE, |
||||
|
|
||||
|
0x1a, // $0046 offset = 532
|
||||
|
0xFE,0xFE,0xC0,0xC0,0xC0,0xFC,0xFC,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x07, // $0047 offset = 544
|
||||
|
0x1F,0x00,0x7F,0x80,0xE1,0x80,0xC0,0x00,0xC0,0x00,0xC3,0x80,0xC3,0x80,0xC1,0x80,0xE1,0x80,0x7F,0x80,0x1F,0x00, |
||||
|
|
||||
|
0x1c, // $0048 offset = 567
|
||||
|
0xC3,0xC3,0xC3,0xC3,0xFF,0xFF,0xC3,0xC3,0xC3,0xC3,0xC3, |
||||
|
|
||||
|
0x02, // $0049 offset = 579
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x1d, // $004A offset = 591
|
||||
|
0x7C,0x7C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x4C,0xFC,0x78, |
||||
|
|
||||
|
0x11, // $004B offset = 603
|
||||
|
0xC3,0xC7,0xCE,0xDC,0xF0,0xF0,0xF8,0xDC,0xCE,0xC7,0xC3, |
||||
|
|
||||
|
0x1a, // $004C offset = 615
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xFE,0xFE, |
||||
|
|
||||
|
0x1e, // $004D offset = 627
|
||||
|
0xC0,0x30,0xE0,0x70,0xF0,0xF0,0xF0,0xF0,0xF9,0xF0,0xD9,0xB0,0xCF,0x30,0xCF,0x30,0xC6,0x30,0xC6,0x30,0xC0,0x30, |
||||
|
|
||||
|
0x11, // $004E offset = 650
|
||||
|
0xC3,0xC3,0xE3,0xF3,0xFB,0xFB,0xDF,0xCF,0xC7,0xC7,0xC3, |
||||
|
|
||||
|
0x1f, // $004F offset = 662
|
||||
|
0x1F,0x00,0x3F,0x80,0x60,0xC0,0x60,0xC0,0xC0,0x60,0xC0,0x60,0xC0,0x60,0x60,0xC0,0x60,0xC0,0x3F,0x80,0x1F,0x00, |
||||
|
|
||||
|
0x11, // $0050 offset = 685
|
||||
|
0xFC,0xFE,0xC7,0xC3,0xC3,0xC7,0xFE,0xFC,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x20, // $0051 offset = 697
|
||||
|
0x1F,0x00,0x3F,0x80,0x71,0xC0,0x60,0xC0,0xC0,0x60,0xC0,0x60,0xC0,0x60,0x60,0xC0,0x71,0xC0,0x3F,0x80,0x1E,0x00,0x07,0xE0,0x03,0xC0, |
||||
|
|
||||
|
0x11, // $0052 offset = 724
|
||||
|
0xFC,0xFE,0xC7,0xC3,0xC3,0xC7,0xFE,0xFC,0xCE,0xC6,0xC7, |
||||
|
|
||||
|
0x21, // $0053 offset = 736
|
||||
|
0x7C,0xFE,0xC2,0xC0,0xE0,0x7C,0x3E,0x03,0x83,0xFE,0x7C, |
||||
|
|
||||
|
0x11, // $0054 offset = 748
|
||||
|
0xFF,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, |
||||
|
|
||||
|
0x07, // $0055 offset = 760
|
||||
|
0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xE3,0x80,0x7F,0x00,0x3E,0x00, |
||||
|
|
||||
|
0x22, // $0056 offset = 783
|
||||
|
0xC0,0x60,0xC0,0x60,0x60,0xC0,0x60,0xC0,0x31,0x80,0x31,0x80,0x1B,0x00,0x1B,0x00,0x1B,0x00,0x0E,0x00,0x0E,0x00, |
||||
|
|
||||
|
0x23, // $0057 offset = 806
|
||||
|
0xC1,0x06,0xC3,0x86,0xC3,0x86,0xE6,0xCE,0x66,0xCC,0x66,0xCC,0x76,0xDC,0x36,0xD8,0x3C,0x78,0x3C,0x78,0x18,0x30, |
||||
|
|
||||
|
0x14, // $0058 offset = 829
|
||||
|
0xE1,0xC0,0x73,0x80,0x33,0x00,0x1F,0x00,0x1E,0x00,0x0C,0x00,0x1E,0x00,0x3F,0x00,0x33,0x00,0x73,0x80,0xE1,0xC0, |
||||
|
|
||||
|
0x14, // $0059 offset = 852
|
||||
|
0xE1,0xC0,0x61,0x80,0x73,0x80,0x33,0x00,0x3F,0x00,0x1E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00, |
||||
|
|
||||
|
0x11, // $005A offset = 875
|
||||
|
0xFF,0xFF,0x06,0x0E,0x1C,0x18,0x38,0x70,0x60,0xFF,0xFF, |
||||
|
|
||||
|
0x09, // $005B offset = 887
|
||||
|
0xF0,0xF0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xF0,0xF0, |
||||
|
|
||||
|
0x24, // $005C offset = 902
|
||||
|
0xC0,0xC0,0x60,0x60,0x30,0x30,0x30,0x18,0x18,0x18,0x0C,0x0C,0x06,0x06, |
||||
|
|
||||
|
0x0a, // $005D offset = 917
|
||||
|
0xF0,0xF0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xF0,0xF0, |
||||
|
|
||||
|
0x19, // $005E offset = 932
|
||||
|
0x10,0x38,0x6C,0x6C,0xC6,0xC6, |
||||
|
|
||||
|
0x25, // $005F offset = 939
|
||||
|
0xFE, |
||||
|
|
||||
|
0x26, // $0060 offset = 941
|
||||
|
0xC0,0x60, |
||||
|
|
||||
|
0x27, // $0061 offset = 944
|
||||
|
0x7C,0xFE,0x06,0x7E,0xC6,0xC6,0xFE,0x76, |
||||
|
|
||||
|
0x28, // $0062 offset = 953
|
||||
|
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xDE,0x00,0xFF,0x00,0xE3,0x00,0xC1,0x80,0xC1,0x80,0xE3,0x00,0xFF,0x00,0xDE,0x00, |
||||
|
|
||||
|
0x29, // $0063 offset = 976
|
||||
|
0x1E,0x7F,0x62,0xC0,0xC0,0x62,0x7F,0x1E, |
||||
|
|
||||
|
0x28, // $0064 offset = 985
|
||||
|
0x01,0x80,0x01,0x80,0x01,0x80,0x3D,0x80,0x7F,0x80,0x63,0x80,0xC1,0x80,0xC1,0x80,0x63,0x80,0x7F,0x80,0x3D,0x80, |
||||
|
|
||||
|
0x2a, // $0065 offset = 1008
|
||||
|
0x3C,0x7E,0xC3,0xC3,0xFE,0xC0,0x7F,0x3E, |
||||
|
|
||||
|
0x2b, // $0066 offset = 1017
|
||||
|
0x3C,0x7C,0x60,0xFC,0xFC,0x60,0x60,0x60,0x60,0x60,0x60, |
||||
|
|
||||
|
0x2c, // $0067 offset = 1029
|
||||
|
0x3D,0x80,0x7F,0x80,0x63,0x80,0xC1,0x80,0xC1,0x80,0x63,0x80,0x7F,0x80,0x1D,0x80,0x01,0x80,0x7F,0x00,0x3E,0x00, |
||||
|
|
||||
|
0x11, // $0068 offset = 1052
|
||||
|
0xC0,0xC0,0xC0,0xDC,0xFE,0xE7,0xC3,0xC3,0xC3,0xC3,0xC3, |
||||
|
|
||||
|
0x02, // $0069 offset = 1064
|
||||
|
0xC0,0xC0,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x2d, // $006A offset = 1076
|
||||
|
0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x98,0xF8,0x70, |
||||
|
|
||||
|
0x11, // $006B offset = 1091
|
||||
|
0xC0,0xC0,0xC0,0xC7,0xCE,0xDC,0xF8,0xFC,0xEE,0xC6,0xC7, |
||||
|
|
||||
|
0x02, // $006C offset = 1103
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x2e, // $006D offset = 1115
|
||||
|
0xDC,0xF0,0xFF,0xF8,0xE7,0x9C,0xC3,0x0C,0xC3,0x0C,0xC3,0x0C,0xC3,0x0C,0xC3,0x0C, |
||||
|
|
||||
|
0x2a, // $006E offset = 1132
|
||||
|
0xDE,0xFF,0xE7,0xC3,0xC3,0xC3,0xC3,0xC3, |
||||
|
|
||||
|
0x2a, // $006F offset = 1141
|
||||
|
0x3C,0x7E,0xE7,0xC3,0xC3,0xE7,0x7E,0x3C, |
||||
|
|
||||
|
0x2f, // $0070 offset = 1150
|
||||
|
0xDE,0x00,0xFF,0x00,0xE3,0x00,0xC1,0x80,0xC1,0x80,0xE3,0x00,0xFF,0x00,0xDE,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, |
||||
|
|
||||
|
0x30, // $0071 offset = 1173
|
||||
|
0x3D,0x80,0x7F,0x80,0x63,0x80,0xC1,0x80,0xC1,0x80,0x63,0x80,0x7F,0x80,0x3D,0x80,0x01,0x80,0x01,0xE0,0x01,0xC0, |
||||
|
|
||||
|
0x31, // $0072 offset = 1196
|
||||
|
0xD8,0xFC,0xE4,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x31, // $0073 offset = 1205
|
||||
|
0x7C,0xFC,0xC0,0xF0,0x7C,0x0C,0xFC,0xF8, |
||||
|
|
||||
|
0x32, // $0074 offset = 1214
|
||||
|
0x30,0x30,0xFC,0xFC,0x30,0x30,0x30,0x30,0x3C,0x1C, |
||||
|
|
||||
|
0x2a, // $0075 offset = 1225
|
||||
|
0xC3,0xC3,0xC3,0xC3,0xC3,0xE7,0xFF,0x7B, |
||||
|
|
||||
|
0x33, // $0076 offset = 1234
|
||||
|
0xC1,0x80,0xE3,0x80,0x63,0x00,0x77,0x00,0x36,0x00,0x3E,0x00,0x1C,0x00,0x1C,0x00, |
||||
|
|
||||
|
0x34, // $0077 offset = 1251
|
||||
|
0xC2,0x18,0xC7,0x18,0xC7,0x18,0x67,0x30,0x6D,0xB0,0x3D,0xE0,0x3D,0xE0,0x18,0xC0, |
||||
|
|
||||
|
0x27, // $0078 offset = 1268
|
||||
|
0xC6,0x6C,0x7C,0x38,0x38,0x7C,0x6C,0xC6, |
||||
|
|
||||
|
0x35, // $0079 offset = 1277
|
||||
|
0xC1,0x80,0xE3,0x00,0x63,0x00,0x76,0x00,0x36,0x00,0x3E,0x00,0x1C,0x00,0x1C,0x00,0x18,0x00,0xF8,0x00,0xF0,0x00, |
||||
|
|
||||
|
0x31, // $007A offset = 1300
|
||||
|
0xFC,0xFC,0x18,0x38,0x70,0xE0,0xFC,0xFC, |
||||
|
|
||||
|
0x36, // $007B offset = 1309
|
||||
|
0x30,0x70,0x60,0x60,0x60,0x60,0xC0,0xC0,0x60,0x60,0x60,0x60,0x70,0x30, |
||||
|
|
||||
|
0x37, // $007C offset = 1324
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x36, // $007D offset = 1339
|
||||
|
0xC0,0xE0,0x60,0x60,0x60,0x60,0x30,0x30,0x60,0x60,0x60,0x60,0xE0,0xC0, |
||||
|
|
||||
|
0x38, // $007E offset = 1354
|
||||
|
0x60,0xF2,0x9E,0x0C, |
||||
|
|
||||
|
0x39, // $00B1 offset = 1359
|
||||
|
0x30,0x30,0xFE,0xFE,0x30,0x30,0x00,0xFE,0xFE, |
||||
|
|
||||
|
0x3a, // $00B2 offset = 1369
|
||||
|
0xF0,0x90,0x10,0x30,0xC0,0xF8, |
||||
|
|
||||
|
0x3a, // $00B3 offset = 1376
|
||||
|
0xF0,0x30,0x70,0x18,0x98,0xF0, |
||||
|
|
||||
|
0x3b, // $00B4 offset = 1383
|
||||
|
0x60,0xC0, |
||||
|
|
||||
|
0x3c, // $00B5 offset = 1386
|
||||
|
0xC3,0xC3,0xC3,0xC3,0xC3,0xE7,0xFF,0xFB,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x3d, // $00D7 offset = 1398
|
||||
|
0x88,0xD8,0x70,0x70,0xD8,0x88, |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
Font FontTiny = { |
||||
|
14, |
||||
|
8, |
||||
|
14, |
||||
|
3, |
||||
|
21, |
||||
|
32, |
||||
|
216, |
||||
|
3, |
||||
|
FontTiny_bboxes, |
||||
|
FontTiny_codepoints, |
||||
|
FontTiny_bitmaps, |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
BBox FontSmall_bboxes[] = { |
||||
|
{ 0, 0, 0, 0, 0, 0 }, |
||||
|
{ 0, 0, 0, 0, 5, 0 }, |
||||
|
{ 0, 0, 6, 13, 20, 13 }, |
||||
|
{ 1, 8, 6, 5, 7, 5 }, |
||||
|
{ 0, 0, 13, 13, 13, 26 }, |
||||
|
{ 1, -2, 10, 17, 12, 34 }, |
||||
|
{ 1, 0, 14, 13, 16, 26 }, |
||||
|
{ 1, 0, 11, 13, 13, 26 }, |
||||
|
{ 1, 8, 2, 5, 4, 5 }, |
||||
|
{ 2, -4, 3, 18, 6, 18 }, |
||||
|
{ 1, -4, 3, 18, 6, 18 }, |
||||
|
{ 1, 8, 5, 6, 8, 6 }, |
||||
|
{ 1, 2, 9, 9, 11, 18 }, |
||||
|
{ 1, -3, 2, 5, 4, 5 }, |
||||
|
{ 1, 4, 5, 2, 7, 2 }, |
||||
|
{ 1, 0, 2, 2, 4, 2 }, |
||||
|
{ 0, -2, 8, 18, 7, 18 }, |
||||
|
{ 1, 0, 10, 13, 13, 26 }, |
||||
|
{ 0, 0, 5, 13, 7, 13 }, |
||||
|
{ 1, 0, 9, 13, 11, 26 }, |
||||
|
{ 0, 0, 10, 13, 11, 26 }, |
||||
|
{ 1, 0, 10, 13, 12, 26 }, |
||||
|
{ 0, 0, 11, 13, 12, 26 }, |
||||
|
{ 1, 0, 2, 10, 4, 10 }, |
||||
|
{ 1, -3, 2, 13, 4, 13 }, |
||||
|
{ 1, 3, 9, 8, 11, 16 }, |
||||
|
{ 1, 4, 9, 5, 11, 10 }, |
||||
|
{ 1, -4, 17, 17, 19, 51 }, |
||||
|
{ 0, 0, 14, 13, 14, 26 }, |
||||
|
{ 2, 0, 11, 13, 14, 26 }, |
||||
|
{ 1, 0, 11, 13, 14, 26 }, |
||||
|
{ 2, 0, 13, 13, 15, 26 }, |
||||
|
{ 2, 0, 9, 13, 13, 26 }, |
||||
|
{ 2, 0, 9, 13, 12, 26 }, |
||||
|
{ 1, 0, 12, 13, 14, 26 }, |
||||
|
{ 2, 0, 11, 13, 15, 26 }, |
||||
|
{ 2, 0, 2, 13, 6, 13 }, |
||||
|
{ -1, 0, 9, 13, 10, 26 }, |
||||
|
{ 2, 0, 11, 13, 13, 26 }, |
||||
|
{ 2, 0, 9, 13, 11, 26 }, |
||||
|
{ 2, 0, 14, 13, 18, 26 }, |
||||
|
{ 1, -2, 14, 15, 16, 30 }, |
||||
|
{ 1, 0, 10, 13, 11, 26 }, |
||||
|
{ 1, 0, 19, 13, 21, 39 }, |
||||
|
{ 0, 0, 12, 13, 12, 26 }, |
||||
|
{ 1, 0, 11, 13, 12, 26 }, |
||||
|
{ 2, -4, 4, 18, 6, 18 }, |
||||
|
{ -1, -2, 8, 18, 7, 18 }, |
||||
|
{ 0, -4, 4, 18, 6, 18 }, |
||||
|
{ 2, 3, 7, 8, 11, 8 }, |
||||
|
{ 0, -1, 9, 1, 9, 2 }, |
||||
|
{ 3, 12, 4, 2, 11, 2 }, |
||||
|
{ 1, 0, 9, 10, 11, 20 }, |
||||
|
{ 2, 0, 10, 14, 13, 28 }, |
||||
|
{ 1, 0, 10, 14, 13, 28 }, |
||||
|
{ 1, 0, 10, 10, 11, 20 }, |
||||
|
{ 0, 0, 8, 14, 7, 14 }, |
||||
|
{ 1, -4, 10, 14, 13, 28 }, |
||||
|
{ 2, 0, 9, 14, 13, 28 }, |
||||
|
{ 2, 0, 2, 14, 5, 14 }, |
||||
|
{ -3, -4, 7, 18, 5, 18 }, |
||||
|
{ 2, 0, 9, 14, 12, 28 }, |
||||
|
{ 2, 0, 16, 10, 20, 20 }, |
||||
|
{ 2, 0, 9, 10, 13, 20 }, |
||||
|
{ 1, 0, 10, 10, 12, 20 }, |
||||
|
{ 2, -4, 10, 14, 13, 28 }, |
||||
|
{ 1, -4, 13, 14, 13, 28 }, |
||||
|
{ 2, 0, 6, 10, 8, 10 }, |
||||
|
{ 1, 0, 8, 10, 9, 10 }, |
||||
|
{ 0, 0, 7, 12, 8, 12 }, |
||||
|
{ 0, 0, 11, 10, 10, 20 }, |
||||
|
{ 0, 0, 17, 10, 17, 30 }, |
||||
|
{ 1, 0, 9, 10, 10, 20 }, |
||||
|
{ 0, -4, 11, 14, 10, 28 }, |
||||
|
{ 1, 0, 8, 10, 10, 10 }, |
||||
|
{ 1, -4, 6, 18, 7, 18 }, |
||||
|
{ 2, -4, 2, 18, 6, 18 }, |
||||
|
{ 0, -4, 6, 18, 7, 18 }, |
||||
|
{ 1, 5, 9, 3, 11, 6 }, |
||||
|
{ 1, 0, 9, 12, 11, 24 }, |
||||
|
{ 1, 6, 6, 8, 8, 8 }, |
||||
|
{ 5, 12, 3, 2, 11, 2 }, |
||||
|
{ 2, -4, 9, 14, 13, 28 }, |
||||
|
{ 2, 3, 7, 7, 11, 7 }, |
||||
|
}; |
||||
|
|
||||
|
uint16_t FontSmall_codepoints_0[] = { 1,2,16,22,49,84,111,138,144,163,182,189,208,214,217,220,239,266,280,307,334,361,388,415,442,469,496,507,521,538,549,566,593,645,672,699,726,753,780,807,834,861,875,902,929,956,983,1010,1037,1064,1095,1122,1149,1176,1203,1230,1270,1297,1324,1351,1370,1389,1408,1417,1420,1423,1444,1473,1494,1523,1544,1559,1588,1617,1632,1651,1680,1695,1716,1737,1758,1787,1816,1827,1838,1851,1872,1893,1924,1945,1974,1985,2004,2023,2042, }; |
||||
|
uint16_t FontSmall_codepoints_1[] = { 2049,2074,2083,2092,2095, }; |
||||
|
uint16_t FontSmall_codepoints_2[] = { 2124, }; |
||||
|
|
||||
|
Codepoints FontSmall_codepoints[] = { |
||||
|
{ 32, 127, FontSmall_codepoints_0 }, |
||||
|
{ 177, 182, FontSmall_codepoints_1 }, |
||||
|
{ 215, 216, FontSmall_codepoints_2 }, |
||||
|
}; |
||||
|
|
||||
|
uint8_t FontSmall_bitmaps[] = { |
||||
|
0xAA, // Dummy first entry
|
||||
|
|
||||
|
0x01, // $0020 offset = 1
|
||||
|
|
||||
|
|
||||
|
0x02, // $0021 offset = 2
|
||||
|
0xFC,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x30,0x30, |
||||
|
|
||||
|
0x03, // $0022 offset = 16
|
||||
|
0xCC,0xCC,0xCC,0xCC,0xCC, |
||||
|
|
||||
|
0x04, // $0023 offset = 22
|
||||
|
0x0C,0x60,0x0C,0x60,0x0C,0x60,0x0C,0x60,0xFF,0xF8,0x18,0xC0,0x18,0xC0,0x18,0xC0,0xFF,0xF0,0x31,0x80,0x31,0x80,0x31,0x80,0x31,0x80, |
||||
|
|
||||
|
0x05, // $0024 offset = 49
|
||||
|
0x0C,0x00,0x0C,0x00,0x3F,0x00,0x7F,0x80,0xCC,0x80,0xCC,0x00,0xCC,0x00,0x7C,0x00,0x3F,0x00,0x0F,0x80,0x0C,0xC0,0x0C,0xC0,0x8C,0xC0,0xFF,0x80,0x7F,0x00,0x0C,0x00,0x0C,0x00, |
||||
|
|
||||
|
0x06, // $0025 offset = 84
|
||||
|
0x78,0x30,0xCC,0x20,0x84,0x40,0x84,0xC0,0x84,0x80,0xCD,0x00,0x7B,0x78,0x06,0xCC,0x04,0x84,0x0C,0x84,0x18,0x84,0x10,0xCC,0x20,0x78, |
||||
|
|
||||
|
0x07, // $0026 offset = 111
|
||||
|
0x1E,0x00,0x33,0x00,0x61,0x00,0x63,0x00,0x33,0x00,0x1C,0x00,0x3C,0x00,0x66,0x20,0xC3,0x60,0xC1,0xC0,0xC0,0xC0,0x7F,0xE0,0x3E,0x20, |
||||
|
|
||||
|
0x08, // $0027 offset = 138
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x09, // $0028 offset = 144
|
||||
|
0x20,0x60,0x60,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x60,0x60,0x20, |
||||
|
|
||||
|
0x0a, // $0029 offset = 163
|
||||
|
0x80,0xC0,0xC0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xC0,0xC0,0x80, |
||||
|
|
||||
|
0x0b, // $002A offset = 182
|
||||
|
0x20,0xA8,0x70,0x70,0xA8,0x20, |
||||
|
|
||||
|
0x0c, // $002B offset = 189
|
||||
|
0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xFF,0x80,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00, |
||||
|
|
||||
|
0x0d, // $002C offset = 208
|
||||
|
0xC0,0xC0,0x40,0xC0,0x80, |
||||
|
|
||||
|
0x0e, // $002D offset = 214
|
||||
|
0xF8,0xF8, |
||||
|
|
||||
|
0x0f, // $002E offset = 217
|
||||
|
0xC0,0xC0, |
||||
|
|
||||
|
0x10, // $002F offset = 220
|
||||
|
0x03,0x03,0x06,0x06,0x06,0x0C,0x0C,0x0C,0x18,0x18,0x18,0x30,0x30,0x60,0x60,0x60,0xC0,0xC0, |
||||
|
|
||||
|
0x11, // $0030 offset = 239
|
||||
|
0x3F,0x00,0x7F,0x80,0xE1,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE1,0xC0,0x7F,0x80,0x3F,0x00, |
||||
|
|
||||
|
0x12, // $0031 offset = 266
|
||||
|
0xF8,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, |
||||
|
|
||||
|
0x13, // $0032 offset = 280
|
||||
|
0x7E,0x00,0xFF,0x00,0xC3,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x60,0x00,0xFF,0x80,0xFF,0x80, |
||||
|
|
||||
|
0x14, // $0033 offset = 307
|
||||
|
0x7F,0x80,0x7F,0x80,0x03,0x00,0x07,0x00,0x06,0x00,0x0C,0x00,0x0F,0x80,0x01,0x80,0x00,0xC0,0x00,0xC0,0xC1,0xC0,0xFF,0x80,0x3F,0x00, |
||||
|
|
||||
|
0x07, // $0034 offset = 334
|
||||
|
0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x61,0x80,0x61,0x80,0xFF,0xE0,0xFF,0xE0,0x01,0x80,0x01,0x80,0x01,0x80, |
||||
|
|
||||
|
0x14, // $0035 offset = 361
|
||||
|
0x3F,0x80,0x3F,0x80,0x30,0x00,0x60,0x00,0x60,0x00,0x7F,0x00,0x7F,0x80,0x00,0xC0,0x00,0xC0,0x00,0xC0,0xC0,0xC0,0xFF,0x80,0x3F,0x00, |
||||
|
|
||||
|
0x15, // $0036 offset = 388
|
||||
|
0x1F,0x80,0x3F,0x80,0x60,0x00,0x40,0x00,0xC0,0x00,0xDF,0x00,0xFF,0x80,0xE1,0xC0,0xC0,0xC0,0xC0,0xC0,0xE1,0xC0,0x7F,0x80,0x1F,0x00, |
||||
|
|
||||
|
0x13, // $0037 offset = 415
|
||||
|
0xFF,0x80,0xFF,0x80,0x81,0x80,0x81,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x30,0x00, |
||||
|
|
||||
|
0x15, // $0038 offset = 442
|
||||
|
0x3F,0x00,0x7F,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x61,0x80,0x7F,0x80,0xE1,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x7F,0x80,0x3F,0x00, |
||||
|
|
||||
|
0x16, // $0039 offset = 469
|
||||
|
0x1F,0x00,0x7F,0x80,0xE1,0xC0,0xC0,0xC0,0xC0,0xC0,0xE1,0xE0,0x7F,0xE0,0x1E,0x60,0x00,0x60,0x00,0xC0,0x01,0xC0,0x3F,0x80,0x3E,0x00, |
||||
|
|
||||
|
0x17, // $003A offset = 496
|
||||
|
0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0, |
||||
|
|
||||
|
0x18, // $003B offset = 507
|
||||
|
0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x40,0xC0,0x80, |
||||
|
|
||||
|
0x19, // $003C offset = 521
|
||||
|
0x01,0x80,0x0F,0x00,0x3C,0x00,0xE0,0x00,0xE0,0x00,0x3C,0x00,0x0F,0x00,0x01,0x80, |
||||
|
|
||||
|
0x1a, // $003D offset = 538
|
||||
|
0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80, |
||||
|
|
||||
|
0x19, // $003E offset = 549
|
||||
|
0xC0,0x00,0x78,0x00,0x1E,0x00,0x03,0x80,0x03,0x80,0x1E,0x00,0x78,0x00,0xC0,0x00, |
||||
|
|
||||
|
0x13, // $003F offset = 566
|
||||
|
0x7E,0x00,0xFF,0x00,0xC3,0x80,0x01,0x80,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x18,0x00,0x18,0x00, |
||||
|
|
||||
|
0x1b, // $0040 offset = 593
|
||||
|
0x07,0xF0,0x00,0x1C,0x1C,0x00,0x30,0x06,0x00,0x60,0x03,0x00,0x43,0xE9,0x80,0xC6,0x38,0x80,0x8C,0x18,0x80,0x88,0x08,0x80,0x88,0x08,0x80,0x88,0x08,0x80,0x8C,0x18,0x80,0xC6,0x3D,0x80,0x43,0xE7,0x00,0x60,0x00,0x00,0x30,0x00,0x00,0x1C,0x18,0x00,0x07,0xF0,0x00, |
||||
|
|
||||
|
0x1c, // $0041 offset = 645
|
||||
|
0x03,0x00,0x03,0x00,0x07,0x80,0x04,0x80,0x0C,0xC0,0x08,0x40,0x18,0x60,0x18,0x60,0x30,0x30,0x3F,0xF0,0x60,0x18,0x60,0x18,0xC0,0x0C, |
||||
|
|
||||
|
0x1d, // $0042 offset = 672
|
||||
|
0xFF,0x80,0xFF,0xC0,0xC0,0xC0,0xC0,0x60,0xC0,0xC0,0xFF,0x80,0xFF,0xC0,0xC0,0xE0,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xFF,0xE0,0xFF,0x80, |
||||
|
|
||||
|
0x1e, // $0043 offset = 699
|
||||
|
0x0F,0xC0,0x3F,0xE0,0x70,0x20,0x60,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0x60,0x00,0x70,0x20,0x3F,0xE0,0x0F,0xC0, |
||||
|
|
||||
|
0x1f, // $0044 offset = 726
|
||||
|
0xFF,0x00,0xFF,0xC0,0xC0,0xE0,0xC0,0x30,0xC0,0x30,0xC0,0x18,0xC0,0x18,0xC0,0x18,0xC0,0x30,0xC0,0x30,0xC0,0xE0,0xFF,0xC0,0xFF,0x00, |
||||
|
|
||||
|
0x20, // $0045 offset = 753
|
||||
|
0xFF,0x80,0xFF,0x80,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xFF,0x00,0xFF,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xFF,0x80,0xFF,0x80, |
||||
|
|
||||
|
0x21, // $0046 offset = 780
|
||||
|
0xFF,0x80,0xFF,0x80,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xFF,0x00,0xFF,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, |
||||
|
|
||||
|
0x22, // $0047 offset = 807
|
||||
|
0x0F,0xC0,0x3F,0xF0,0x70,0x20,0x60,0x00,0xC0,0x00,0xC0,0x00,0xC0,0xF0,0xC0,0xF0,0xC0,0x30,0x60,0x30,0x70,0x30,0x3F,0xF0,0x0F,0xC0, |
||||
|
|
||||
|
0x23, // $0048 offset = 834
|
||||
|
0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xFF,0xE0,0xFF,0xE0,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60, |
||||
|
|
||||
|
0x24, // $0049 offset = 861
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x25, // $004A offset = 875
|
||||
|
0x3F,0x80,0x3F,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0xC1,0x80,0x7F,0x00,0x3E,0x00, |
||||
|
|
||||
|
0x26, // $004B offset = 902
|
||||
|
0xC0,0x60,0xC0,0xC0,0xC1,0x80,0xC3,0x00,0xC6,0x00,0xCC,0x00,0xD8,0x00,0xFC,0x00,0xE6,0x00,0xC3,0x00,0xC1,0x80,0xC0,0xC0,0xC0,0x60, |
||||
|
|
||||
|
0x27, // $004C offset = 929
|
||||
|
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xFF,0x80,0xFF,0x80, |
||||
|
|
||||
|
0x28, // $004D offset = 956
|
||||
|
0xC0,0x0C,0xC0,0x0C,0xE0,0x1C,0xF0,0x3C,0xF0,0x3C,0xD8,0x6C,0xC8,0x4C,0xCC,0xCC,0xC7,0x8C,0xC7,0x8C,0xC3,0x0C,0xC0,0x0C,0xC0,0x0C, |
||||
|
|
||||
|
0x23, // $004E offset = 983
|
||||
|
0xC0,0x60,0xE0,0x60,0xF0,0x60,0xF0,0x60,0xD8,0x60,0xCC,0x60,0xCE,0x60,0xC7,0x60,0xC3,0x60,0xC1,0xE0,0xC0,0xE0,0xC0,0xE0,0xC0,0x60, |
||||
|
|
||||
|
0x06, // $004F offset = 1010
|
||||
|
0x0F,0xC0,0x3F,0xF0,0x70,0x38,0x60,0x18,0xC0,0x0C,0xC0,0x0C,0xC0,0x0C,0xC0,0x0C,0xC0,0x0C,0x60,0x18,0x70,0x38,0x3F,0xF0,0x0F,0xC0, |
||||
|
|
||||
|
0x1d, // $0050 offset = 1037
|
||||
|
0xFF,0x00,0xFF,0x80,0xC0,0xC0,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0xC0,0xFF,0x80,0xFF,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, |
||||
|
|
||||
|
0x29, // $0051 offset = 1064
|
||||
|
0x0F,0xC0,0x3F,0xF0,0x70,0x38,0x60,0x18,0xC0,0x0C,0xC0,0x0C,0xC0,0x0C,0xC0,0x0C,0xC0,0x0C,0x60,0x18,0x70,0x38,0x3F,0xF0,0x0F,0xC0,0x01,0xC4,0x00,0xFC, |
||||
|
|
||||
|
0x1d, // $0052 offset = 1095
|
||||
|
0xFF,0x00,0xFF,0x80,0xC0,0xC0,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0xC0,0xFF,0x80,0xFF,0x00,0xC3,0x00,0xC1,0x80,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x15, // $0053 offset = 1122
|
||||
|
0x3F,0x00,0x7F,0x80,0xC0,0xC0,0xC0,0x00,0xC0,0x00,0x60,0x00,0x3E,0x00,0x0F,0x80,0x01,0xC0,0x00,0xC0,0xC0,0xC0,0xFF,0x80,0x3F,0x00, |
||||
|
|
||||
|
0x2a, // $0054 offset = 1149
|
||||
|
0xFF,0xC0,0xFF,0xC0,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00, |
||||
|
|
||||
|
0x23, // $0055 offset = 1176
|
||||
|
0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0x60,0xC0,0x7F,0xC0,0x1F,0x00, |
||||
|
|
||||
|
0x04, // $0056 offset = 1203
|
||||
|
0xC0,0x18,0xC0,0x18,0x60,0x30,0x60,0x30,0x30,0x60,0x30,0x60,0x18,0xC0,0x18,0xC0,0x0D,0x80,0x0D,0x80,0x07,0x00,0x07,0x00,0x02,0x00, |
||||
|
|
||||
|
0x2b, // $0057 offset = 1230
|
||||
|
0xC0,0x40,0x60,0xC0,0xE0,0x60,0xC0,0xE0,0x60,0x61,0xB0,0xC0,0x61,0xB0,0xC0,0x61,0xB0,0xC0,0x33,0x19,0x80,0x33,0x19,0x80,0x33,0x19,0x80,0x1E,0x0F,0x00,0x1E,0x0F,0x00,0x1E,0x07,0x00,0x0C,0x06,0x00, |
||||
|
|
||||
|
0x07, // $0058 offset = 1270
|
||||
|
0xC0,0x60,0x60,0xC0,0x31,0x80,0x1B,0x00,0x1B,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x1B,0x00,0x1B,0x00,0x31,0x80,0x60,0xC0,0xC0,0x60, |
||||
|
|
||||
|
0x2c, // $0059 offset = 1297
|
||||
|
0xC0,0x30,0x60,0x60,0x60,0x60,0x30,0xC0,0x19,0x80,0x19,0x80,0x0F,0x00,0x07,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00, |
||||
|
|
||||
|
0x2d, // $005A offset = 1324
|
||||
|
0xFF,0xE0,0xFF,0xE0,0x01,0xC0,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x38,0x00,0x30,0x00,0x60,0x00,0xFF,0xE0,0xFF,0xE0, |
||||
|
|
||||
|
0x2e, // $005B offset = 1351
|
||||
|
0xF0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xF0, |
||||
|
|
||||
|
0x2f, // $005C offset = 1370
|
||||
|
0xC0,0xC0,0x60,0x60,0x60,0x30,0x30,0x30,0x18,0x18,0x18,0x0C,0x0C,0x06,0x06,0x06,0x03,0x03, |
||||
|
|
||||
|
0x30, // $005D offset = 1389
|
||||
|
0xF0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xF0, |
||||
|
|
||||
|
0x31, // $005E offset = 1408
|
||||
|
0x10,0x38,0x28,0x6C,0x44,0xC6,0x82,0x82, |
||||
|
|
||||
|
0x32, // $005F offset = 1417
|
||||
|
0xFF,0x80, |
||||
|
|
||||
|
0x33, // $0060 offset = 1420
|
||||
|
0xC0,0x70, |
||||
|
|
||||
|
0x34, // $0061 offset = 1423
|
||||
|
0x3E,0x00,0xFF,0x00,0x03,0x80,0x01,0x80,0x7F,0x80,0xE3,0x80,0xC1,0x80,0xC3,0x80,0xE7,0x80,0x7D,0x80, |
||||
|
|
||||
|
0x35, // $0062 offset = 1444
|
||||
|
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xDE,0x00,0xFF,0x80,0xC1,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC1,0x80,0xFF,0x80,0x9E,0x00, |
||||
|
|
||||
|
0x34, // $0063 offset = 1473
|
||||
|
0x1E,0x00,0x7F,0x80,0xE1,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xE1,0x00,0x7F,0x80,0x1E,0x00, |
||||
|
|
||||
|
0x36, // $0064 offset = 1494
|
||||
|
0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x3E,0xC0,0x7F,0xC0,0xE1,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE1,0xC0,0x7F,0xC0,0x3E,0xC0, |
||||
|
|
||||
|
0x37, // $0065 offset = 1523
|
||||
|
0x3F,0x00,0x7F,0x80,0xC1,0x80,0xC0,0xC0,0xFF,0xC0,0xC0,0x00,0xC0,0x00,0xE0,0x00,0x7F,0x80,0x1F,0x00, |
||||
|
|
||||
|
0x38, // $0066 offset = 1544
|
||||
|
0x1E,0x3B,0x30,0x30,0x30,0xFE,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, |
||||
|
|
||||
|
0x39, // $0067 offset = 1559
|
||||
|
0x3E,0xC0,0x7F,0xC0,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x61,0xC0,0x3F,0xC0,0x1E,0xC0,0x00,0xC0,0x40,0xC0,0xFF,0x80,0x3F,0x00, |
||||
|
|
||||
|
0x3a, // $0068 offset = 1588
|
||||
|
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xDE,0x00,0xFF,0x00,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80, |
||||
|
|
||||
|
0x3b, // $0069 offset = 1617
|
||||
|
0xC0,0xC0,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x3c, // $006A offset = 1632
|
||||
|
0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0xC6,0x7C,0x78, |
||||
|
|
||||
|
0x3d, // $006B offset = 1651
|
||||
|
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC3,0x00,0xC6,0x00,0xCC,0x00,0xD8,0x00,0xF0,0x00,0xF8,0x00,0xCC,0x00,0xC6,0x00,0xC3,0x00,0xC1,0x80, |
||||
|
|
||||
|
0x3b, // $006C offset = 1680
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x3e, // $006D offset = 1695
|
||||
|
0xDE,0x3C,0xFF,0x7E,0xE1,0xC3,0xC1,0x83,0xC1,0x83,0xC1,0x83,0xC1,0x83,0xC1,0x83,0xC1,0x83,0xC1,0x83, |
||||
|
|
||||
|
0x3f, // $006E offset = 1716
|
||||
|
0xDE,0x00,0xFF,0x00,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80, |
||||
|
|
||||
|
0x40, // $006F offset = 1737
|
||||
|
0x1E,0x00,0x7F,0x80,0xE1,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE1,0xC0,0x7F,0x80,0x1E,0x00, |
||||
|
|
||||
|
0x41, // $0070 offset = 1758
|
||||
|
0xDE,0x00,0xFF,0x80,0xC1,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC1,0x80,0xFF,0x80,0xDE,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, |
||||
|
|
||||
|
0x42, // $0071 offset = 1787
|
||||
|
0x3E,0xC0,0x7F,0xC0,0xE1,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE1,0xC0,0x7F,0xC0,0x3E,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xF8,0x00,0xE0, |
||||
|
|
||||
|
0x43, // $0072 offset = 1816
|
||||
|
0xD8,0xFC,0xE4,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x44, // $0073 offset = 1827
|
||||
|
0x3E,0x7F,0xC0,0xC0,0x70,0x1E,0x03,0x03,0xFE,0x7C, |
||||
|
|
||||
|
0x45, // $0074 offset = 1838
|
||||
|
0x30,0x30,0xFE,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3E,0x1E, |
||||
|
|
||||
|
0x3f, // $0075 offset = 1851
|
||||
|
0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xE3,0x80,0xFF,0x80,0x3D,0x80, |
||||
|
|
||||
|
0x46, // $0076 offset = 1872
|
||||
|
0xC0,0x60,0x60,0xC0,0x60,0xC0,0x31,0x80,0x31,0x80,0x1B,0x00,0x1B,0x00,0x0E,0x00,0x0E,0x00,0x04,0x00, |
||||
|
|
||||
|
0x47, // $0077 offset = 1893
|
||||
|
0xC0,0x81,0x80,0x41,0xC1,0x00,0x61,0xC3,0x00,0x63,0x63,0x00,0x23,0x62,0x00,0x32,0x26,0x00,0x16,0x34,0x00,0x1C,0x3C,0x00,0x1C,0x1C,0x00,0x0C,0x18,0x00, |
||||
|
|
||||
|
0x48, // $0078 offset = 1924
|
||||
|
0xC1,0x80,0x63,0x00,0x36,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x36,0x00,0x63,0x00,0xC1,0x80, |
||||
|
|
||||
|
0x49, // $0079 offset = 1945
|
||||
|
0xC0,0x60,0x60,0xC0,0x60,0xC0,0x60,0x80,0x31,0x80,0x33,0x00,0x1B,0x00,0x1A,0x00,0x0E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0xF8,0x00,0xF0,0x00, |
||||
|
|
||||
|
0x4a, // $007A offset = 1974
|
||||
|
0xFF,0x03,0x06,0x0C,0x18,0x30,0x30,0x60,0xC0,0xFF, |
||||
|
|
||||
|
0x4b, // $007B offset = 1985
|
||||
|
0x1C,0x38,0x30,0x30,0x30,0x30,0x30,0x70,0xE0,0x70,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x1C, |
||||
|
|
||||
|
0x4c, // $007C offset = 2004
|
||||
|
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, |
||||
|
|
||||
|
0x4d, // $007D offset = 2023
|
||||
|
0xE0,0x70,0x30,0x30,0x30,0x30,0x30,0x38,0x1C,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0xE0, |
||||
|
|
||||
|
0x4e, // $007E offset = 2042
|
||||
|
0x78,0x80,0xCD,0x80,0x87,0x00, |
||||
|
|
||||
|
0x4f, // $00B1 offset = 2049
|
||||
|
0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0xFF,0x80,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80, |
||||
|
|
||||
|
0x50, // $00B2 offset = 2074
|
||||
|
0xF8,0x8C,0x0C,0x08,0x18,0x20,0x40,0xFC, |
||||
|
|
||||
|
0x50, // $00B3 offset = 2083
|
||||
|
0xFC,0x08,0x10,0x38,0x0C,0x04,0x8C,0xF8, |
||||
|
|
||||
|
0x51, // $00B4 offset = 2092
|
||||
|
0x60,0xC0, |
||||
|
|
||||
|
0x52, // $00B5 offset = 2095
|
||||
|
0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC1,0x80,0xC3,0x80,0xFF,0x80,0xFD,0x80,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, |
||||
|
|
||||
|
0x53, // $00D7 offset = 2124
|
||||
|
0x84,0xCE,0x7C,0x38,0x78,0xEC,0xC4, |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
Font FontSmall = { |
||||
|
18, |
||||
|
10, |
||||
|
18, |
||||
|
4, |
||||
|
28, |
||||
|
32, |
||||
|
216, |
||||
|
3, |
||||
|
FontSmall_bboxes, |
||||
|
FontSmall_codepoints, |
||||
|
FontSmall_bitmaps, |
||||
|
}; |
||||
|
|
@ -0,0 +1,72 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
#include <stdio.h> |
||||
|
|
||||
|
#include "ring_buffer.h" |
||||
|
|
||||
|
static ring_buffer_t keybuf; |
||||
|
|
||||
|
/**
|
||||
|
* Code adapted from https://github.com/AndersKaloer/Ring-Buffer
|
||||
|
*/ |
||||
|
|
||||
|
int ring_buffer_init(void) |
||||
|
{ |
||||
|
keybuf.size = MAX_RING_BUFFER_SIZE; |
||||
|
keybuf.size_plus1 = MAX_RING_BUFFER_SIZE + 1; |
||||
|
keybuf.head_index = 0; |
||||
|
keybuf.tail_index = 0; |
||||
|
return 0; |
||||
|
} |
||||
|
|
||||
|
void ring_buffer_enqueue(uint8_t data) |
||||
|
{ |
||||
|
if (ring_buffer_is_full()) { |
||||
|
keybuf.tail_index = ((keybuf.tail_index + 1) % keybuf.size_plus1); |
||||
|
} |
||||
|
|
||||
|
keybuf.buffer[keybuf.head_index] = data; |
||||
|
keybuf.head_index = ((keybuf.head_index + 1) % keybuf.size_plus1); |
||||
|
} |
||||
|
|
||||
|
uint8_t ring_buffer_dequeue(uint8_t* data) |
||||
|
{ |
||||
|
if (ring_buffer_is_empty()) { |
||||
|
return 0; |
||||
|
} |
||||
|
|
||||
|
*data = keybuf.buffer[keybuf.tail_index]; |
||||
|
keybuf.tail_index = ((keybuf.tail_index + 1) % keybuf.size_plus1); |
||||
|
return 1; |
||||
|
} |
||||
|
|
||||
|
uint8_t ring_buffer_peek(uint8_t* data, ring_buffer_size_t index) |
||||
|
{ |
||||
|
if (index >= ring_buffer_num_items()) { |
||||
|
return 0; |
||||
|
} |
||||
|
|
||||
|
ring_buffer_size_t data_index = ((keybuf.tail_index + index) % keybuf.size_plus1); |
||||
|
*data = keybuf.buffer[data_index]; |
||||
|
return 1; |
||||
|
} |
||||
|
|
||||
|
uint8_t ring_buffer_is_empty(void) |
||||
|
{ |
||||
|
uint8_t result = (keybuf.head_index == keybuf.tail_index); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
uint8_t ring_buffer_is_full(void) |
||||
|
{ |
||||
|
uint8_t num_items = ring_buffer_num_items(); |
||||
|
uint8_t result = num_items == keybuf.size; |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
ring_buffer_size_t ring_buffer_num_items(void) |
||||
|
{ |
||||
|
uint8_t result = (keybuf.head_index + keybuf.size_plus1 - keybuf.tail_index) % keybuf.size_plus1; |
||||
|
return result; |
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
# Export wallet file format (Generic JSON) |
||||
|
|
||||
|
Passport can export data intended for various desktop and mobile |
||||
|
wallet systems, but it also supports a file format for general purpose |
||||
|
exports. |
||||
|
|
||||
|
It contains master XPUB, XFP for that, and derived values for the top hardened |
||||
|
position of BIP44, BIP84 and BIP49. |
||||
|
|
||||
|
# Example JSON file |
||||
|
|
||||
|
Here is an example: |
||||
|
|
||||
|
```javascript |
||||
|
{ |
||||
|
"chain": "XTN", |
||||
|
"xfp": "0F056943", |
||||
|
"xpub": "tpubD6NzVbkrYhZ4XzL5Dhayo67Gorv1YMS7j8pRUvVMd5odC2LBPLAygka9p7748JtSq82FNGPppFEz5xxZUdasBRCqJqXvUHq6xpnsMcYJzeh", |
||||
|
"account": 123, |
||||
|
"bip44": { |
||||
|
"deriv": "m/44'/1'/123'", |
||||
|
"first": "n44vs1Rv7T8SANrg2PFGQhzVkhr5Q6jMMD", |
||||
|
"name": "p2pkh", |
||||
|
"xfp": "B7908B26", |
||||
|
"xpub": "tpubDCiHGUNYdRRGoSH22j8YnruUKgguCK1CC2NFQUf9PApeZh8ewAJJWGMUrhggDNK73iCTanWXv1RN5FYemUH8UrVUBjqDb8WF2VoKmDh9UTo" |
||||
|
}, |
||||
|
"bip49": { |
||||
|
"_pub": "upub5DMRSsh6mNak9KbcVjJ7xAgHJvbE3Nx22CBTier5C35kv8j7g2q58ywxskBe6JCcAE2VH86CE2aL4MifJyKbRw8Gj9ay7SWvUBkp2DJ7y52", |
||||
|
"deriv": "m/49'/1'/123'", |
||||
|
"first": "2N87V39riUUCd4vmXfDjMWAu9gUCiBji5jB", |
||||
|
"name": "p2wpkh-p2sh", |
||||
|
"xfp": "CEE1D809", |
||||
|
"xpub": "tpubDCDqt7XXvhAdy1MpSze5nMJA9x8DrdRaKALRRPasfxyHpiqWWEAr9cbDBQ9BcX7cB3up98Pk97U2QQ3xrvQsi5dNPmRYYhdcsKY9wwEY87T" |
||||
|
}, |
||||
|
"bip84": { |
||||
|
"_pub": "vpub5Y5a91QvDT45EnXQaKeuvJupVvX8f9BiywDcadSTtaeJ1VgJPPXMitnYsqd9k7GnEqh44FKJ5McJfu6KrihFXhAmvSWgm7BAVVK8Gupu4fL", |
||||
|
"deriv": "m/84'/1'/123'", |
||||
|
"first": "tb1qc58ys2dphtphg6yuugdf3d0kufmk0tye044g3l", |
||||
|
"name": "p2wpkh", |
||||
|
"xfp": "78CF94E5", |
||||
|
"xpub": "tpubDC7jGaaSE66VDB6VhEDFYQSCAyugXmfnMnrMVyHNzW9wryyTxvha7TmfAHd7GRXrr2TaAn2HXn9T8ep4gyNX1bzGiieqcTUNcu2poyntrET" |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Notes |
||||
|
|
||||
|
1. The `first` address is formed by added `/0/0` onto the given derivation, and is assumed |
||||
|
to be the first (non-change) receive address for the wallet. |
||||
|
|
||||
|
2. The user may specify any value (up to 9999) for the account number, and it's meant to |
||||
|
segregate funds into sub-wallets. Don't assume it's zero. |
||||
|
|
||||
|
3. When making your PSBT files to spend these amounts, remember that the XFP of the master |
||||
|
(`0F056943` in this example) is is the root of the subkey paths found in the file, and |
||||
|
you must include the full derivation path from master. So based on this example, |
||||
|
to spend a UTXO on `tb1qc58ys2dphtphg6yuugdf3d0kufmk0tye044g3l`, the input section |
||||
|
of your PSBT would need to specify `(m=0F056943)/84'/1'/123'/0/0`. |
||||
|
|
||||
|
4. The `_pub` value is the [SLIP-132](https://github.com/satoshilabs/slips/blob/master/slip-0132.md) style "ypub/zpub/etc" which some systems might want. It implies |
||||
|
a specific address format. |
@ -1,71 +0,0 @@ |
|||||
# SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com> |
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later |
|
||||
# |
|
||||
import telnetlib |
|
||||
|
|
||||
HOST = "localhost" |
|
||||
|
|
||||
tn = telnetlib.Telnet(HOST, 4444) |
|
||||
|
|
||||
print("1") |
|
||||
result = tn.expect(['>'], 10)[2] |
|
||||
print("2: result={}".format(result)) |
|
||||
tn.write(b"reset halt\r") |
|
||||
print("3") |
|
||||
result = tn.expect(['>'], 10)[2] |
|
||||
print("4: result={}".format(result)) |
|
||||
tn.write(b"flash write_image erase build-Passport/firmware0.bin 0x8000000\r") |
|
||||
print("5") |
|
||||
result = tn.expect(['>'], 10)[2] |
|
||||
print("6: result={}".format(result)) |
|
||||
|
|
||||
tn.write(b"flash write_image erase build-Passport/firmware1.bin 0x8040000\r") |
|
||||
print("7") |
|
||||
result = tn.expect(['>'], 100)[2] |
|
||||
|
|
||||
# TODO: This should not need to be here - someone we have to expect the prompt twice. |
|
||||
# TODO: Is it an extra echo character? Or is expect() not consuming the input? Do we also need to read the input? |
|
||||
result = tn.expect(['>'], 100)[2] |
|
||||
print("8: result = {}".format(result)) |
|
||||
tn.write(b"reset\r") |
|
||||
print("9") |
|
||||
result = tn.expect(['>'], 10)[2] |
|
||||
result = tn.expect(['>'], 10)[2] |
|
||||
print("10: result = {}".format(result)) |
|
||||
tn.write(b"mdb 0x081e0000 20\r") |
|
||||
print("11") |
|
||||
result = tn.expect(["0x081e0000: (.*)\r"]) |
|
||||
print("12: result = {}".format(result)) |
|
||||
print('Memory at 0x81e0000 = {}'.format(result[1].group(1))) |
|
||||
|
|
||||
|
|
||||
# In order to readout the public key generated for supply chain validation: |
|
||||
# |
|
||||
# - The initialization code must generate the public key for the device and |
|
||||
# store it at a known address in RAM. |
|
||||
# - The MPU should NOT be configured on initial boot (if SE is blank) |
|
||||
# - The Python script should issue a command like 'mdb 0x01234567 32' and save the |
|
||||
# result somewhere (probably POST to a server with a long cookie for auth). |
|
||||
|
|
||||
|
|
||||
# At a high level, this script will: |
|
||||
# |
|
||||
# - reset halt |
|
||||
# - Flash the firmware to the device |
|
||||
# - reset |
|
||||
# - Wait x seconds for the basic config to complete |
|
||||
# - Read any necessary information from known SRAM locations |
|
||||
# - Post information to our server |
|
||||
# - reset |
|
||||
# |
|
||||
# Disconnect from telnet |
|
||||
# |
|
||||
# Use some other lib to connect to the GPIO board and start factory test |
|
||||
# |
|
||||
# Numato 32 channel GPIO board over USB serial: |
|
||||
# |
|
||||
# - https://numato.com/product/32-channel-usb-gpio-module-with-analog-inputs/ |
|
||||
# - https://github.com/numato/samplecode/blob/master/RelayAndGPIOModules/USBRelayAndGPIOModules/python/usbgpio16_32/gpioread.py |
|
||||
# - https://github.com/numato/samplecode/blob/master/RelayAndGPIOModules/USBRelayAndGPIOModules/python/usbgpio16_32/gpiowrite.py |
|
||||
# - https://github.com/numato/samplecode/blob/master/RelayAndGPIOModules/USBRelayAndGPIOModules/python/usbgpio16_32/analogread.py |
|
||||
|
|
@ -0,0 +1,142 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
//
|
||||
|
// Autogenerated - Do not edit!
|
||||
|
//
|
||||
|
|
||||
|
#include "firmware_graphics.h" |
||||
|
|
||||
|
uint8_t busybar1_data[] = { |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x03, 0x80, |
||||
|
0x07, 0xc0, |
||||
|
0x07, 0xc0, |
||||
|
0x07, 0xc0, |
||||
|
0x03, 0x80, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
}; |
||||
|
Image busybar1_img = { 15, 15, 2, busybar1_data }; |
||||
|
|
||||
|
uint8_t busybar2_data[] = { |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x03, 0x80, |
||||
|
0x07, 0xc0, |
||||
|
0x0f, 0xe0, |
||||
|
0x0f, 0xe0, |
||||
|
0x0f, 0xe0, |
||||
|
0x07, 0xc0, |
||||
|
0x03, 0x80, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
}; |
||||
|
Image busybar2_img = { 15, 15, 2, busybar2_data }; |
||||
|
|
||||
|
uint8_t busybar3_data[] = { |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x03, 0x80, |
||||
|
0x07, 0xc0, |
||||
|
0x0f, 0xe0, |
||||
|
0x1f, 0xf0, |
||||
|
0x1f, 0xf0, |
||||
|
0x1f, 0xf0, |
||||
|
0x0f, 0xe0, |
||||
|
0x07, 0xc0, |
||||
|
0x03, 0x80, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
}; |
||||
|
Image busybar3_img = { 15, 15, 2, busybar3_data }; |
||||
|
|
||||
|
uint8_t busybar4_data[] = { |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x03, 0x80, |
||||
|
0x0f, 0xe0, |
||||
|
0x1f, 0xf0, |
||||
|
0x1f, 0xf0, |
||||
|
0x3f, 0xf8, |
||||
|
0x3f, 0xf8, |
||||
|
0x3f, 0xf8, |
||||
|
0x1f, 0xf0, |
||||
|
0x1f, 0xf0, |
||||
|
0x0f, 0xe0, |
||||
|
0x03, 0x80, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
}; |
||||
|
Image busybar4_img = { 15, 15, 2, busybar4_data }; |
||||
|
|
||||
|
uint8_t busybar5_data[] = { |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
0x07, 0xc0, |
||||
|
0x1f, 0xf0, |
||||
|
0x1f, 0xf0, |
||||
|
0x3f, 0xf8, |
||||
|
0x3f, 0xf8, |
||||
|
0x3f, 0xf8, |
||||
|
0x3f, 0xf8, |
||||
|
0x3f, 0xf8, |
||||
|
0x1f, 0xf0, |
||||
|
0x1f, 0xf0, |
||||
|
0x07, 0xc0, |
||||
|
0x00, 0x00, |
||||
|
0x00, 0x00, |
||||
|
}; |
||||
|
Image busybar5_img = { 15, 15, 2, busybar5_data }; |
||||
|
|
||||
|
uint8_t busybar6_data[] = { |
||||
|
0x00, 0x00, |
||||
|
0x0f, 0xe0, |
||||
|
0x1f, 0xf0, |
||||
|
0x3f, 0xf8, |
||||
|
0x7f, 0xfc, |
||||
|
0x7f, 0xfc, |
||||
|
0x7f, 0xfc, |
||||
|
0x7f, 0xfc, |
||||
|
0x7f, 0xfc, |
||||
|
0x7f, 0xfc, |
||||
|
0x7f, 0xfc, |
||||
|
0x3f, 0xf8, |
||||
|
0x1f, 0xf0, |
||||
|
0x0f, 0xe0, |
||||
|
0x00, 0x00, |
||||
|
}; |
||||
|
Image busybar6_img = { 15, 15, 2, busybar6_data }; |
||||
|
|
||||
|
uint8_t busybar7_data[] = { |
||||
|
0x0f, 0xe0, |
||||
|
0x1f, 0xf0, |
||||
|
0x3f, 0xf8, |
||||
|
0x7f, 0xfc, |
||||
|
0xff, 0xfe, |
||||
|
0xff, 0xfe, |
||||
|
0xff, 0xfe, |
||||
|
0xff, 0xfe, |
||||
|
0xff, 0xfe, |
||||
|
0xff, 0xfe, |
||||
|
0xff, 0xfe, |
||||
|
0x7f, 0xfc, |
||||
|
0x3f, 0xf8, |
||||
|
0x1f, 0xf0, |
||||
|
0x0f, 0xe0, |
||||
|
}; |
||||
|
Image busybar7_img = { 15, 15, 2, busybar7_data }; |
||||
|
|
@ -0,0 +1,23 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
//
|
||||
|
// Autogenerated - Do not edit!
|
||||
|
//
|
||||
|
|
||||
|
#include <stdint.h> |
||||
|
|
||||
|
typedef struct _Image { |
||||
|
int16_t width; |
||||
|
int16_t height; |
||||
|
int16_t byte_width; |
||||
|
uint8_t* data; |
||||
|
} Image; |
||||
|
|
||||
|
extern Image busybar1_img; |
||||
|
extern Image busybar2_img; |
||||
|
extern Image busybar3_img; |
||||
|
extern Image busybar4_img; |
||||
|
extern Image busybar5_img; |
||||
|
extern Image busybar6_img; |
||||
|
extern Image busybar7_img; |
@ -0,0 +1,159 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
|
||||
|
#include <stdio.h> |
||||
|
|
||||
|
#include "stm32h7xx_hal.h" |
||||
|
|
||||
|
#include "py/mperrno.h" |
||||
|
#include "py/mpstate.h" |
||||
|
#include "py/mphal.h" |
||||
|
|
||||
|
#include "uart.h" |
||||
|
|
||||
|
#include "backlight.h" |
||||
|
#include "frequency.h" |
||||
|
#include "se.h" |
||||
|
|
||||
|
#define LOW_FREQUENCY 64000000 |
||||
|
// #define HIGH_FREQUENCY 240000000
|
||||
|
#define HIGH_FREQUENCY 480000000 |
||||
|
|
||||
|
static uint8_t rxbuf[260]; |
||||
|
static pyb_uart_obj_t pyb_uart_repl_obj; |
||||
|
|
||||
|
void frequency_update_console_uart(void) |
||||
|
{ |
||||
|
pyb_uart_repl_obj.base.type = &pyb_uart_type; |
||||
|
pyb_uart_repl_obj.uart_id = MICROPY_HW_UART_REPL; |
||||
|
pyb_uart_repl_obj.is_static = true; |
||||
|
pyb_uart_repl_obj.timeout = 0; |
||||
|
pyb_uart_repl_obj.timeout_char = 2; |
||||
|
uart_init(&pyb_uart_repl_obj, MICROPY_HW_UART_REPL_BAUD, UART_WORDLENGTH_8B, UART_PARITY_NONE, UART_STOPBITS_1, 0); |
||||
|
uart_set_rxbuf(&pyb_uart_repl_obj, sizeof(rxbuf), rxbuf); |
||||
|
MP_STATE_PORT(pyb_stdio_uart) = &pyb_uart_repl_obj; |
||||
|
} |
||||
|
|
||||
|
void frequency_turbo( |
||||
|
bool enable |
||||
|
) |
||||
|
{ |
||||
|
HAL_StatusTypeDef rc; |
||||
|
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; |
||||
|
RCC_OscInitTypeDef RCC_OscInitStruct = {0}; |
||||
|
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; |
||||
|
|
||||
|
// printf("[%s] %s\n", __func__, enable ? "true":"false");
|
||||
|
|
||||
|
// HACK: TEMP - always be in high speed mode
|
||||
|
enable = true; |
||||
|
|
||||
|
if ((!enable && (SystemCoreClock == LOW_FREQUENCY)) || |
||||
|
(enable && (SystemCoreClock == HIGH_FREQUENCY))) |
||||
|
return; /* Already at requested frequency...nothing to do */ |
||||
|
|
||||
|
RCC->CR |= RCC_CR_HSION; |
||||
|
|
||||
|
/* Wait till HSI is ready */ |
||||
|
while (!(RCC->CR & RCC_CR_HSIRDY)); |
||||
|
|
||||
|
/* Select HSI clock as main clock */ |
||||
|
RCC->CFGR = (RCC->CFGR & ~(RCC_CFGR_SW)) | RCC_CFGR_SW_HSI; |
||||
|
|
||||
|
/* Reconfigure the clocks based on enable flag:
|
||||
|
* 64 MHz core clock if false |
||||
|
* 480 MHz core clock if true |
||||
|
*/ |
||||
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI48; |
||||
|
RCC_OscInitStruct.HSEState = RCC_HSE_ON; |
||||
|
RCC_OscInitStruct.HSIState = RCC_HSI_OFF; |
||||
|
RCC_OscInitStruct.CSIState = RCC_CSI_OFF; |
||||
|
RCC_OscInitStruct.LSEState = RCC_LSE_OFF; |
||||
|
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; |
||||
|
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; |
||||
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; |
||||
|
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_1; |
||||
|
RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; |
||||
|
RCC_OscInitStruct.PLL.PLLFRACN = 0; |
||||
|
|
||||
|
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); |
||||
|
RCC_ClkInitStruct.ClockType |= (RCC_CLOCKTYPE_D3PCLK1 | RCC_CLOCKTYPE_D1PCLK1); |
||||
|
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; |
||||
|
RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; |
||||
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2; |
||||
|
RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; |
||||
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; |
||||
|
RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; |
||||
|
RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; |
||||
|
|
||||
|
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART2 |
||||
|
|RCC_PERIPHCLK_RNG|RCC_PERIPHCLK_SPI4 |
||||
|
|RCC_PERIPHCLK_SPI1|RCC_PERIPHCLK_SPI2 |
||||
|
|RCC_PERIPHCLK_SDMMC|RCC_PERIPHCLK_I2C2 |
||||
|
|RCC_PERIPHCLK_ADC|RCC_PERIPHCLK_I2C1 |
||||
|
|RCC_PERIPHCLK_I2C4; |
||||
|
PeriphClkInitStruct.PLL2.PLL2M = 1; |
||||
|
PeriphClkInitStruct.PLL2.PLL2N = 18; |
||||
|
PeriphClkInitStruct.PLL2.PLL2P = 1; |
||||
|
PeriphClkInitStruct.PLL2.PLL2Q = 2; |
||||
|
PeriphClkInitStruct.PLL2.PLL2R = 2; |
||||
|
PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_3; |
||||
|
PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM; |
||||
|
PeriphClkInitStruct.PLL2.PLL2FRACN = 6144; |
||||
|
PeriphClkInitStruct.SdmmcClockSelection = RCC_SDMMCCLKSOURCE_PLL; |
||||
|
PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL; |
||||
|
PeriphClkInitStruct.Spi45ClockSelection = RCC_SPI45CLKSOURCE_D2PCLK1; |
||||
|
PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_D2PCLK1; |
||||
|
PeriphClkInitStruct.RngClockSelection = RCC_RNGCLKSOURCE_HSI48; |
||||
|
PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_D2PCLK1; |
||||
|
PeriphClkInitStruct.I2c4ClockSelection = RCC_I2C4CLKSOURCE_D3PCLK1; |
||||
|
PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2; |
||||
|
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; |
||||
|
|
||||
|
if (!enable) |
||||
|
{ |
||||
|
RCC_OscInitStruct.PLL.PLLM = 1; |
||||
|
RCC_OscInitStruct.PLL.PLLN = 32; |
||||
|
RCC_OscInitStruct.PLL.PLLP = 2; |
||||
|
RCC_OscInitStruct.PLL.PLLQ = 32; |
||||
|
RCC_OscInitStruct.PLL.PLLR = 2; |
||||
|
RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV2; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
RCC_OscInitStruct.PLL.PLLM = 1; |
||||
|
RCC_OscInitStruct.PLL.PLLN = 120; |
||||
|
RCC_OscInitStruct.PLL.PLLP = 2; |
||||
|
RCC_OscInitStruct.PLL.PLLQ = 120; |
||||
|
RCC_OscInitStruct.PLL.PLLR = 2; |
||||
|
// RCC_OscInitStruct.PLL.PLLM = 1;
|
||||
|
// RCC_OscInitStruct.PLL.PLLN = 60; // TODO: clock tree
|
||||
|
// RCC_OscInitStruct.PLL.PLLP = 2;
|
||||
|
// RCC_OscInitStruct.PLL.PLLQ = 60;
|
||||
|
// RCC_OscInitStruct.PLL.PLLR = 2;
|
||||
|
} |
||||
|
|
||||
|
rc = HAL_RCC_OscConfig(&RCC_OscInitStruct); |
||||
|
if (rc != HAL_OK) |
||||
|
printf("[%s] HAL_RCC_OscConfig failed\n", __func__); |
||||
|
|
||||
|
rc = HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); |
||||
|
if (rc != HAL_OK) |
||||
|
printf("[%s] HAL_RCCEx_PeriphCLKConfig failed\n", __func__); |
||||
|
|
||||
|
rc = HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4); |
||||
|
if (rc != HAL_OK) |
||||
|
printf("[%s] HAL_RCC_ClockConfig failed\n", __func__); |
||||
|
|
||||
|
/* Adjust the backlight PWM based on the new frequency */ |
||||
|
backlight_adjust(enable); |
||||
|
|
||||
|
/* Re-initialize the console UART based on the new frequency */ |
||||
|
frequency_update_console_uart(); |
||||
|
|
||||
|
/* Re-initialize the SE UART based on the new frequency */ |
||||
|
se_setup(); |
||||
|
|
||||
|
//printf("%lu, %lu, %lu, %lu, %lu\n", HAL_RCC_GetSysClockFreq(), SystemCoreClock, HAL_RCC_GetHCLKFreq(), HAL_RCC_GetPCLK1Freq(), HAL_RCC_GetPCLK2Freq());
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
//
|
||||
|
|
||||
|
#ifndef __FREQUENCY_H__ |
||||
|
#define __FREQUENCY_H__ |
||||
|
|
||||
|
#include <stdbool.h> |
||||
|
|
||||
|
extern void frequency_turbo(bool enable); |
||||
|
extern void frequency_update_console_uart(void); |
||||
|
|
||||
|
#endif // __FREQUENCY_H__
|
@ -0,0 +1,5 @@ |
|||||
|
NOTE: The following website is able to convert PNGs to true two-color images: |
||||
|
|
||||
|
https://manytools.org/image/colorize-filter/ |
||||
|
|
||||
|
The py/build.py script requires exactly two color entries or it will fail. |
@ -0,0 +1,5 @@ |
|||||
|
bootloader_graphics.c |
||||
|
bootloader_graphics.h |
||||
|
firmware_graphics.c |
||||
|
firmware_graphics.h |
||||
|
|
@ -0,0 +1,24 @@ |
|||||
|
# SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
#
|
||||
|
# SPDX-FileCopyrightText: 2018 Coinkite, Inc. <coldcardwallet.com>
|
||||
|
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
#
|
||||
|
# (c) Copyright 2018 by Coinkite Inc. This file is part of Coldcard <coldcardwallet.com>
|
||||
|
# and is covered by GPLv3 license found in COPYING.
|
||||
|
|
||||
|
all: bootloader_graphics.c firmware_graphics.c |
||||
|
|
||||
|
BOOTLOADER_SOURCES = splash.png |
||||
|
|
||||
|
bootloader_graphics.c: Makefile $(BOOTLOADER_SOURCES) cbuild.py |
||||
|
python3 cbuild.py bootloader_graphics $(BOOTLOADER_SOURCES) |
||||
|
|
||||
|
FIRMWARE_SOURCES = $(wildcard busybar*.png) |
||||
|
|
||||
|
firmware_graphics.c: Makefile $(FIRMWARE_SOURCES) cbuild.py |
||||
|
python3 cbuild.py firmware_graphics $(FIRMWARE_SOURCES) |
||||
|
|
||||
|
|
||||
|
up: all |
||||
|
(cd ../shared; make up) |
After Width: | Height: | Size: 108 B |
After Width: | Height: | Size: 118 B |
After Width: | Height: | Size: 131 B |
After Width: | Height: | Size: 136 B |
After Width: | Height: | Size: 125 B |
After Width: | Height: | Size: 126 B |
After Width: | Height: | Size: 120 B |
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
Before Width: | Height: | Size: 407 B |
@ -1,3 +1,9 @@ |
|||||
|
# SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
|
||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
#
|
||||
|
# SPDX-FileCopyrightText: 2018 Coinkite, Inc. <coldcardwallet.com>
|
||||
|
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
#
|
||||
# (c) Copyright 2018 by Coinkite Inc. This file is part of Coldcard <coldcardwallet.com>
|
# (c) Copyright 2018 by Coinkite Inc. This file is part of Coldcard <coldcardwallet.com>
|
||||
# and is covered by GPLv3 license found in COPYING.
|
# and is covered by GPLv3 license found in COPYING.
|
||||
|
|
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
Before Width: | Height: | Size: 117 B After Width: | Height: | Size: 117 B |
Before Width: | Height: | Size: 117 B After Width: | Height: | Size: 117 B |
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |
@ -1,4 +1,4 @@ |
|||||
# SPDX-FileCopyrightText: 2018 Coinkite, Inc. <coldcardwallet.com> |
# SPDX-FileCopyrightText: 2018 Coinkite, Inc. <coldcardwallet.com> |
||||
# SPDX-License-Identifier: GPL-3.0-only |
# SPDX-License-Identifier: GPL-3.0-only |
||||
# |
# |
||||
#!/usr/bin/env python3 |
#!/usr/bin/env python3 |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |