-v0.9.2 - Ongoing
+v0.9.3 - Ongoing
================
+- Add drawTriangle() and drawTriangleFilled() to
+ drawing.c
+- Added cpuReset() to reset the board via AIRCR
+- Removed text input dialogue from LCD CLI ('T') to
+ save a few KB. Command file still exists, just no
+ longer included in cmd_tbl.h by default.
+
+v0.9.2 - 14 June 2011
+=====================
+
- Added ISL12022M RTC Driver (/drivers/rtc/isl12022m)
- Fixed a bug drawing filled circles with lcdDrawVLine
- Added CLI command to toggle LCD backlight
OBJS += commands.o
VPATH += project/commands
-OBJS += cmd_chibi_addr.o cmd_chibi_tx.o cmd_uart.o
+OBJS += cmd_chibi_addr.o cmd_chibi_tx.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 cmd_backlight.o
+OBJS += cmd_reset.o cmd_sd_dir.o cmd_sysinfo.o cmd_uart.o
VPATH += project/commands/drawing
-OBJS += cmd_button.o cmd_circle.o cmd_clear.o cmd_line.o cmd_pixel.o
-OBJS += cmd_progress.o cmd_bmp.o cmd_gettext.o cmd_calibrate.o
-OBJS += cmd_text.o cmd_textw.o cmd_rectangle.o
+OBJS += cmd_backlight.o cmd_bmp.o cmd_button.o cmd_calibrate.o
+OBJS += cmd_circle.o cmd_clear.o cmd_line.o cmd_orientation.o
+OBJS += cmd_pixel.o cmd_progress.o cmd_rectangle.o cmd_text.o
+OBJS += cmd_textw.o cmd_tsthreshhold.o cmd_tswait.o
##########################################################################
# Optional driver files
OBJS += dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o
OBJS += dejavusansmono8.o dejavusansmonobold8.o
OBJS += veramono9.o veramonobold9.o veramono11.o veramonobold11.o
+
# LCD Driver (Only one can be included at a time!)
OBJS += ILI9328.o
# OBJS += ILI9325.o
+# OBJS += ssd1331.o
# OBJS += st7735.o
# OBJS += st7783.o
<TabInfoArray Name="TabInfoArray">
<TabInfo>
<wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\Makefile" Name="FileName"/>
- <int Value="81" Name="FirstVisibleLine"/>
- <int Value="54" Name="CurrentLine"/>
+ <int Value="33" Name="FirstVisibleLine"/>
+ <int Value="53" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
- <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"/>
+ <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\project\commands\drawing\cmd_text.c" Name="FileName"/>
+ <int Value="73" Name="FirstVisibleLine"/>
+ <int Value="86" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
</TabInfoArray>
<!DOCTYPE CrossStudio_Project_File>
<solution Name="LPC1343_CodeBase" version="2">
<project Name="LPC1343_CodeBase">
- <configuration Name="Common" Target="LPC1343" arm_architecture="v7M" arm_core_type="Cortex-M3" arm_linker_heap_size="512" arm_linker_process_stack_size="0" arm_linker_stack_size="1024" arm_simulator_memory_simulation_filename="$(TargetsDir)/LPC1000/LPC1000SimulatorMemory.dll" arm_simulator_memory_simulation_parameter="LPC13;0x8000;0x2000;0x0" arm_target_debug_interface_type="ADIv5" arm_target_loader_parameter="12000000" c_preprocessor_definitions="USE_PROCESS_STACK" c_user_include_directories="$(TargetsDir)/LPC1000/include;" link_include_standard_libraries="No" link_include_startup_code="No" linker_additional_files="$(TargetsDir)/LPC1000/lib/liblpc1000$(LibExt)$(LIB);$(TargetsDir)/LPC1000/lib/cmsis$(LibExt)$(LIB)" linker_memory_map_file="$(TargetsDir)/LPC1000/LPC1343_MemoryMap.xml" linker_output_format="bin" oscillator_frequency="12MHz" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/LPC1000/propertyGroups13xx.xml"/>
+ <configuration Name="Common" Target="LPC1343" arm_architecture="v7M" arm_core_type="Cortex-M3" arm_linker_heap_size="512" arm_linker_process_stack_size="0" arm_linker_stack_size="1024" arm_simulator_memory_simulation_filename="$(TargetsDir)/LPC1000/LPC1000SimulatorMemory.dll" arm_simulator_memory_simulation_parameter="LPC13;0x8000;0x2000;0x0" arm_target_debug_interface_type="ADIv5" arm_target_loader_parameter="12000000" c_additional_options="" c_preprocessor_definitions="USE_PROCESS_STACK" c_user_include_directories="$(TargetsDir)/LPC1000/include;" link_include_standard_libraries="No" link_include_startup_code="No" linker_additional_files="$(TargetsDir)/LPC1000/lib/liblpc1000$(LibExt)$(LIB);$(TargetsDir)/LPC1000/lib/cmsis$(LibExt)$(LIB)" linker_memory_map_file="$(TargetsDir)/LPC1000/LPC1343_MemoryMap.xml" linker_output_format="bin" oscillator_frequency="12MHz" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/LPC1000/propertyGroups13xx.xml"/>
<configuration Name="Flash" Placement="Flash" arm_target_flash_loader_file_path="$(TargetsDir)/LPC1000/Release/Loader_lpc1300.elf" arm_target_flash_loader_type="LIBMEM RPC Loader" linker_patch_build_command="$(StudioDir)/bin/crossscript "load(\"$(TargetsDir)/LPC1000/LPC1000_LinkPatch.js\");patch(\"$(TargetPath)\");"" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/flash_placement.xml" target_reset_script="FLASHReset()"/>
<configuration Name="RAM" Placement="RAM" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/ram_placement.xml" target_reset_script="SRAMReset()"/>
<folder Name="Source Files" file_name="">
<file file_name="../../project/commands/drawing/cmd_backlight.c"/>
</folder>
<file file_name="../../project/commands/cmd_uart.c"/>
+ <file file_name="../../project/commands/cmd_reset.c"/>
</folder>
<file file_name="../../project/cmd_tbl.h"/>
</folder>
<configuration Name="THUMB" Platform="ARM" arm_instruction_set="THUMB" arm_library_instruction_set="THUMB" c_preprocessor_definitions="__THUMB" hidden="Yes"/>
<configuration Name="Flash" c_preprocessor_definitions="__FLASH_BUILD" hidden="Yes"/>
<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" gcc_optimization_level="Optimize For Size" inherited_configurations="THUMB;Flash;Release"/>
+ <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" c_user_include_directories="$(ProjectDir)/../../;$(ProjectDir)/../../Project/;$(ProjectDir)/../../core/freakusb/usb/;$(ProjectDir)/../../core/freakusb/class/CDC/;$(ProjectDir)/../../core/freakusb/hw/lpc1343/"/>
</solution>
<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" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;lcd" name="unnamed" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;lcd;tft" 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="" />
</TraceWindow>
<Watch1>
<Watches active="1" update="Each Second" >
- <Watchpoint linenumber="66" radix="10" name="msTicks" expression="msTicks" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/systick/systick.c" />
- <Watchpoint linenumber="138" radix="16" name="timer32_0_counter" expression="timer32_0_counter" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/timer32/timer32.c" />
- <Watchpoint linenumber="155" radix="-1" name="xTickCount" expression="xTickCount" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
<Watchpoint linenumber="155" radix="16" name="Tick" expression="Tick" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
+ <Watchpoint linenumber="155" radix="-1" name="xTickCount" expression="xTickCount" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
+ <Watchpoint linenumber="138" radix="16" name="timer32_0_counter" expression="timer32_0_counter" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/timer32/timer32.c" />
+ <Watchpoint linenumber="66" radix="10" name="msTicks" expression="msTicks" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/systick/systick.c" />
</Watches>
</Watch1>
<Watch2>
<Watch4>
<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\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:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\rtc\isl12022m" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
+ <Files/>
+ <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="Segger J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\project\commands" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
</session>
// Setup PLL (etc.)
cpuPllSetup(CPU_MULTIPLIER_6);
}
+
+/**************************************************************************/
+/*!
+ @brief Resets the device using the AIRCR register
+*/
+/**************************************************************************/
+void cpuReset (void)
+{
+ // Reset device
+ SCB_AIRCR = SCB_AIRCR_VECTKEY_VALUE | SCB_AIRCR_SYSRESETREQ; // 0x05FA0004
+
+ // Ensure completion of memory access
+ // DSB acts as a special data synchronization memory barrier. Instructions
+ // that come after the DSB, in program order, do not execute until the DSB
+ // instruction completes. The DSB instruction completes when all explicit
+ // memory accesses before it complete.
+ __asm volatile("DSB");
+
+ // Wait for reset
+ while(1);
+}
void cpuPllSetup (cpuMultiplier_t multiplier);
void cpuInit (void);
+void cpuReset (void);
#endif
\ No newline at end of file
}
}
+/**************************************************************************/
+/*!
+ @brief Draws a triangle
+
+ @param[in] x0
+ x co-ordinate for point 0
+ @param[in] y0
+ y co-ordinate for point 0
+ @param[in] x1
+ x co-ordinate for point 1
+ @param[in] y1
+ y co-ordinate for point 1
+ @param[in] x2
+ x co-ordinate for point 2
+ @param[in] y2
+ y co-ordinate for point 2
+ @param[in] color
+ Color used when drawing
+*/
+/**************************************************************************/
+void drawTriangle ( uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
+{
+ drawLine(x0, y0, x1, y1, color);
+ drawLine(x1, y1, x2, y2, color);
+ drawLine(x2, y2, x0, y0, color);
+}
+
+/**************************************************************************/
+/*!
+ @brief Draws a triangle
+
+ @param[in] x0
+ x co-ordinate for point 0
+ @param[in] y0
+ y co-ordinate for point 0
+ @param[in] x1
+ x co-ordinate for point 1
+ @param[in] y1
+ y co-ordinate for point 1
+ @param[in] x2
+ x co-ordinate for point 2
+ @param[in] y2
+ y co-ordinate for point 2
+ @param[in] color
+ Fill color
+
+ @section Example
+
+ @code
+
+ // Draw a white triangle
+ drawTriangleFilled ( 100, 10, 20, 120, 230, 290, COLOR_WHITE);
+ // Draw black circles at each point of the triangle
+ drawCircleFilled(100, 10, 2, COLOR_BLACK);
+ drawCircleFilled(20, 120, 2, COLOR_BLACK);
+ drawCircleFilled(230, 290, 2, COLOR_BLACK);
+
+ @endcode
+*/
+/**************************************************************************/
+void drawTriangleFilled ( uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
+{
+ // ToDo: re-order vertices by ascending Y values (smallest first)
+
+ int32_t dx1, dx2, dx3; // Interpolation deltas
+ int32_t sx1, sx2, sy; // Scanline co-ordinates
+
+ sx1=sx2=x0 * 1000; // Use fixed point math for x axis values
+ sy=y0;
+
+ // Calculate interpolation deltas
+ if (y1-y0 > 0) dx1=((x1-x0)*1000)/(y1-y0);
+ else dx1=0;
+ if (y2-y0 > 0) dx2=((x2-x0)*1000)/(y2-y0);
+ else dx2=0;
+ if (y2-y1 > 0) dx3=((x2-x1)*1000)/(y2-y1);
+ else dx3=0;
+
+ // Render scanlines (horizontal lines are the fastest rendering method)
+ if (dx1 > dx2)
+ {
+ for(; sy<=y1; sy++, sx1+=dx2, sx2+=dx1)
+ {
+ drawLine(sx1/1000, sy, sx2/1000, sy, color);
+ }
+ sx2 = x1*1000;
+ sy = y1;
+ for(; sy<=y2; sy++, sx1+=dx2, sx2+=dx3)
+ {
+ drawLine(sx1/1000, sy, sx2/1000, sy, color);
+ }
+ }
+ else
+ {
+ for(; sy<=y1; sy++, sx1+=dx1, sx2+=dx2)
+ {
+ drawLine(sx1/1000, sy, sx2/1000, sy, color);
+ }
+ sx1 = x1*1000;
+ sy = y1;
+ for(; sy<=y2; sy++, sx1+=dx3, sx2+=dx2)
+ {
+ drawLine(sx1/1000, sy, sx2/1000, sy, color);
+ }
+ }
+}
+
/**************************************************************************/
/*!
@brief Converts a 24-bit RGB color to an equivalent 16-bit RGB565 value
void drawRectangle ( uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color );
void drawRectangleFilled ( uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color );
void drawRectangleRounded ( uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color, uint16_t radius, drawRoundedCorners_t corners );
+void drawTriangle ( uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
+void drawTriangleFilled ( uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
void drawString ( uint16_t x, uint16_t y, uint16_t color, const FONT_INFO *fontInfo, char *str );
uint16_t drawGetStringWidth ( const FONT_INFO *fontInfo, char *str );
void drawProgressBar ( uint16_t x, uint16_t y, uint16_t width, uint16_t height, drawRoundedCorners_t borderCorners, drawRoundedCorners_t progressCorners, uint16_t borderColor, uint16_t borderFillColor, uint16_t progressBorderColor, uint16_t progressFillColor, uint8_t progress );
// Function prototypes for the command table
void cmd_help(uint8_t argc, char **argv); // handled by core/cmd/cmd.c
void cmd_sysinfo(uint8_t argc, char **argv);
+void cmd_reset(uint8_t argc, char **argv);
#ifdef CFG_TFTLCD
void cmd_backlight(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);
-void cmd_gettext(uint8_t argc, char **argv);
void cmd_calibrate(uint8_t argc, char **argv);
void cmd_orientation(uint8_t argc, char **argv);
void cmd_text(uint8_t argc, char **argv);
// command name, min args, max args, hidden, function name, command description, syntax
{ "?", 0, 0, 0, cmd_help , "Help" , CMD_NOPARAMS },
{ "V", 0, 0, 0, cmd_sysinfo , "System Info" , CMD_NOPARAMS },
+ { "Z", 0, 0, 0, cmd_reset , "Reset" , CMD_NOPARAMS },
#ifdef CFG_I2CEEPROM
{ "e", 1, 1, 0, cmd_i2ceeprom_read , "EEPROM Read" , "'e <addr>'" },
{ "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 },
{ "W", 0, 1, 0, cmd_tswait , "Wait for Touch" , "'W [<ms>]'" },
{ "x", 0, 1, 0, cmd_tsthreshhold , "Touch Threshold" , "'x [<0..254>]'" },
#endif
}
else
{
- printf("%u%s", uartEEPROM, CFG_PRINTF_NEWLINE);
+ printf("%u%s", (unsigned int)uartEEPROM, CFG_PRINTF_NEWLINE);
}
#endif
}
are using by enabling one of the following definitions. The code base
will then try to configure itself accordingly for that board.
-----------------------------------------------------------------------*/
- #define CFG_BRD_LPC1343_REFDESIGN
- // #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
+ // #define CFG_BRD_LPC1343_REFDESIGN
+ #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
// #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
// #define CFG_BRD_LPC1343_802154USBSTICK
/*=========================================================================*/
-----------------------------------------------------------------------*/
#define CFG_FIRMWARE_VERSION_MAJOR (0)
#define CFG_FIRMWARE_VERSION_MINOR (9)
- #define CFG_FIRMWARE_VERSION_REVISION (2)
+ #define CFG_FIRMWARE_VERSION_REVISION (3)
/*=========================================================================*/
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
// #define CFG_USBHID
// #define CFG_USBCDC
- #define CFG_USBCDC_BAUDRATE (115200)
+ #define CFG_USBCDC_BAUDRATE (57600)
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif