Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
68eee8d
Update codebase.
invalid-email-address Oct 16, 2019
cf45f76
Add files via upload
jguild11 Sep 14, 2019
5d036ca
Linked Buttons
MrMeeseeks200 Sep 17, 2019
de47614
EEPROM
MrMeeseeks200 Sep 24, 2019
cc2faca
fixed spelling error
MrMeeseeks200 Sep 24, 2019
c889053
Add files via upload
jguild11 Sep 25, 2019
6613f3f
Updated the settings (cyan) menu
Mori19 Oct 3, 2019
3c0e618
Utilise Speaker
Mori19 Oct 4, 2019
ef22f62
Update SOS.ino
Mori19 Oct 5, 2019
2f36c6e
Update SOS.ino
Mori19 Oct 6, 2019
8aeacb1
Delete atmega2560.c
ScottGH98 Oct 7, 2019
47648f6
Delete atmega2560.h
ScottGH98 Oct 7, 2019
c83138a
Delete dec.h
ScottGH98 Oct 7, 2019
7afb2d6
Delete def.h
ScottGH98 Oct 7, 2019
5c898df
Delete globals.c
ScottGH98 Oct 7, 2019
a6afaac
Delete satchat.c
ScottGH98 Oct 7, 2019
1dcc97d
Add files via upload
MrMeeseeks200 Oct 14, 2019
de42650
Delete old files.
invalid-email-address Oct 16, 2019
c7b20db
Add keyboard code.
invalid-email-address Oct 16, 2019
850108b
Add files which were forgotten in last commit.
invalid-email-address Oct 16, 2019
eca01ee
Minor fixes.
invalid-email-address Oct 16, 2019
022a6d1
Add function to print single-character legends to the touch keyboard.
invalid-email-address Oct 16, 2019
5a8410c
Fix for the apostrophe key.
invalid-email-address Oct 16, 2019
7e888d1
Fix some pointer/dereference issues.
invalid-email-address Oct 17, 2019
4e4b70f
Add function for going to last visited menu. Add messages menu.
invalid-email-address Oct 17, 2019
953ed3d
Fix some messages menu buttons. Add a line to startup code.
invalid-email-address Oct 17, 2019
3de28c9
Add more menu templates. Add outgoing number to settings.
invalid-email-address Oct 17, 2019
2dbbc4d
Improve voiced key code.
invalid-email-address Oct 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions satchat/dec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
typedef void (touch_button_function)(const uintptr_t functionData);

enum menu {MENU_NONE, MENU_MAIN, MENU_SETTINGS, MENU_COORDINATES, MENU_MESSAGES, MENU_KEYBOARD, MENU_INBOX, MENU_OUTBOX, MENU_PRESET_MESSAGES, MENU_COUNT};//MENU_COUNT MUST BE LAST.

struct menu_context
{
enum menu menu;
enum menu lastMenu;
bool justChanged;
};

struct settings
{
uint16_t breadcrumbInterval;
bool breadcrumbs;
bool militaryTime;
bool voicedMenus;
bool voicedKeys;
bool instantButtons;
char outgoingNumber[16];
};

struct eeprom//USED FOR FINDING OFFSETS AND DOCUMENTING EEPROM LAYOUT. DO NOT CREATE INSTANCE OF THIS STRUCT.
{
uint32_t header;
struct settings;
struct message inbox[8];
struct message outbox[4];
struct message predefined[4];
};

struct touch_button
{
uint16_t x;
uint16_t y;
uint16_t w;
uint16_t h;
uint16_t colour;
uint16_t colourPressed;
touch_button_function *function;
uintptr_t functionData;
};

struct menu_buttons
{
struct touch_button *button;
bool *buttonState;
uint8_t buttonCount;
};

struct touch_point
{
union
{
struct
{
uint16_t x;
uint16_t y;
};
struct
{
uint16_t raw[2];
};
};
bool isPressed;
bool justPressed;
bool justReleased;
};

struct date_time
{
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
};

struct gps
{
double longitude;
double latitude;
struct date_time timestamp;
};

struct message
{
char number[16];
struct gps gps;
char text[MESSAGE_LENGTH];
};

struct message_editor
{
char text[MESSAGE_LENGTH];
bool shift;
bool caps;
};

struct device_state
{
struct settings settings;
struct menu_context menuContext;
struct touch_point lastTouchPoint;
struct message_editor message;
};
12 changes: 12 additions & 0 deletions satchat/def.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#define MENU_TEXT_SIZE 3
#define MENU_TEXT_WIDTH 8
#define MENU_TEXT_HEIGHT 11

//STANDARD SMS MESSAGE LENGTH IS 160 CHARACTERS.
#define MESSAGE_LENGTH 160

#define PASTEL_GREEN 0xE77B
#define PASTEL_RED 0xFF3A
#define PASTEL_BLUE 0xDF5E
#define PASTEL_YELLOW 0xFF99
#define NES_RED 0xFB8D
90 changes: 90 additions & 0 deletions satchat/globals.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
struct device_state deviceState;

const struct touch_button menuMainButtons[] =
{
{0, 53, 159, 93, PASTEL_GREEN, NES_RED, tb_set_menu, MENU_MESSAGES},
{162, 53, 159, 93, PASTEL_RED, NES_RED, tb_set_menu, MENU_KEYBOARD},//TEMPORARY MENU ASSIGNMENT FOR TESTING
{0, 148, 159, 93, PASTEL_BLUE, NES_RED, tb_set_menu, MENU_COORDINATES},
{162, 148, 159, 93, PASTEL_YELLOW, NES_RED, tb_set_menu, MENU_SETTINGS}
};
bool menuMainButtonStates[sizeof(menuMainButtons) / sizeof(struct touch_button)];

const struct touch_button menuMessagesButtons[] =
{
{0, 0, 106, 51, ILI9341_WHITE, NES_RED, tb_set_menu, MENU_MAIN},
{0, 53, 159, 93, PASTEL_GREEN, NES_RED, tb_set_menu, MENU_INBOX},
{162, 53, 159, 93, PASTEL_RED, NES_RED, tb_set_menu, MENU_PRESET_MESSAGES},
{0, 148, 159, 93, PASTEL_BLUE, NES_RED, tb_set_menu, MENU_OUTBOX},
{162, 148, 159, 93, PASTEL_YELLOW, NES_RED, tb_set_menu, MENU_KEYBOARD}
};
bool menuMessagesButtonStates[sizeof(menuMessagesButtons) / sizeof(struct touch_button)];

const struct touch_button menuKeyboardButtons[] =
{
{0, 0, 106, 51, ILI9341_WHITE, NES_RED, tb_set_menu, MENU_MESSAGES},
{9, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '1'},
{35, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '2'},
{61, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '3'},
{87, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '4'},
{113, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '5'},
{139, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '6'},
{165, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '7'},
{191, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '8'},
{217, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '9'},
{243, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '0'},
{269, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '-'},
{295, 111, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '='},
{22, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'q'},
{48, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'w'},
{74, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'e'},
{100, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'r'},
{126, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 't'},
{152, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'y'},
{178, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'u'},
{204, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'i'},
{230, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'o'},
{256, 137, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'p'},
{282, 137, 38, 25, PASTEL_YELLOW, NES_RED, tb_key_backspace, NULL},//BACKSPACE
{1, 163, 32, 25, PASTEL_YELLOW, NES_RED, tb_key_caps, NULL},//CAPS
{35, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'a'},
{61, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 's'},
{87, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'd'},
{113, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'f'},
{139, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'g'},
{165, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'h'},
{191, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'j'},
{217, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'k'},
{243, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'l'},
{269, 163, 25, 25, PASTEL_YELLOW, NES_RED, tb_key_enter, NULL},//ENTER
{22, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key_shift, NULL},//SHIFT
{48, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'z'},
{74, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'x'},
{100, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'c'},
{126, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'v'},
{152, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'b'},
{178, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'n'},
{204, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, 'm'},
{230, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, ','},
{256, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '.'},
{282, 189, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '/'},
{35, 215, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, ';'},
{61, 215, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '\''},
{87, 215, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '`'},
{113, 215, 129, 25, PASTEL_YELLOW, NES_RED, tb_key, ' '},//SPACE
{243, 215, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, '['},
{269, 215, 25, 25, PASTEL_YELLOW, NES_RED, tb_key, ']'}
};
bool menuKeyboardButtonStates[sizeof(menuKeyboardButtons) / sizeof(struct touch_button)];

const struct menu_buttons menuButtons[MENU_COUNT] =
{
{NULL, NULL, 0},//MENU_NONE
{menuMainButtons, menuMainButtonStates, sizeof(menuMainButtons) / sizeof(struct touch_button)};//MENU_MAIN
{NULL, NULL, 0},//MENU_SETTINGS
{NULL, NULL, 0},//MENU_COORDINATES
{menuMessagesButtons, menuMessagesButtonStates, sizeof(menuMessagesButtons) / sizeof(struct touch_button)},//MENU_MESSAGES
{menuKeyboardButtons, menuKeyboardButtonStates, sizeof(menuKeyboardButtons) / sizeof(struct touch_button)},//MENU_KEYBOARD
{NULL, NULL, 0},//MENU_INBOX
{NULL, NULL, 0},//MENU_OUTBOX
{NULL, NULL, 0}//MENU_PRESET_MESSAGES
};
Loading