2013-03-10 19:06:30 +00:00
|
|
|
/*
|
|
|
|
Serial Adapter Project: Dynamic serial TTY passthroughs
|
|
|
|
by: Mike Crosson
|
|
|
|
Nusku Networks
|
|
|
|
date: 2013/03/09
|
|
|
|
license: CC-BY SA 3.0 - Creative commons share-alike 3.0
|
|
|
|
use this code however you'd like, just keep this license and
|
|
|
|
attribute.
|
|
|
|
*/
|
2013-03-10 18:26:41 +00:00
|
|
|
|
2013-04-05 16:41:21 +00:00
|
|
|
#ifndef Project_h
|
|
|
|
#define Project_h
|
|
|
|
|
2013-04-05 15:25:23 +00:00
|
|
|
// Pinout / things that need configuration
|
|
|
|
#define okButtonPin 23
|
|
|
|
#define okButtonLed 22
|
|
|
|
#define cancelButtonPin 25
|
|
|
|
#define cancelButtonLed 24
|
|
|
|
#define pspXPin 0 // After GND / @ edge
|
|
|
|
#define pspYPin 1 // Between VCC and gnd
|
2013-04-06 06:44:59 +00:00
|
|
|
// LCD Pinouts
|
|
|
|
#define SD_CS 7 // Chip select line for SD card
|
|
|
|
#define LCD_CS 53 // Chip select line for TFT display
|
|
|
|
#define LCD_DC 9 // Data/command line for TFT
|
|
|
|
#define LCD_RST 8 // Reset line for TFT (or connect to +5V)
|
2013-04-05 15:25:23 +00:00
|
|
|
|
|
|
|
// Don't change anything below here
|
|
|
|
// -----------------------------------------------------------------------------
|
2013-03-10 18:26:41 +00:00
|
|
|
|
|
|
|
// Serial modes supported
|
|
|
|
// Abused in for loops / lookup tables -- DO NOT CHANGE none or set values
|
|
|
|
enum serialmode {
|
2013-04-06 06:51:10 +00:00
|
|
|
ttl,
|
2013-03-10 18:26:41 +00:00
|
|
|
db9_null,
|
|
|
|
cisco,
|
|
|
|
none=-1
|
|
|
|
};
|
|
|
|
|
|
|
|
// Map a mode -> text value
|
2013-03-13 20:29:54 +00:00
|
|
|
extern char* modeToText[];
|
2013-03-10 18:26:41 +00:00
|
|
|
|
2013-03-10 20:23:07 +00:00
|
|
|
// Line speeds supported
|
|
|
|
// Abused in for loops / lookup talbes -- DO NOT CHANGE none or set values
|
|
|
|
enum linespeed {
|
|
|
|
twentyFourHundredBaud,
|
|
|
|
ninetySixHundredBaud,
|
|
|
|
nineteenTwoK,
|
|
|
|
thirtyeightFourK,
|
|
|
|
fiftysevenFiveK,
|
|
|
|
oneNineteenTwoK,
|
2013-03-11 01:56:36 +00:00
|
|
|
maxlinespeed,
|
2013-03-10 20:23:07 +00:00
|
|
|
zero=-1
|
|
|
|
};
|
|
|
|
|
2013-04-06 06:51:10 +00:00
|
|
|
enum voltage {
|
|
|
|
onePointEight,
|
|
|
|
threePointThree,
|
|
|
|
five,
|
|
|
|
zero=-1
|
|
|
|
};
|
|
|
|
|
|
|
|
extern char* voltageToText[];
|
|
|
|
|
2013-03-10 20:23:07 +00:00
|
|
|
// Description / speed scruct to use in lookup table
|
|
|
|
struct linespeedinfo {
|
2013-03-11 01:56:36 +00:00
|
|
|
char* description;
|
2013-03-10 20:23:07 +00:00
|
|
|
int linespeed;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Known and supported line speeds
|
2013-03-13 20:29:54 +00:00
|
|
|
extern linespeedinfo linespeeds[];
|
2013-03-10 20:23:07 +00:00
|
|
|
|
2013-03-13 20:29:54 +00:00
|
|
|
// Mode info needed
|
|
|
|
extern serialmode currentMode;
|
|
|
|
extern serialmode selectedMode;
|
|
|
|
extern linespeed currentLineSpeed;
|
2013-04-06 06:51:10 +00:00
|
|
|
extern linespeed selectedLineSpeed;
|
|
|
|
extern voltage currentVoltage;
|
|
|
|
extern voltage selectedVoltage;
|
2013-03-10 20:23:07 +00:00
|
|
|
|
2013-04-05 16:41:21 +00:00
|
|
|
#endif
|