summaryrefslogtreecommitdiffstats
path: root/uc_str912/prj_test_lcd/src/lcd.c
diff options
context:
space:
mode:
authorBert Lange <b.lange@fzd.de>2011-11-07 15:41:50 +0100
committerBert Lange <b.lange@fzd.de>2011-11-07 15:41:50 +0100
commitd190f1c37139ec38667a3d6e566dbe1b0549f84d (patch)
tree7885f39318cb7852afc24992dd08cb6bb953ac03 /uc_str912/prj_test_lcd/src/lcd.c
parentacc2681723f43b3c8ccb29055bec9d63cb863c78 (diff)
downloadzpu-d190f1c37139ec38667a3d6e566dbe1b0549f84d.zip
zpu-d190f1c37139ec38667a3d6e566dbe1b0549f84d.tar.gz
initial commit
Diffstat (limited to 'uc_str912/prj_test_lcd/src/lcd.c')
-rw-r--r--uc_str912/prj_test_lcd/src/lcd.c93
1 files changed, 93 insertions, 0 deletions
diff --git a/uc_str912/prj_test_lcd/src/lcd.c b/uc_str912/prj_test_lcd/src/lcd.c
new file mode 100644
index 0000000..9eae1c1
--- /dev/null
+++ b/uc_str912/prj_test_lcd/src/lcd.c
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * www.propox.com
+ * MMstr912 - Minimoduł Ethernetowy z procesorem ARM9 STR912.
+ * Ethernet minimodule with ARM9 STR912 microcontroller.
+ *
+ * LCD Test - wyswietla tekst 'www.propox.com' na LCD
+ * put text 'www.propox.com' on LCD
+ *
+ * P8.0, P8.1, P8.2, P8.3 - D4, D5, D6, D7
+ * P8.4, P8.5 - RS, E
+
+ * Includes ------------------------------------------------------------------*/
+/* Pliki nagłówkowe ----------------------------------------------------------*/
+/* Library includes. */
+#include "91x_lib.h"
+#include "91x_gpio.h"
+#include "91x_map.h"
+#include "91x_scu.h"
+#include "char_code.h"
+#include "lcd_lib_91x.h"
+
+//#include <targets/STR912FW44.h> rem BLa
+
+/* Hardware Configuration */
+/* Konfiguracja sprzetu */
+void HardwareConf(void)
+{
+ //Main clock as exesternal oscillator 25MHz
+ //Główny zegar to kwarc 25MHz
+ SCU_MCLKSourceConfig(SCU_MCLK_OSC);
+ //Disable reset for GPIO8
+ //wylaczenie resetu na GPIO8
+ SCU_APBPeriphReset(__GPIO8, DISABLE);
+ //Enable clock for GPIO8
+ //Włączenie zegara na GPIO8
+ SCU_APBPeriphClockConfig(__GPIO8, ENABLE);
+}
+
+
+/* Ports Configuration */
+/* Konfiguracja protow */
+void LCD_DataLinesConfig()
+{
+ /* Private typedef */
+ /* Deklaracja struktury */
+ GPIO_InitTypeDef GPIO_InitStructure;
+
+ /* Configure D7~D4 data lines in Output Push-Pull mode */
+ /* Konfiguracja lini portu 8 jako wyjsc D7-D4 w trybie push-pull */
+ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5;
+ GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt1;
+ GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;
+ GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;
+ GPIO_Init(GPIO8, &GPIO_InitStructure);
+
+}
+
+
+int main()
+{
+u8 web[] = "www.propox.com";
+u8 title[] = "MMstr912";
+
+//Hardware Configuration
+//Konfiguracja sprzetu
+HardwareConf();
+//Ports Configuration
+//Konfiguracja portow
+LCD_DataLinesConfig();
+
+LCDinit();
+LCDcursorOFF();
+LCDGotoXY(0,0);
+LCDstring(web,14);
+delay(250000);
+LCDGotoXY(3,1);
+LCDstring(title,8);
+
+while(1)
+{
+ delay(500000);
+ LCDshiftLeft(1);
+ delay(100000);
+ LCDshiftLeft(1);
+
+ delay(500000);
+ LCDshiftRight(1);
+ delay(100000);
+ LCDshiftRight(1);
+}
+
+return 0;
+}
OpenPOWER on IntegriCloud