-v1.1.0 - Ongoing
+v1.1.0 - 9 April 2012
==============================================================================
BREAKING CHANGES
------------------------------------------------------------------------------
# TFT LCD support
VPATH += drivers/displays/tft drivers/displays/tft/hw
-OBJS += drawing.o touchscreen.o colors.o bmp.o
+OBJS += drawing.o touchscreen.o colors.o theme.o bmp.o
# GUI Controls
VPATH += drivers/displays/tft/controls
<TabInfoArray Name="TabInfoArray">
<TabInfo>
<wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\Makefile" Name="FileName"/>
- <int Value="5" Name="FirstVisibleLine"/>
+ <int Value="59" Name="FirstVisibleLine"/>
<int Value="84" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" Name="FileName"/>
- <int Value="623" Name="FirstVisibleLine"/>
- <int Value="646" Name="CurrentLine"/>
+ <int Value="0" Name="FirstVisibleLine"/>
+ <int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
- <int Value="14" Name="CurrentLine"/>
+ <int Value="6" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
</TabInfoArray>
<File Name="../../drivers/displays/tft/fonts/verdanabold14.c"/>
<File Name="../../drivers/displays/tft/fonts/verdanabold14.h"/>
</VirtualDirectory>
- <VirtualDirectory Name="dialogues">
- <File Name="../../drivers/displays/tft/dialogues/alphanumeric.c"/>
- <File Name="../../drivers/displays/tft/dialogues/alphanumeric.h"/>
- </VirtualDirectory>
<File Name="../../drivers/displays/tft/bmp.c"/>
<File Name="../../drivers/displays/tft/bmp.h"/>
<File Name="../../drivers/displays/tft/colors.h"/>
<VirtualDirectory Name="aa4"/>
</VirtualDirectory>
<File Name="../../drivers/displays/tft/colors.c"/>
+ <VirtualDirectory Name="controls">
+ <File Name="../../drivers/displays/tft/controls/button.c"/>
+ <File Name="../../drivers/displays/tft/controls/button.h"/>
+ <File Name="../../drivers/displays/tft/controls/hsbchart.c"/>
+ <File Name="../../drivers/displays/tft/controls/hsbchart.h"/>
+ <File Name="../../drivers/displays/tft/controls/huechart.c"/>
+ <File Name="../../drivers/displays/tft/controls/huechart.h"/>
+ <File Name="../../drivers/displays/tft/controls/label.c"/>
+ <File Name="../../drivers/displays/tft/controls/label.h"/>
+ <File Name="../../drivers/displays/tft/controls/labelcentered.c"/>
+ <File Name="../../drivers/displays/tft/controls/labelcentered.h"/>
+ <File Name="../../drivers/displays/tft/controls/progressbar.c"/>
+ <File Name="../../drivers/displays/tft/controls/progressbar.h"/>
+ </VirtualDirectory>
+ <File Name="../../drivers/displays/tft/theme.c"/>
+ <File Name="../../drivers/displays/tft/theme.h"/>
</VirtualDirectory>
<VirtualDirectory Name="bitmap">
<VirtualDirectory Name="st7565">
<file file_name="../../drivers/displays/tft/controls/label.c"/>
<file file_name="../../drivers/displays/tft/controls/labelcentered.c"/>
</folder>
+ <file file_name="../../drivers/displays/tft/theme.c"/>
</folder>
<folder Name="character">
<folder Name="samsung_20T202DA2JA">
<configuration Name="Debug" build_debug_information="Yes" c_preprocessor_definitions="DEBUG" gcc_optimization_level="None" hidden="Yes" link_include_startup_code="No"/>
<configuration Name="THUMB Flash Release" inherited_configurations="THUMB;Flash;Release"/>
<configuration Name="Release" build_debug_information="No" build_remove_unused_symbols="Yes" c_additional_options="-g1" c_preprocessor_definitions="NDEBUG;STARTUP_FROM_RESET" gcc_optimization_level="Optimize For Size" hidden="Yes" link_include_startup_code="No"/>
- <configuration Name="Common" arm_linker_allow_multiple_definition="Yes" c_user_include_directories="$(ProjectDir)/../../;$(ProjectDir)/../../Project/"/>
+ <configuration Name="Common" arm_gcc_target="arm-unknown-eabi" arm_library_optimization="Small" arm_linker_allow_multiple_definition="Yes" c_user_include_directories="$(ProjectDir)/../../;$(ProjectDir)/../../Project/"/>
</solution>
<ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers" name="unnamed" />
<ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;displays" name="unnamed" />
<ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;displays;tft" name="unnamed" />
- <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;project" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;displays;tft;controls" name="unnamed" />
</Project>
<Register1>
<RegisterWindow openNodes="GPIO2" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="CPU;CoreDebug;GPIO2" decimalNodes="" octalNodes="" asciiNodes="" />
<Watches active="0" update="Never" />
</Watch4>
<Files>
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" y="554" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" left="0" selected="0" name="unnamed" top="507" />
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="175" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="147" />
+ <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="27" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="42" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="30" />
</Files>
- <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="SEGGER J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\displays\tft\controls" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
+ <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="SEGGER J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\displays\tft" fileDialogDefaultFilter="" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
</session>
/*!
@file ssp.c
@author K. Townsend (microBuilder.eu)
- @date 22 March 2010
- @version 0.10
@section DESCRIPTION
Software License Agreement (BSD License)
- Copyright (c) 2010, microBuilder SARL
+ Copyright (c) 2012, K. Townsend
All rights reserved.
Redistribution and use in source and binary forms, with or without
gpioSetValue(SSP0_CSPORT, SSP0_CSPIN, 1);
gpioSetPullup(&IOCON_PIO0_2, gpioPullupMode_Inactive); // Board has external pull-up
- /* If SSP0CLKDIV = DIV1 -- (PCLK / (CPSDVSR × [SCR+1])) = (72,000,000 / (2 x [8 + 1])) = 4.0 MHz */
+ /* If SSP0CLKDIV = DIV1 -- (PCLK / (CPSDVSR � [SCR+1])) = (72,000,000 / (2 x [8 + 1])) = 4.0 MHz */
uint32_t configReg = ( SSP_SSP0CR0_DSS_8BIT // Data size = 8-bit
| SSP_SSP0CR0_FRF_SPI // Frame format = SPI
| SSP_SSP0CR0_SCR_8); // Serial clock rate = 8
uint16_t colorFillAlt; // Slightly lighter or darker fill for window and control backgrounds
} theme_t;
-// Grayscale Theme (Default Setting)
-theme_t themeGrayscale = { COLOR_WHITE, // Background Color
- COLOR_GRAY_128, // Border Color
- COLOR_GRAY_80, // Border Darker
- COLOR_BLACK, // Text Color
- COLOR_GRAY_50, // Alt. Text Color
- COLOR_GRAY_200, // Fill (Normal)
- COLOR_GRAY_225 }; // Fill (Alternate)
-
-// Default theme
-#define THEME_DEFAULT themeGrayscale
-
// Default font
#if CFG_TFTLCD_USEAAFONTS
#define THEME_FONT DejaVuSansCondensedBold14_AA2
#define THEME_FONT dejaVuSans9ptFontInfo
#endif
-#endif
\ No newline at end of file
+theme_t themeGetDefault(void);
+
+#endif
/**************************************************************************/
void tsCalibCenterText(char* text, uint16_t y, uint16_t color)
{
- labelcenteredRender(lcdGetWidth()/2, y, COLOR_WHITE, color, text, THEME_DEFAULT);
+ labelcenteredRender(lcdGetWidth()/2, y, COLOR_WHITE, color, text, themeGetDefault());
}
/**************************************************************************/
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-
#include "projectconfig.h"
#include "sysinit.h"
if (argc == 5)
{
// Render the button with no text
- buttonRender(x, y, w, h, (uint16_t)fontcolor, NULL, THEME_DEFAULT);
+ buttonRender(x, y, w, h, (uint16_t)fontcolor, NULL, themeGetDefault());
}
else
{
*data_ptr++ = '\0';
// Render the button with text
- buttonRender(x, y, w, h, (uint16_t)fontcolor, (char *)&data, THEME_DEFAULT);
+ buttonRender(x, y, w, h, (uint16_t)fontcolor, (char *)&data, themeGetDefault());
}
}
}
// Draw the progress bar (always use rounded corners for simplicity sake)
- progressbarRender(x, y, w, h, percent, progressfill, THEME_DEFAULT);
+ progressbarRender(x, y, w, h, percent, progressfill, themeGetDefault());
}
#endif
addition to CFG_INTERFACE_ENABLEIRQ if
this is also enabled. The character used
is defined below.
+ CFG_INTERFACE_LONGSYSINFO If this is set to 1 extra information will
+ be included in the Sys Info ('V') command
+ on the CLI. This can be useful when trying
+ to debug problems on remote HW, or with
+ unknown firmware. It will also use about
+ 0.5KB flash, though, so only enable it is
+ necessary.
NOTE: The command-line interface will use either
USB-CDC or UART depending on whether
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
+ #define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
+ #define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
#define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS ">"
#define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS "<"
#define CFG_INTERFACE_CONFIRMREADY_TEXT "."
+ #define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS ">"
#define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS "<"
#define CFG_INTERFACE_CONFIRMREADY_TEXT "."
+ #define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
+ #define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
+ #define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
+ #define CFG_INTERFACE_LONGSYSINFO (0)
#endif
/*=========================================================================*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
// #define CFG_TFTLCD
#define CFG_TFTLCD_INCLUDESMALLFONTS (0)
- #define CFG_TFTLCD_USEAAFONTS (1)
+ #define CFG_TFTLCD_USEAAFONTS (0)
#define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50)
#define CFG_TFTLCD_TS_KEYPADDELAY (100)
#endif
#if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_TFTLCD
#define CFG_TFTLCD_INCLUDESMALLFONTS (0)
- #define CFG_TFTLCD_USEAAFONTS (1)
+ #define CFG_TFTLCD_USEAAFONTS (0)
#define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50)
#define CFG_TFTLCD_TS_KEYPADDELAY (100)
#endif