/******************************************************************************
|
/******************************************************************************
|
* void - Bootloader Version 0.2.2 *
|
* void - Bootloader Version 0.2.2 *
|
******************************************************************************
|
******************************************************************************
|
* Copyright (C)2011 Mathias Hörtnagl <mathias.hoertnagl@gmail.com> *
|
* Copyright (C)2011 Mathias Hörtnagl <mathias.hoertnagl@gmail.com> *
|
* *
|
* *
|
* This program is free software: you can redistribute it and/or modify *
|
* This program is free software: you can redistribute it and/or modify *
|
* it under the terms of the GNU General Public License as published by *
|
* it under the terms of the GNU General Public License as published by *
|
* the Free Software Foundation, either version 3 of the License, or *
|
* the Free Software Foundation, either version 3 of the License, or *
|
* (at your option) any later version. *
|
* (at your option) any later version. *
|
* *
|
* *
|
* This program is distributed in the hope that it will be useful, *
|
* This program is distributed in the hope that it will be useful, *
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
* GNU General Public License for more details. *
|
* GNU General Public License for more details. *
|
* *
|
* *
|
* You should have received a copy of the GNU General Public License *
|
* You should have received a copy of the GNU General Public License *
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
******************************************************************************/
|
******************************************************************************/
|
#include "ui.h"
|
#include "ui.h"
|
|
|
#ifndef _VIEW_H
|
#ifndef _VIEW_H
|
#define _VIEW_H
|
#define _VIEW_H
|
|
|
/******************************************************************************
|
/******************************************************************************
|
* Error Messages *
|
* Error Messages *
|
******************************************************************************/
|
******************************************************************************/
|
Message errFlashNotReady = {
|
Message errFlashNotReady = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Flash is not ready, although it should be."
|
"Flash is not ready, although it should be."
|
};
|
};
|
|
|
Message errFlashState = {
|
Message errFlashState = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Flash is in an errorous state. Please restart."
|
"Flash is in an errorous state. Please restart."
|
};
|
};
|
|
|
Message errErrorFlashSize = {
|
Message errErrorFlashSize = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Image size exceeds available flash memory."
|
"Image size exceeds available flash memory."
|
};
|
};
|
|
|
Message errErrorFlashLocked = {
|
Message errErrorFlashLocked = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Flash block is locked."
|
"Flash block is locked."
|
};
|
};
|
|
|
Message errErrorFlashWrite = {
|
Message errErrorFlashWrite = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Could not write to flash."
|
"Could not write to flash."
|
};
|
};
|
|
|
Message errErrorFlashErase = {
|
Message errErrorFlashErase = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Could not erase flash block."
|
"Could not erase flash block."
|
};
|
};
|
|
|
/******************************************************************************
|
/******************************************************************************
|
* Upload View *
|
* Upload View *
|
******************************************************************************/
|
******************************************************************************/
|
Message msgUploadErase = {
|
Message msgUploadErase = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Erasing flash contents ..."
|
"Erasing flash contents ..."
|
};
|
};
|
|
|
Message msgUploadWait = {
|
Message msgUploadWait = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Waiting for incomming transmission ..."
|
"Waiting for incoming transmission ..."
|
};
|
};
|
|
|
Message msgUploadWrite = {
|
Message msgUploadWrite = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Uploading data ..."
|
"Uploading data ..."
|
};
|
};
|
|
|
ProgressBar pbUpload = {
|
ProgressBar pbUpload = {
|
ID_PROGRESS_BAR,
|
ID_PROGRESS_BAR,
|
{0,1},
|
{0,1},
|
0
|
0
|
};
|
};
|
|
|
Window wUpload = {
|
Window wUpload = {
|
{16, 12, 68, 6},
|
{16, 12, 68, 6},
|
{WHITE, BLACK},
|
{WHITE, BLACK},
|
"Image Upload",
|
"Image Upload",
|
2,
|
2,
|
{&msgUploadWait, &pbUpload}
|
{&msgUploadWait, &pbUpload}
|
};
|
};
|
|
|
|
|
/******************************************************************************
|
/******************************************************************************
|
* DDR Upload View *
|
* DDR Upload View *
|
******************************************************************************/
|
******************************************************************************/
|
Message msgUploadDDR = {
|
Message msgUploadDDR = {
|
ID_MESSAGE,
|
ID_MESSAGE,
|
{0,0},
|
{0,0},
|
"Loading DDR ..."
|
"Loading DDR ..."
|
};
|
};
|
|
|
Window wDDRUpload = {
|
Window wDDRUpload = {
|
{16, 12, 68, 6},
|
{16, 12, 68, 6},
|
{WHITE, BLACK},
|
{WHITE, BLACK},
|
"DDR Load",
|
"DDR Load",
|
2,
|
2,
|
{&msgUploadDDR, &pbUpload}
|
{&msgUploadDDR, &pbUpload}
|
};
|
};
|
|
|
/******************************************************************************
|
/******************************************************************************
|
* Memory View *
|
* Memory View *
|
******************************************************************************/
|
******************************************************************************/
|
Window wFlashMemory = {
|
Window wFlashMemory = {
|
{1, 1, 98, 15},
|
{1, 1, 98, 15},
|
{YELLOW, BLACK},
|
{YELLOW, BLACK},
|
"Flash Memory",
|
"Flash Memory",
|
0,
|
0,
|
NULL
|
NULL
|
};
|
};
|
|
|
Window wDDRMemory = {
|
Window wDDRMemory = {
|
{1, 17, 98, 15},
|
{1, 17, 98, 15},
|
{YELLOW, BLACK},
|
{YELLOW, BLACK},
|
"DDR Memory",
|
"DDR Memory",
|
0,
|
0,
|
NULL
|
NULL
|
};
|
};
|
|
|
|
|
/******************************************************************************
|
/******************************************************************************
|
* Boot View *
|
* Boot View *
|
******************************************************************************/
|
******************************************************************************/
|
#define OPTION_UPLOAD 0
|
#define OPTION_UPLOAD 0
|
#define OPTION_MEMORY 1
|
#define OPTION_MEMORY 1
|
#define OPTION_START 2
|
#define OPTION_START 2
|
|
|
MenuItem menuUpload = {
|
MenuItem menuUpload = {
|
"Upload image ..."
|
"Upload image ..."
|
};
|
};
|
|
|
MenuItem menuMemory = {
|
MenuItem menuMemory = {
|
"View memory contents ..."
|
"View memory contents ..."
|
};
|
};
|
|
|
MenuItem menuStart = {
|
MenuItem menuStart = {
|
"Start ..."
|
"Start ..."
|
};
|
};
|
|
|
Menu menu = {
|
Menu menu = {
|
ID_MENU,
|
ID_MENU,
|
{0,0},
|
{0,0},
|
OPTION_UPLOAD,
|
OPTION_UPLOAD,
|
3,
|
3,
|
{ &menuUpload, &menuMemory, &menuStart }
|
{ &menuUpload, &menuMemory, &menuStart }
|
};
|
};
|
|
|
Window wBoot = {
|
Window wBoot = {
|
{25, 12, 50, 7},
|
{25, 12, 50, 7},
|
{WHITE, BLACK},
|
{WHITE, BLACK},
|
"void Bootloader v0.2.2",
|
"void Bootloader v0.2.2",
|
1,
|
1,
|
{ &menu }
|
{ &menu }
|
};
|
};
|
|
|
|
|