v0.9.2 - Ongoing
================
+- Added ISL12022M RTC Driver (/drivers/rtc/isl12022m)
+- Fixed a bug drawing filled circles with lcdDrawVLine
+- Added CLI command to toggle LCD backlight
+- Added rounded rectangle command to CLI
- Added CFG_INTERFACE_DROPCR to projectconfig.h to
ignore CR (\r) characters in incoming data for
the CLI
OBJS += cmd_chibi_addr.o cmd_chibi_tx.o cmd_uart.o
OBJS += cmd_i2ceeprom_read.o cmd_i2ceeprom_write.o cmd_lm75b_gettemp.o
OBJS += cmd_sysinfo.o cmd_sd_dir.o cmd_tswait.o cmd_orientation.o
-OBJS += cmd_tsthreshhold.o
+OBJS += cmd_tsthreshhold.o cmd_backlight.o
VPATH += project/commands/drawing
OBJS += cmd_button.o cmd_circle.o cmd_clear.o cmd_line.o cmd_pixel.o
VPATH += drivers/sensors/lm75b
OBJS += lm75b.o
+# ISL12022M RTC
+VPATH += drivers/rtc/isl12022m
+OBJS += isl12022m.o
+
# TFT LCD support
VPATH += drivers/lcd/tft drivers/lcd/tft/hw drivers/lcd/tft/fonts
VPATH += drivers/lcd/tft/dialogues
<?xml version="1.0" encoding="utf-8"?>
-<Session Name="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\build\codelite\LPC1343 Workspace.workspace">
- <int Value="2" Name="m_selectedTab"/>
- <wxString Value="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\build\codelite\LPC1343 Workspace.workspace" Name="m_workspaceName"/>
+<Session Name="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\build\codelite\LPC1343 Workspace.workspace">
+ <int Value="1" Name="m_selectedTab"/>
+ <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\build\codelite\LPC1343 Workspace.workspace" Name="m_workspaceName"/>
<TabInfoArray Name="TabInfoArray">
<TabInfo>
- <wxString Value="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" Name="FileName"/>
- <int Value="0" Name="FirstVisibleLine"/>
- <int Value="35" Name="CurrentLine"/>
+ <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\Makefile" Name="FileName"/>
+ <int Value="81" Name="FirstVisibleLine"/>
+ <int Value="54" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
- <wxString Value="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\Makefile" Name="FileName"/>
- <int Value="0" Name="FirstVisibleLine"/>
- <int Value="11" Name="CurrentLine"/>
- <wxArrayString Name="Bookmarks"/>
- </TabInfo>
- <TabInfo>
- <wxString Value="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\drawing.c" Name="FileName"/>
- <int Value="1123" Name="FirstVisibleLine"/>
- <int Value="1146" Name="CurrentLine"/>
+ <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\project\commands\cmd_uart.c" Name="FileName"/>
+ <int Value="60" Name="FirstVisibleLine"/>
+ <int Value="89" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
</TabInfoArray>
<File Name="../../drivers/dac/mcp4725/mcp4725.h"/>
</VirtualDirectory>
</VirtualDirectory>
+ <VirtualDirectory Name="rtc">
+ <VirtualDirectory Name="isl12022m">
+ <File Name="../../drivers/rtc/isl12022m/isl12022m.c"/>
+ <File Name="../../drivers/rtc/isl12022m/isl12022m.h"/>
+ </VirtualDirectory>
+ </VirtualDirectory>
</VirtualDirectory>
<VirtualDirectory Name="lpc1xxx">
<File Name="../../lpc1xxx/linkscript.ld"/>
<File Name="../../project/commands/drawing/cmd_orientation.c"/>
<File Name="../../project/commands/drawing/cmd_rectangle.c"/>
<File Name="../../project/commands/drawing/cmd_tsthreshhold.c"/>
+ <File Name="../../project/commands/drawing/cmd_backlight.c"/>
</VirtualDirectory>
<File Name="../../project/commands/cmd_uart.c"/>
</VirtualDirectory>
<configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
<configuration Name="Release" gcc_optimization_level="Level 1"/>
</file>
+ <file file_name="../../drivers/lcd/tft/hw/ssd1331.c">
+ <configuration Name="THUMB Flash Release" build_exclude_from_build="Yes"/>
+ <configuration Name="THUMB Flash Debug" build_exclude_from_build="Yes"/>
+ </file>
</folder>
<folder Name="fonts">
<file file_name="../../drivers/lcd/tft/fonts/veramono11.c">
<file file_name="../../drivers/dac/mcp4725/mcp4725.c"/>
</folder>
</folder>
+ <folder Name="rtc">
+ <folder Name="isl12022m">
+ <file file_name="../../drivers/rtc/isl12022m/isl12022m.c"/>
+ </folder>
+ </folder>
</folder>
<file file_name="../../sysinit.c"/>
<folder Name="project">
<file file_name="../../project/commands/drawing/cmd_orientation.c"/>
<file file_name="../../project/commands/drawing/cmd_rectangle.c"/>
<file file_name="../../project/commands/drawing/cmd_tsthreshhold.c"/>
+ <file file_name="../../project/commands/drawing/cmd_backlight.c"/>
</folder>
<file file_name="../../project/commands/cmd_uart.c"/>
</folder>
<ProjectSessionItem path="LPC1343_CodeBase" name="unnamed" />
<ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase" name="unnamed" />
<ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;core" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;core;usbcdc" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;eeprom" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;eeprom;mcp24aa" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;rtc" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;rtc;isl12022m" name="unnamed" />
</Project>
<Register1>
<RegisterWindow openNodes="GPIO2;SSP0/SSP0CR0;SSP0/SSP0CR1;SSP0/SSP0CPSR;SYSCON" binaryNodes="GPIO1/GPIO1DATA;GPIO2/GPIO2DATA;GPIO2/GPIO2DIR;GPIO3/GPIO3DATA" hiddenNodes="" unsignedNodes="" visibleGroups="GPIO2;SSP0;GPIO1;CPU;GPIO3;SCB;SYSCON" decimalNodes="" octalNodes="" asciiNodes="" />
<Watches active="0" update="Never" />
</Watch4>
<Files>
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="101" path="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="0" name="unnamed" top="84" />
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="4" debugPath="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" y="50" path="C:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" left="0" selected="1" name="unnamed" top="28" />
+ <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="44" 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:\Users\Kevin\Documents\My Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase\drivers\lcd" 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\rtc\isl12022m" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
</session>
#define FAST_MODE_PLUS 0
-#define I2C_BUFSIZE 6
+#define I2C_BUFSIZE 16
#define MAX_TIMEOUT 0x00FFFFFF
#define I2CMASTER 0x01
/**************************************************************************/
U8 chb_write(U16 addr, U8 *data, U8 len)
{
- U8 status, frm_len, hdr_len, hdr[CHB_HDR_SZ + 1];
+ // U8 status, frm_len, hdr_len, hdr[CHB_HDR_SZ + 1];
+ U8 status, frm_len, hdr[CHB_HDR_SZ + 1];
while (len > 0)
{
frm_len = (len > CHB_MAX_PAYLOAD) ? CHB_MAX_PAYLOAD : len;
// gen frame header
- hdr_len = chb_gen_hdr(hdr, addr, frm_len);
+ // hdr_len = chb_gen_hdr(hdr, addr, frm_len);
+ chb_gen_hdr(hdr, addr, frm_len);
// send data to chip
status = chb_tx(hdr, data, frm_len);
/**************************************************************************/
void chb_reg_write(U8 addr, U8 val)
{
- U8 dummy;
+ // U8 dummy;
/* Add the Register Write command to the address. */
addr |= 0xC0;
CHB_SPI_ENABLE();
/*Send Register address and write register content.*/
- dummy = chb_xfer_byte(addr);
- dummy = chb_xfer_byte(val);
+ // dummy = chb_xfer_byte(addr);
+ // dummy = chb_xfer_byte(val);
+ chb_xfer_byte(addr);
+ chb_xfer_byte(val);
CHB_SPI_DISABLE();
CHB_LEAVE_CRIT();
/**************************************************************************/
void chb_frame_write(U8 *hdr, U8 hdr_len, U8 *data, U8 data_len)
{
- U8 i, dummy;
+ //U8 i, dummy;
+ U8 i;
// dont allow transmission longer than max frame size
if ((hdr_len + data_len) > 127)
CHB_SPI_ENABLE();
// send fifo write command
- dummy = chb_xfer_byte(CHB_SPI_CMD_FW);
+ // dummy = chb_xfer_byte(CHB_SPI_CMD_FW);
+ chb_xfer_byte(CHB_SPI_CMD_FW);
// write hdr contents to fifo
for (i=0; i<hdr_len; i++)
{
- dummy = chb_xfer_byte(*hdr++);
+ // dummy = chb_xfer_byte(*hdr++);
+ chb_xfer_byte(*hdr++);
}
// write data contents to fifo
for (i=0; i<data_len; i++)
{
- dummy = chb_xfer_byte(*data++);
+ // dummy = chb_xfer_byte(*data++);
+ chb_xfer_byte(*data++);
}
// terminate spi transaction
/**************************************************************************/
void chb_ISR_Handler (void)
{
- U8 dummy, state, intp_src = 0;
+ // U8 dummy, state, intp_src = 0;
+ U8 state, intp_src = 0;
chb_pcb_t *pcb = chb_get_pcb();
CHB_ENTER_CRIT();
CHB_SPI_ENABLE();
/*Send Register address and read register content.*/
- dummy = chb_xfer_byte(IRQ_STATUS | CHB_SPI_CMD_RR);
+ // dummy = chb_xfer_byte(IRQ_STATUS | CHB_SPI_CMD_RR);
+ chb_xfer_byte(IRQ_STATUS | CHB_SPI_CMD_RR);
intp_src = chb_xfer_byte(0);
CHB_SPI_DISABLE();
#include "drivers/lcd/smallfonts.h"
// Configure the pins and initialise the LCD screen
- ssd1306Init();
+ ssd1306Init(SSD1306_INTERNALVCC);
// Render some text on the screen
ssd1306DrawString(1, 10, "5x8 System", Font_System5x8);
#define SSD1306_COMSCANDEC 0xC8
#define SSD1306_SEGREMAP 0xA0
#define SSD1306_CHARGEPUMP 0x8D
+#define SSD1306_INTERNALVCC 0x1
#define SSD1306_EXTERNALVCC 0x1
#define SSD1306_SWITCHCAPVCC 0x2
/**************************************************************************/
void drawButton(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const FONT_INFO *fontInfo, uint16_t fontHeight, uint16_t borderclr, uint16_t fillclr, uint16_t fontclr, char* text)
{
- uint16_t border, fill, font, activeborder, activefill, activefont;
-
- // Set colors
- border = COLOR_GRAY_30;
- fill = COLOR_GRAY_30;
- font = COLOR_WHITE;
- activeborder = COLOR_THEME_DEFAULT_DARKER;
- activefill = COLOR_THEME_DEFAULT_BASE;
- activefont = COLOR_BLACK;
-
// Border
drawRectangleRounded(x, y, x + width, y + height, borderclr, 5, DRAW_ROUNDEDCORNERS_ALL);
// Fill
typedef enum
{
- DRAW_ROUNDEDCORNERS_NONE,
- DRAW_ROUNDEDCORNERS_ALL,
- DRAW_ROUNDEDCORNERS_TOP,
- DRAW_ROUNDEDCORNERS_BOTTOM,
- DRAW_ROUNDEDCORNERS_LEFT,
- DRAW_ROUNDEDCORNERS_RIGHT
+ DRAW_ROUNDEDCORNERS_NONE = 0,
+ DRAW_ROUNDEDCORNERS_ALL = 1,
+ DRAW_ROUNDEDCORNERS_TOP = 2,
+ DRAW_ROUNDEDCORNERS_BOTTOM = 3,
+ DRAW_ROUNDEDCORNERS_LEFT = 4,
+ DRAW_ROUNDEDCORNERS_RIGHT = 5
} drawRoundedCorners_t;
typedef enum
/**************************************************************************/
void lcdDrawVLine(uint16_t x, uint16_t y0, uint16_t y1, uint16_t color)
{
- // Allows for slightly better performance than setting individual pixels
- lcdOrientation_t orientation = lcdOrientation;
-
- // Switch orientation
- lcdSetOrientation(orientation == LCD_ORIENTATION_PORTRAIT ? LCD_ORIENTATION_LANDSCAPE : LCD_ORIENTATION_PORTRAIT);
+ lcdOrientation_t oldOrientation = lcdOrientation;
- // Draw horizontal line like usual
- lcdDrawHLine(y0, y1, lcdGetHeight() - (x + 1), color);
+ if (oldOrientation == LCD_ORIENTATION_PORTRAIT)
+ {
+ lcdSetOrientation(LCD_ORIENTATION_LANDSCAPE);
+ lcdDrawHLine(y0, y1, lcdGetHeight() - (x + 1), color);
+ }
+ else
+ {
+ lcdSetOrientation(LCD_ORIENTATION_PORTRAIT);
+ lcdDrawHLine(lcdGetWidth() - (y0 + 1), lcdGetWidth() - (y1 + 1), x, color);
+ }
// Switch orientation back
- lcdSetOrientation(orientation);
+ lcdSetOrientation(oldOrientation);
}
/**************************************************************************/
/**************************************************************************/
void lcdDrawVLine(uint16_t x, uint16_t y0, uint16_t y1, uint16_t color)
{
- lcdOrientation_t orientation = lcdOrientation;
+ lcdOrientation_t oldOrientation = lcdOrientation;
- // Switch orientation
- lcdSetOrientation(orientation == LCD_ORIENTATION_PORTRAIT ? LCD_ORIENTATION_LANDSCAPE : LCD_ORIENTATION_PORTRAIT);
-
- // Draw horizontal line like usual
- lcdDrawHLine(y0, y1, lcdGetHeight() - (x + 1), color);
+ if (oldOrientation == LCD_ORIENTATION_PORTRAIT)
+ {
+ lcdSetOrientation(LCD_ORIENTATION_LANDSCAPE);
+ lcdDrawHLine(y0, y1, lcdGetHeight() - (x + 1), color);
+ }
+ else
+ {
+ lcdSetOrientation(LCD_ORIENTATION_PORTRAIT);
+ lcdDrawHLine(lcdGetWidth() - (y0 + 1), lcdGetWidth() - (y1 + 1), x, color);
+ }
// Switch orientation back
- lcdSetOrientation(orientation);
+ lcdSetOrientation(oldOrientation);
}
/**************************************************************************/
/**************************************************************************/
uint16_t lcdGetPixel(uint16_t x, uint16_t y)
{
- uint16_t preFetch = 0;
-
ili9328SetCursor(x, y);
ili9328WriteCmd(ILI9328_COMMANDS_WRITEDATATOGRAM);
- preFetch = ili9328ReadData();
+ // prefetch
+ ili9328ReadData();
// Eeek ... why does this need to be done twice for a proper value?!?
ili9328SetCursor(x, y);
void cmd_sysinfo(uint8_t argc, char **argv);
#ifdef CFG_TFTLCD
+void cmd_backlight(uint8_t argc, char **argv);
void cmd_button(uint8_t argc, char **argv);
void cmd_circle(uint8_t argc, char **argv);
void cmd_clear(uint8_t argc, char **argv);
void cmd_line(uint8_t argc, char **argv);
void cmd_rectangle(uint8_t argc, char **argv);
+void cmd_rectangleround(uint8_t argc, char **argv);
void cmd_pixel(uint8_t argc, char **argv);
void cmd_progress(uint8_t argc, char **argv);
void cmd_getpixel(uint8_t argc, char **argv);
{ "c", 4, 6, 0, cmd_circle , "Circle" , "'c <x> <y> <radius> <color> [<filled[0|1]> <bcolor>]'" },
{ "C", 0, 0, 0, cmd_calibrate , "Calibrate Touch Screen" , CMD_NOPARAMS },
{ "F", 0, 1, 0, cmd_clear , "Fill" , "'F [<color>]'" },
+ { "g", 2, 2, 0, cmd_getpixel , "Get Pixel" , "'g <x> <y>'" },
{ "l", 5, 7, 0, cmd_line , "Line" , "'l <x1> <y1> <x2> <y2> <color> [<empty> <solid>]'" },
+ { "L", 1, 1, 0, cmd_backlight , "Backlight" , "'L <0|1>'" },
{ "o", 0, 1, 0, cmd_orientation , "LCD Orientation" , "'o [<0|1>]'" },
{ "p", 3, 3, 0, cmd_pixel , "Draw Pixel" , "'p <x> <y> <color>'" },
{ "P", 9, 9, 0, cmd_progress , "Progress Bar" , "'P <x> <y> <w> <h> <%> <bclr> <bfillclr> <pbrdclr> <pfillclr>'" },
{ "r", 5, 7, 0, cmd_rectangle , "Rectangle" , "'r <x1> <y1> <x2> <y2> <color> [<filled[0|1]> <bcolor>]'" },
- { "R", 2, 2, 0, cmd_getpixel , "Read Pixel" , "'R <x> <y>'" },
+ { "R", 7, 7, 0, cmd_rectangleround , "Rounded Rectangle" , "'R <x1> <y1> <x2> <y2> <color> <radius> <corners>'" },
{ "s", 2, 99, 0, cmd_textw , "Text Width" , "'s <font#> <msg>'" },
{ "t", 5, 99, 0, cmd_text , "Text" , "'t <x> <y> <color> <font#> <msg>'" },
{ "T", 0, 0, 0, cmd_gettext , "Text Dialogue" , CMD_NOPARAMS },
#ifdef CFG_PRINTF_UART
uart_pcb_t *pcb = uartGetPCB();
- printf("%-25s : %d %s", "UART Baud Rate", pcb->baudrate, CFG_PRINTF_NEWLINE);
+ printf("%-25s : %u %s", "UART Baud Rate", (unsigned int)(pcb->baudrate), CFG_PRINTF_NEWLINE);
#endif
// TFT LCD Settings (if CFG_TFTLCD enabled)
// Display the current baud rate
#ifdef CFG_PRINTF_UART
uart_pcb_t *pcb = uartGetPCB();
- printf("%d%s", pcb->baudrate, CFG_PRINTF_NEWLINE);
+ printf("%u%s", (unsigned int)(pcb->baudrate), CFG_PRINTF_NEWLINE);
#else
- printf("UART not initialised (using USBCDC)%s", CFG_PRINTF_NEWLINE);
+ // Try to get UART from EEPROM
+ uint32_t uartEEPROM = eepromReadU32(CFG_EEPROM_UART_SPEED);
+ if ((uartEEPROM < 9600) || (uartEEPROM > 115200))
+ {
+ printf("UART not set in EEPROM%s", CFG_PRINTF_NEWLINE);
+ }
+ else
+ {
+ printf("%u%s", uartEEPROM, CFG_PRINTF_NEWLINE);
+ }
#endif
}
}
}
}
+/**************************************************************************/
+/*!
+ Displays a rectangle with rounded corners on the LCD.
+*/
+/**************************************************************************/
+void cmd_rectangleround(uint8_t argc, char **argv)
+{
+ int32_t x1, y1, x2, y2, c, radius, corners;
+
+ // Convert supplied parameters
+ getNumber (argv[0], &x1);
+ getNumber (argv[1], &y1);
+ getNumber (argv[2], &x2);
+ getNumber (argv[3], &y2);
+ getNumber (argv[4], &c);
+ getNumber (argv[5], &radius);
+ getNumber (argv[6], &corners);
+
+ // ToDo: Validate data!
+ if (c < 0 || c > 0xFFFF)
+ {
+ printf("Invalid Color%s", CFG_PRINTF_NEWLINE);
+ return;
+ }
+
+ if ((radius == 0) || (corners == 0) || (corners > 5))
+ {
+ drawRectangleFilled(x1, y1, x2, y2, (uint16_t)c);
+ }
+ else
+ {
+ drawRectangleRounded(x1, y1, x2, y2, (uint16_t)c, radius, corners);
+ }
+}
+
#endif
#include "drivers/lcd/tft/drawing.h"
#include "drivers/lcd/tft/fonts/dejavusans9.h"
+ // Only include this w/UART since there isn't enough space otherwise!
+ #ifdef CFG_PRINTF_UART
+ #include "drivers/lcd/tft/fonts/dejavusansmono8.h"
+ #include "drivers/lcd/tft/fonts/dejavusansbold9.h"
+ #endif
+
/**************************************************************************/
/*!
Displays the supplied text on the LCD.
}
*data_ptr++ = '\0';
- // Only Vera Mono 9 is used by default
- drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSans9ptFontInfo, (char *)&data);
+ // Only include this w/UART since there isn't enough space otherwise!
+ #ifdef CFG_PRINTF_UART
+ switch (font)
+ {
+ case 1: // DejaVu Sans Mono 8
+ drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSansMono8ptFontInfo, (char *)&data);
+ break;
+ case 2: // DejaVu Sans Bold 9
+ drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSansBold9ptFontInfo, (char *)&data);
+ break;
+ default: // DejaVu Sans 9
+ drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSans9ptFontInfo, (char *)&data);
+ break;
+ }
+ #else
+ // Always use Vera Mono 9 is used by default
+ drawString((uint16_t)x, (uint16_t)y, (uint16_t)color, &dejaVuSans9ptFontInfo, (char *)&data);
+ #endif
}
#endif
#include "drivers/lcd/tft/drawing.h"
#include "drivers/lcd/tft/fonts/dejavusans9.h"
+ // Only include this w/UART since there isn't enough space otherwise!
+ #ifdef CFG_PRINTF_UART
+ #include "drivers/lcd/tft/fonts/dejavusansmono8.h"
+ #include "drivers/lcd/tft/fonts/dejavusansbold9.h"
+ #endif
+
/**************************************************************************/
/*!
Returns the width of the supplied text in pixels.
}
*data_ptr++ = '\0';
- // User Vera Mono 9 by default for now
- printf("%d %s", drawGetStringWidth(&dejaVuSans9ptFontInfo, data), CFG_PRINTF_NEWLINE);
+ // Only include this w/UART since there isn't enough space otherwise!
+ #ifdef CFG_PRINTF_UART
+ switch (font)
+ {
+ case 1: // DejaVu Sans Mono 8
+ printf("%d %s", drawGetStringWidth(&dejaVuSansMono8ptFontInfo, data), CFG_PRINTF_NEWLINE);
+ break;
+ case 2: // DejaVu Sans Bold 9
+ printf("%d %s", drawGetStringWidth(&dejaVuSansBold9ptFontInfo, data), CFG_PRINTF_NEWLINE);
+ break;
+ default: // DejaVu Sans 9
+ printf("%d %s", drawGetStringWidth(&dejaVuSans9ptFontInfo, data), CFG_PRINTF_NEWLINE);
+ break;
+ }
+ #else
+ // Always use DejaVu Sans 9 by default
+ printf("%d %s", drawGetStringWidth(&dejaVuSans9ptFontInfo, data), CFG_PRINTF_NEWLINE);
+ #endif
+
return;
}
if (error == TS_ERROR_NONE)
{
// A valid touch event occurred ... parse data
- printf("%d, %d%s",(int)data.xlcd, (int)data.ylcd, CFG_PRINTF_NEWLINE);
+ printf("%d,%d%s",(int)data.xlcd, (int)data.ylcd, CFG_PRINTF_NEWLINE);
}
else
{
// Display error code
- printf("%d %s", (int)error, CFG_PRINTF_NEWLINE);
+ printf("%d%s", (int)error, CFG_PRINTF_NEWLINE);
}
return;
**************************************************************************/
+/**************************************************************************
+ I2C Addresses
+ -----------------------------------------------------------------------
+ The following addresses are used by the different I2C sensors included
+ in the code base [1]
+
+ HEX BINARY
+ ==== ========
+ ISL12022M (RTC) 0xDE 1101111x
+ ISL12022M (SRAM) 0xAE 1010111x
+ LM75B 0x90 1001000x
+ MCP24AA 0xA0 1010000x
+ MCP4725 0xC0 1100000x
+ TSL2561 0x72 0111001x
+ TCS3414 0x72 0111001x
+
+ [1] Alternative addresses may exists, but the addresses listed in this
+ table are the values used in the code base
+
+ **************************************************************************/
+
+
/*=========================================================================
FIRMWARE VERSION SETTINGS
-----------------------------------------------------------------------*/
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
- #define CFG_UART_BAUDRATE (9600)
+ #define CFG_UART_BAUDRATE (57600)
#define CFG_UART_BUFSIZE (512)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN
// #define CFG_PRINTF_UART
#define CFG_PRINTF_USBCDC
- #define CFG_PRINTF_NEWLINE "\n"
+ #define CFG_PRINTF_NEWLINE "\r\n"
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
// #define CFG_PRINTF_UART
#define CFG_PRINTF_USBCDC
- #define CFG_PRINTF_NEWLINE "\n"
+ #define CFG_PRINTF_NEWLINE "\r\n"
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#ifdef CFG_BRD_LPC1343_802154USBSTICK
// #define CFG_PRINTF_UART
#define CFG_PRINTF_USBCDC
- #define CFG_PRINTF_NEWLINE "\n"
+ #define CFG_PRINTF_NEWLINE "\r\n"
#endif
/*=========================================================================*/
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "LPC1343 >> "
#define CFG_INTERFACE_SILENTMODE (0)
- #define CFG_INTERFACE_DROPCR (1)
+ #define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
- #define CFG_INTERFACE_IRQPORT (2)
- #define CFG_INTERFACE_IRQPIN (0)
+ #define CFG_INTERFACE_IRQPORT (0)
+ #define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#endif
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "LCD >> "
#define CFG_INTERFACE_SILENTMODE (0)
- #define CFG_INTERFACE_DROPCR (1)
+ #define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
- #define CFG_INTERFACE_IRQPORT (2)
- #define CFG_INTERFACE_IRQPIN (0)
+ #define CFG_INTERFACE_IRQPORT (0)
+ #define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND "?"
#define CFG_INTERFACE_SILENTMODE (1)
#define CFG_INTERFACE_DROPCR (1)
#define CFG_INTERFACE_ENABLEIRQ (1)
- #define CFG_INTERFACE_IRQPORT (2)
- #define CFG_INTERFACE_IRQPIN (0)
+ #define CFG_INTERFACE_IRQPORT (0)
+ #define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (1)
- #define CFG_INTERFACE_CONFIRMREADY (1)
+ #define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND "?"
#define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS ">"
#define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS "<"
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "CMD >> "
#define CFG_INTERFACE_SILENTMODE (0)
- #define CFG_INTERFACE_DROPCR (1)
+ #define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
- #define CFG_INTERFACE_IRQPORT (2)
- #define CFG_INTERFACE_IRQPIN (0)
+ #define CFG_INTERFACE_IRQPORT (0)
+ #define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#endif
#if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_I2CEEPROM
- #define CFG_I2CEEPROM_SIZE (4096)
+ #define CFG_I2CEEPROM_SIZE (3072)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
#define CFG_EEPROM_RESERVED (0x00FF) // Protect first 256 bytes of memory
#define CFG_EEPROM_CHIBI_IEEEADDR (uint16_t)(0x0000) // 8
#define CFG_EEPROM_CHIBI_SHORTADDR (uint16_t)(0x0009) // 2
+ #define CFG_EEPROM_UART_SPEED (uint16_t)(0x0020) // 4
#define CFG_EEPROM_TOUCHSCREEN_CALIBRATED (uint16_t)(0x0030) // 1
#define CFG_EEPROM_TOUCHSCREEN_CAL_AN (uint16_t)(0x0031) // 4
#define CFG_EEPROM_TOUCHSCREEN_CAL_BN (uint16_t)(0x0035) // 4
#define CFG_EEPROM_TOUCHSCREEN_CAL_FN (uint16_t)(0x0045) // 4
#define CFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER (uint16_t)(0x0049) // 4
#define CFG_EEPROM_TOUCHSCREEN_THRESHHOLD (uint16_t)(0x004D) // 1
- #define CFG_EEPROM_UART_SPEED (uint16_t)(0x0020) // 4
/*=========================================================================*/