<?xml version="1.0" encoding="UTF-8"?>
<Session Name="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\build\codelite\LPC1343 Workspace.workspace">
- <int Value="1" Name="m_selectedTab"/>
+ <int Value="0" 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:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\Makefile" Name="FileName"/>
- <int Value="69" Name="FirstVisibleLine"/>
- <int Value="73" Name="CurrentLine"/>
- <wxArrayString Name="Bookmarks"/>
- </TabInfo>
<TabInfo>
<wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" Name="FileName"/>
<int Value="1" Name="FirstVisibleLine"/>
- <int Value="13" Name="CurrentLine"/>
+ <int Value="2" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
</TabInfoArray>
<SerializedObject Name="m_breakpoints">
- <long Value="0" Name="Count"/>
+ <long Value="2" Name="Count"/>
+ <SerializedObject Name="Breakpoint0">
+ <wxString Value="C:\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" Name="file"/>
+ <int Value="60" Name="lineno"/>
+ <wxString Value="" Name="function_name"/>
+ <wxString Value="" Name="memory_address"/>
+ <int Value="1" Name="bp_type"/>
+ <int Value="0" Name="watchpoint_type"/>
+ <wxString Value="" Name="watchpt_data"/>
+ <CData Name="commandlist"/>
+ <bool Value="0" Name="regex"/>
+ <bool Value="0" Name="is_temp"/>
+ <bool Value="1" Name="is_enabled"/>
+ <int Value="0" Name="ignore_number"/>
+ <wxString Value="" Name="conditions"/>
+ <int Value="1" Name="origin"/>
+ </SerializedObject>
+ <SerializedObject Name="Breakpoint1">
+ <wxString Value="C:\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" Name="file"/>
+ <int Value="60" Name="lineno"/>
+ <wxString Value="" Name="function_name"/>
+ <wxString Value="" Name="memory_address"/>
+ <int Value="1" Name="bp_type"/>
+ <int Value="0" Name="watchpoint_type"/>
+ <wxString Value="" Name="watchpt_data"/>
+ <CData Name="commandlist"/>
+ <bool Value="0" Name="regex"/>
+ <bool Value="0" Name="is_temp"/>
+ <bool Value="1" Name="is_enabled"/>
+ <int Value="0" Name="ignore_number"/>
+ <wxString Value="" Name="conditions"/>
+ <int Value="0" Name="origin"/>
+ </SerializedObject>
</SerializedObject>
</Session>
<file file_name="../../drivers/sensors/pn532/helpers/pn532_mifare_classic.c"/>
<file file_name="../../drivers/sensors/pn532/helpers/pn532_mifare_ultralight.c"/>
</folder>
+ <file file_name="../../drivers/sensors/pn532/pn532_bus_i2c.c">
+ <configuration Name="THUMB Flash Debug" build_exclude_from_build="Yes"/>
+ </file>
</folder>
<folder Name="tsl2561">
<file file_name="../../drivers/sensors/tsl2561/tsl2561.c">
<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 Release" build_exclude_from_build="No"/>
+ <configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
+ </file>
+ <file file_name="../../drivers/lcd/tft/hw/ssd1351.c">
<configuration Name="THUMB Flash Debug" build_exclude_from_build="Yes"/>
+ <configuration Name="THUMB Flash Release" build_exclude_from_build="Yes"/>
</file>
- <file file_name="../../drivers/lcd/tft/hw/ssd1351.c"/>
</folder>
<folder Name="fonts">
<file file_name="../../drivers/lcd/tft/fonts/dejavusansmono8.c">
<folder Name="isl12022m">
<file file_name="../../drivers/rtc/isl12022m/isl12022m.c"/>
</folder>
+ <file file_name="../../drivers/rtc/rtc.c">
+ <configuration Name="THUMB Flash Debug" build_exclude_from_build="Yes"/>
+ </file>
</folder>
<folder Name="spiflash">
<folder Name="w25q16bv">
</ETMWindow>
<ExecutionCountWindow/>
<Memory1>
- <MemoryWindow autoEvaluate="0" addressText="&header" numColumns="8" sizeText="sizeof(header)" dataSize="1" radix="16" addressSpace="" />
+ <MemoryWindow autoEvaluate="0" addressText="0x100003d0" numColumns="8" sizeText="12" dataSize="1" radix="16" addressSpace="" />
</Memory1>
<Memory2>
<MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
<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;drivers" 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" />
+ <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;lcd;tft;hw" name="unnamed" />
</Project>
<Register1>
<RegisterWindow openNodes="USB;USB/USBRxPLen;USB/USBTxPLen;USB/USBCtrl" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="CPU;USB" 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\main.c" y="59" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="46" />
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw\ssd1351.c" y="190" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw\ssd1351.c" left="0" selected="0" name="unnamed" top="160" />
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw\ssd1351.h" y="78" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw\ssd1351.h" left="0" selected="0" name="unnamed" top="49" />
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" y="86" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" left="0" selected="0" name="unnamed" top="86" />
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw\ssd1331.c" y="41" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw\ssd1331.c" left="0" selected="0" name="unnamed" top="15" />
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw\ssd1331.h" y="0" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw\ssd1331.h" left="0" selected="0" name="unnamed" top="21" />
+ <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="40" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="0" />
</Files>
- <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="Segger J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\lcd\tft\hw" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Debug" />
+ <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="Segger J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\sensors\pn532" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
</session>
#define FAST_MODE_PLUS 0
-#define I2C_BUFSIZE 16
+#define I2C_BUFSIZE 32
#define MAX_TIMEOUT 0x00FFFFFF
#define I2CMASTER 0x01
CMD(SSD1306_SETDISPLAYCLOCKDIV); // 0xD5
CMD(0x80); // the suggested ratio 0x80
CMD(SSD1306_SETMULTIPLEX); // 0xA8
- CMD(0x1F);
+ CMD(0x1F); // 31
CMD(SSD1306_SETDISPLAYOFFSET); // 0xD3
CMD(0x0); // no offset
CMD(SSD1306_SETSTARTLINE | 0x0); // line #0
{ CMD(0x10) }
else
{ CMD(0x14) }
+ CMD(SSD1306_MEMORYMODE); // 0x20
+ CMD(0x00); // 0x0 act like ks0108
CMD(SSD1306_SEGREMAP | 0x1);
CMD(SSD1306_COMSCANDEC);
CMD(SSD1306_SETCOMPINS); // 0xDA
else
{ CMD(0xF1) }
CMD(SSD1306_SETVCOMDETECT); // 0xDB
- CMD(0x40); // 0x20 is default?
+ CMD(0x40);
CMD(SSD1306_DISPLAYALLON_RESUME); // 0xA4
CMD(SSD1306_NORMALDISPLAY); // 0xA6
#endif
CMD(SSD1306_SETDISPLAYCLOCKDIV); // 0xD5
CMD(0x80); // the suggested ratio 0x80
CMD(SSD1306_SETMULTIPLEX); // 0xA8
- CMD(0x3F);
+ CMD(0x3F); // 63
CMD(SSD1306_SETDISPLAYOFFSET); // 0xD3
CMD(0x0); // no offset
CMD(SSD1306_SETSTARTLINE | 0x0); // line #0
{ CMD(0x10) }
else
{ CMD(0x14) }
+ CMD(SSD1306_MEMORYMODE); // 0x20
+ CMD(0x00); // 0x0 act like ks0108
CMD(SSD1306_SEGREMAP | 0x1);
CMD(SSD1306_COMSCANDEC);
CMD(SSD1306_SETCOMPINS); // 0xDA
else
{ CMD(0xF1) }
CMD(SSD1306_SETVCOMDETECT); // 0xDB
- CMD(0x40); // 0x20 is default?
+ CMD(0x40);
CMD(SSD1306_DISPLAYALLON_RESUME); // 0xA4
CMD(SSD1306_NORMALDISPLAY); // 0xA6
#endif
#include "drivers/lcd/smallfonts.h"
// Configure the pins and initialise the LCD screen
- ssd1306Init();
-
- // Enable the backlight
- ssd1306BLEnable();
+ ssd1306Init(SSD1306_INTERNALVCC);
// Continually write some text, scrolling upward one line each time
while (1)
#define SSD1306_COMSCANDEC 0xC8
#define SSD1306_SEGREMAP 0xA0
#define SSD1306_CHARGEPUMP 0x8D
-#define SSD1306_INTERNALVCC 0x1
#define SSD1306_EXTERNALVCC 0x1
+#define SSD1306_INTERNALVCC 0x2
#define SSD1306_SWITCHCAPVCC 0x2
// Initialisation/Config Prototypes
#include "projectconfig.h"
#include "pn532.h"
-#define PN532_BUS_UART
+// #define PN532_BUS_UART
+#define PN532_BUS_I2C
#define PN532_RSTPD_PORT (2)
#define PN532_RSTPD_PIN (2)
#define PN532_EXTENDED_FRAME__DATA_MAX_LEN (264)
#define PN532_EXTENDED_FRAME__OVERHEAD (11)
#define PN532_BUFFER_LEN (PN532_EXTENDED_FRAME__DATA_MAX_LEN + PN532_EXTENDED_FRAME__OVERHEAD)
+
#define PN532_UART_BAUDRATE (115200)
+#define PN532_I2C_ADDRESS (0x48)
+#define PN532_I2C_READBIT (0x01)
// Generic interface for the different serial buses available on the PN532
void pn532_bus_HWInit(void);
#include "core/gpio/gpio.h"
#include "core/systick/systick.h"
-#include "drivers/lcd/tft/hw/ssd1351.h"
-#include "drivers/lcd/tft/drawing.h"
-
#ifdef CFG_INTERFACE
#include "core/cmd/cmd.h"
#endif
uint32_t currentSecond, lastSecond;
currentSecond = lastSecond = 0;
-
- lcdInit();
- lcdTest();
while (1)
{
if (currentSecond != lastSecond)
{
lastSecond = currentSecond;
- gpioSetValue(CFG_LED_PORT, CFG_LED_PIN, ~(gpioGetValue(CFG_LED_PORT, CFG_LED_PIN)));
+ gpioSetValue(CFG_LED_PORT, CFG_LED_PIN, !(gpioGetValue(CFG_LED_PORT, CFG_LED_PIN)));
}
// Poll for CLI input if CFG_INTERFACE is enabled in projectconfig.h
// #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
// #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
// #define CFG_BRD_LPC1343_802154USBSTICK
+ // #define CFG_BRD_LPC1343_OLIMEX_P
/*=========================================================================*/
#define CFG_UART_BAUDRATE (115200)
#define CFG_UART_BUFSIZE (512)
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ #define CFG_UART_BAUDRATE (115200)
+ #define CFG_UART_BUFSIZE (512)
+ #endif
/*=========================================================================*/
// #define CFG_SSP0_SCKPIN_2_11
#define CFG_SSP0_SCKPIN_0_6
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ #define CFG_SSP0_SCKPIN_2_11
+ // #define CFG_SSP0_SCKPIN_0_6
+ #endif
/*=========================================================================*/
#define CFG_LED_ON (0)
#define CFG_LED_OFF (1)
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ #define CFG_LED_PORT (3)
+ #define CFG_LED_PIN (2)
+ #define CFG_LED_ON (0)
+ #define CFG_LED_OFF (1)
+ #endif
/*=========================================================================*/
#define CFG_SDCARD_CDPORT (3)
#define CFG_SDCARD_CDPIN (0)
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ // #define CFG_SDCARD
+ #define CFG_SDCARD_READONLY (1) // Must be 0 or 1
+ #define CFG_SDCARD_CDPORT (3)
+ #define CFG_SDCARD_CDPIN (0)
+ #endif
/*=========================================================================*/
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ // #define CFG_USBHID
+ #define CFG_USBCDC
+ #define CFG_USBCDC_BAUDRATE (115200)
+ #define CFG_USBCDC_INITTIMEOUT (5000)
+ #define CFG_USBCDC_BUFFERSIZE (256)
+ #endif
/*=========================================================================*/
#define CFG_PRINTF_USBCDC
#define CFG_PRINTF_NEWLINE "\r\n"
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ // #define CFG_PRINTF_UART
+ #define CFG_PRINTF_USBCDC
+ #define CFG_PRINTF_NEWLINE "\r\n"
+ #endif
/*=========================================================================*/
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ #define CFG_INTERFACE
+ #define CFG_INTERFACE_MAXMSGSIZE (256)
+ #define CFG_INTERFACE_PROMPT "LPC-P1343 >> "
+ #define CFG_INTERFACE_SILENTMODE (0)
+ #define CFG_INTERFACE_DROPCR (0)
+ #define CFG_INTERFACE_ENABLEIRQ (0)
+ #define CFG_INTERFACE_IRQPORT (0)
+ #define CFG_INTERFACE_IRQPIN (7)
+ #define CFG_INTERFACE_SHORTERRORS (0)
+ #define CFG_INTERFACE_CONFIRMREADY (0)
+ #endif
/*=========================================================================*/
#define CFG_I2CEEPROM
#define CFG_I2CEEPROM_SIZE (3072)
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ // #define CFG_I2CEEPROM
+ #define CFG_I2CEEPROM_SIZE (3072)
+ #endif
/*=========================================================================*/
#define CFG_CHIBI_PROMISCUOUS (0)
#define CFG_CHIBI_BUFFERSIZE (1024)
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ // #define CFG_CHIBI
+ #define CFG_CHIBI_MODE (0) // OQPSK_868MHZ
+ #define CFG_CHIBI_POWER (0xE9) // CHB_PWR_EU2_3DBM
+ #define CFG_CHIBI_CHANNEL (0) // 868-868.6 MHz
+ #define CFG_CHIBI_PANID (0x1234)
+ #define CFG_CHIBI_PROMISCUOUS (0)
+ #define CFG_CHIBI_BUFFERSIZE (128)
+ #endif
/*=========================================================================*/
#define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50)
#define CFG_TFTLCD_TS_KEYPADDELAY (100)
#endif
+
+ #ifdef CFG_BRD_LPC1343_OLIMEX_P
+ // #define CFG_TFTLCD
+ #define CFG_TFTLCD_INCLUDESMALLFONTS (0)
+ #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50)
+ #define CFG_TFTLCD_TS_KEYPADDELAY (100)
+ #endif
/*=========================================================================*/
=========================================================================*/
-#if !defined CFG_BRD_LPC1343_REFDESIGN && !defined CFG_BRD_LPC1343_REFDESIGN_MINIMAL && !defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB && !defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART && !defined CFG_BRD_LPC1343_802154USBSTICK
+#if !defined CFG_BRD_LPC1343_REFDESIGN && \
+ !defined CFG_BRD_LPC1343_REFDESIGN_MINIMAL && \
+ !defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB && \
+ !defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART && \
+ !defined CFG_BRD_LPC1343_802154USBSTICK && \
+ !defined CFG_BRD_LPC1343_OLIMEX_P
#error "You must defined a target board (CFG_BRD_LPC1343_REFDESIGN or CFG_BRD_LPC1343_REFDESIGN_MINIMAL or CFG_BRD_LPC1343_TFTLCDSTANDALONE or CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART or CFG_BRD_LPC1343_802154USBSTICK)"
#endif
#ifdef CFG_SSD1306
#error "CFG_TFTLCD and CFG_SSD1306 can not be defined at the same time."
#endif
+ #ifdef CFG_SHARPMEM
+ #error "CFG_TFTLCD and CFG_SHARPMEM can not be defined at the same time."
+ #endif
#ifdef CFG_PWM
#error "CFG_TFTLCD and CFG_PWM can not be defined at the same time since they both use pin 1.9."
#endif
// Initialise the SSD1306 OLED display
#ifdef CFG_SSD1306
- ssd1306Init(SSD1306_SWITCHCAPVCC);
+ ssd1306Init(SSD1306_INTERNALVCC);
ssd1306ClearScreen(); // Clear the screen
#endif