A web server for monitoring and controlling a MakerBot Replicator over the USB host and ethernet.

Dependencies:   IAP NTPClient RTC mbed-rtos mbed Socket lwip-sys lwip BurstSPI

Fork of LPC1768_Mini-DK by Frank Vannieuwkerke

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.h Source File

main.h

00001 // Copyright (c) 2013, jake (at) allaboutjake (dot) com
00002 // All rights reserved.
00003 // 
00004 // Redistribution and use in source and binary forms, with or without
00005 // modification, are permitted provided that the following conditions are met:
00006 //     * Redistributions of source code must retain the above copyright
00007 //       notice, this list of conditions and the following disclaimer.
00008 //     * Redistributions in binary form must reproduce the above copyright
00009 //       notice, this list of conditions and the following disclaimer in the
00010 //       documentation and/or other materials provided with the distribution.
00011 //     * The name of the author and/or copyright holder nor the
00012 //       names of its contributors may be used to endorse or promote products
00013 //       derived from this software without specific prior written permission.
00014 // 
00015 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00016 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00017 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00018 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, AUTHOR, OR ANY CONTRIBUTORS
00019 // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
00020 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
00021 // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
00022 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00023 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
00024 // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025 
00026 // DESCRIPTION OF FILE:
00027 //
00028 // This file contains the globals and other definitions for used throughout the
00029 // firmware.
00030 //
00031 
00032 #include "mbed.h"
00033 #include "Mini_DK.h"
00034 #include "Target.h"
00035 #include "makerbot.h"
00036 #ifndef __MAIN_H__
00037 #define __MAIN_H__
00038 
00039 #define MAX_PROMPT_BUFFER_SIZE 80
00040 #define FIRMWARE_VERSION "0.2"
00041 
00042 #ifdef TARGET_MINIDK
00043 
00044     //Define the pins and objects related to the Mini_DK2 development board
00045     extern DigitalOut led1;
00046     extern DigitalOut led2;
00047     extern DigitalOut usbpwr;
00048 
00049     extern InterruptIn key1;
00050     extern InterruptIn key2;
00051 
00052 #ifdef MINIDK_HAS_LCD
00053     // TFT -> mosi, miso, sclk, cs
00054     extern SPI_TFT TFT;
00055 
00056     // ADS7843 -> mosi, miso, sclk, cs, irq, SPI_TFT
00057     //TouchScreenADS7843 TP(TP_SDI ,TP_SDO ,TP_SCK ,TP_CS ,TP_IRQ, &TFT);
00058     
00059     //The Mini_DK2 supports an LCD TFT interface, set a DISPLAY macro for printing to TFT
00060     #define DISPLAY(...) TFT.printf(##__VA_ARGS__)
00061 #else
00062     // If we're running a MINI_DK with no LCD, then redirect to the serial interface
00063     #define DISPLAY(...) pc.printf(##__VA_ARGS__)
00064 #endif
00065 
00066 #endif
00067 
00068 #ifdef TARGET_MBED
00069     extern DigitalOut led1;
00070     extern DigitalOut led2;
00071 
00072     //The stock mbed does not have a TFT display, so redirect DISLAY commands to the serial interface
00073     #define DISPLAY(...) pc.printf(##__VA_ARGS__)
00074 #endif
00075 
00076 //Declare the serial interface
00077 extern Serial pc;
00078 extern Makerbot* bot;
00079 
00080 #endif
00081