diff options
-rw-r--r-- | demos/RPi/RPi.dem.gateway.sce | 1 | ||||
-rw-r--r-- | demos/RPi/test_lcd.dem.sce | 19 | ||||
-rw-r--r-- | demos/scilab2c.dem.gateway.sce | 6 | ||||
-rw-r--r-- | jar/scilab_en_US_help.jar | bin | 11210 -> 19272 bytes | |||
-rw-r--r-- | macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci | 139 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h | 4 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h | 7 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h | 1 | ||||
-rw-r--r-- | tests/unit_tests/test_RPi/lcd.sci | 47 | ||||
-rw-r--r-- | tests/unit_tests/test_RPi/wait_and_blink.sci | 11 |
10 files changed, 226 insertions, 9 deletions
diff --git a/demos/RPi/RPi.dem.gateway.sce b/demos/RPi/RPi.dem.gateway.sce index 29d4c71..c125e9c 100644 --- a/demos/RPi/RPi.dem.gateway.sce +++ b/demos/RPi/RPi.dem.gateway.sce @@ -11,6 +11,7 @@ subdemolist = ["Wait and Blink","test_wait_and_blink.dem.sce"; + "LCD","test_lcd.dem.sce" ]; global SCI2CHOME; diff --git a/demos/RPi/test_lcd.dem.sce b/demos/RPi/test_lcd.dem.sce new file mode 100644 index 0000000..2bd1951 --- /dev/null +++ b/demos/RPi/test_lcd.dem.sce @@ -0,0 +1,19 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh, Sandeep Gupta +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +lines(0); + +global SCI2CHOME + +scilab2c(SCI2CHOME + "/tests/unit_tests/test_RPi/lcd.sci", TMPDIR,SCI2CHOME + "/tests/unit_tests/test_RPi/", "All", "make" ,"RPi", "uno"); + +editor([TMPDIR+"/main.c"]); diff --git a/demos/scilab2c.dem.gateway.sce b/demos/scilab2c.dem.gateway.sce index 7e98787..1e2a6c7 100644 --- a/demos/scilab2c.dem.gateway.sce +++ b/demos/scilab2c.dem.gateway.sce @@ -22,7 +22,7 @@ subdemolist =["Linear Algebra","LinearAlgebra/LinearAlgebra.dem.gateway.sce"; "Symbols", "Symbols.dem.sce"; "Jacobi functions","Jacobi.dem.sce"; "String Functions","string.dem.sce"; - "Ffilt coeff. of FIR low pass filter","ffilt.dem.sce"; - "Design of FIR linear phase filters using freq. samping technique","fsfirlin.dem.sce"; - "Samples of sinc function","filt_sinc.dem.sce";] + "Ffilt coeff. of FIR low pass filter","ffilt.dem.sce"; + "Design of FIR linear phase filters using freq. samping technique","fsfirlin.dem.sce"; + "Samples of sinc function","filt_sinc.dem.sce";] subdemolist(:,2) = demopath + subdemolist(:,2); diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar Binary files differindex ccb9961..90c41f4 100644 --- a/jar/scilab_en_US_help.jar +++ b/jar/scilab_en_US_help.jar diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 89ffc36..17a8ca5 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -6245,6 +6245,30 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
+//---- Class RPI_0IN_i8 ------------
+//------------------------------------
+ClassName = 'RPI_0IN_i8';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 0',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''i8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo(''+ArgSeparator+'i80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_lcd128x64setup';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
//---- Class RPI_1IN_u8_Void -------
//------------------------------------
ClassName = 'RPI_1IN_u8_Void';
@@ -6296,6 +6320,14 @@ FunctionName = 'RPI_softToneStop'; PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64clear';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64Orientation';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
//---- Class RPI_1IN_u16_Void ------
@@ -6570,6 +6602,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('u80d0'+ArgSeparator+'',ClassFileName,'file','y');
PrintStringInfo('d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
@@ -6617,6 +6650,10 @@ FunctionName = 'RPI_serialPutchar'; PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64setOrigin';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
//---- Class RPI_2IN_u8u16_Void ----
@@ -6830,9 +6867,9 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
-//---- Class RPI_2IN_u16u8_u8 -----
+//---- Class RPI_2IN_u16u8_i8 -----
//------------------------------------
-ClassName = 'RPI_2IN_u16u8_u8';
+ClassName = 'RPI_2IN_u16u8_i8';
// --- Class Annotation. ---
PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
@@ -6845,8 +6882,8 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
-PrintStringInfo('u160u80'+ArgSeparator+'u80',ClassFileName,'file','y');
-PrintStringInfo('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u160u80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'i80',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_pcf8574Setup';
@@ -6879,11 +6916,16 @@ ClassName = 'RPI_3IN_u8u8u8_Void'; PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
PrintStringInfo('NIN= 3',ClassFileName,'file','y');
-PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 0',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
// --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80u80'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('u80u80d0'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('u80d0d0'+ArgSeparator+'',ClassFileName,'file','y');
PrintStringInfo('d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
@@ -6895,6 +6937,18 @@ FunctionName = 'RPI_piGlow1'; PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_serialPutchar';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64point';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64lineTo';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
//---- Class RPI_3IN_u16u16u16_i8 --
@@ -6906,6 +6960,9 @@ PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y'); ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
PrintStringInfo('NIN= 3',ClassFileName,'file','y');
PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''i8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
// --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
@@ -6932,6 +6989,9 @@ PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y'); ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
PrintStringInfo('NIN= 3',ClassFileName,'file','y');
PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
// --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
@@ -7048,6 +7108,72 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//---------------------------------------
+//---- Class RPI_5IN_u8u8u8u8u8_Void --
+//---------------------------------------
+ClassName = 'RPI_5IN_u8u8u8u8u8_Void';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 5',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 0',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('u80u80u80u80u80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0d0d0'+ArgSeparator+'i80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_lcd128x64line';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64circle';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64putchar';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64puts';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//-----------------------------------------
+//---- Class RPI_6IN_u8u8u8u8u8u8_Void --
+//-----------------------------------------
+ClassName = 'RPI_6IN_u8u8u8u8u8u8_Void';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 6',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 0',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('u80u80u80u80u80u80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('d0d0d0d0d0d0'+ArgSeparator+'i80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_lcd128x64rectangle';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_lcd128x64ellipse';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
//------------------------------------
//---- Class RPI_10IN_u8x10_Void ---
//------------------------------------
@@ -7065,6 +7191,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('u80u80u80u80u80u80u80u80u80u80'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('u80d0d0d0d0d0d0d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
PrintStringInfo('d0d0d0d0d0d0d0d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
@@ -7081,7 +7208,7 @@ ClassName = 'RPI_13IN_u8x13_u8'; // --- Class Annotation. ---
PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
-PrintStringInfo('NIN= 10',ClassFileName,'file','y');
+PrintStringInfo('NIN= 13',ClassFileName,'file','y');
PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h index d541c9f..93bdf27 100644 --- a/src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h +++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralLCD128x64.h @@ -22,13 +22,17 @@ extern "C" { int8 RPI_lcd128x64setup(void); void u8RPI_lcd128x64clears(uint8 colour); void u8RPI_lcd128x64Orientations(uint8 orientation); + void u8RPI_lcd128x64setOrigins(uint8 x, uint8 y); + void u8RPI_lcd128x64points(uint8 x, uint8 y, uint8 colour); void u8RPI_lcd128x64lineTos(uint8 x, uint8 y, uint8 colour); + void u8RPI_lcd128x64lines(uint8 x0, uint8 y0, uint8 x1, uint8 y1, uint8 colour); void u8RPI_lcd128x64circles(uint8 x, uint8 y, uint8 r, uint8 colour, uint8 filled); void u8RPI_lcd128x64putchars(uint8 x, uint8 y, uint8 c, uint8 bgCol, uint8 fgCol); void u8RPI_lcd128x64putss(uint8 x, uint8 y, char *str,int size, uint8 bgCol, uint8 fgCol); + void u8RPI_lcd128x64rectangles(uint8 x1, uint8 y1, uint8 x2, uint8 y2, uint8 colour, uint8 filled); void u8RPI_lcd128x64ellipses(uint8 cx, uint8 cy, uint8 xRadius, uint8 yRadius, uint8 colour, uint8 filled); diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h index e6dcb7d..803f93e 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h @@ -21,18 +21,22 @@ extern "C" { #endif #define u80u80u80u80u80u80u80u80u80u80RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdCharDefs(fd,index,d0,d1,d2,d3,d4,d5,d6,d7); +#define u80d0d0d0d0d0d0d0d0d0RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdCharDefs(fd,index,d0,d1,d2,d3,d4,d5,d6,d7); #define d0d0d0d0d0d0d0d0d0d0RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdCharDefs(fd,index,d0,d1,d2,d3,d4,d5,d6,d7); #define u80RPI_lcdClear(fd) u8RPI_lcdClears(fd); #define d0RPI_lcdClear(fd) u8RPI_lcdClears(fd); #define u80u80RPI_lcdCursorBlink(fd,state) u8RPI_lcdCursorBlinks(fd,state); +#define u80d0RPI_lcdCursorBlink(fd,state) u8RPI_lcdCursorBlinks(fd,state); #define d0d0RPI_lcdCursorBlink(fd,state) u8RPI_lcdCursorBlinks(fd,state); #define u80u80RPI_lcdCursor(fd,state) u8RPI_lcdCursors(fd,state); +#define u80d0RPI_lcdCursor(fd,state) u8RPI_lcdCursors(fd,state); #define d0d0RPI_lcdCursor(fd,state) u8RPI_lcdCursors(fd,state); #define u80u80RPI_lcdDisplay(fd,state) u8RPI_lcdDisplays(fd,state); +#define u80d0RPI_lcdDisplay(fd,state) u8RPI_lcdDisplays(fd,state); #define d0d0RPI_lcdDisplay(fd,state) u8RPI_lcdDisplays(fd,state); #define u80RPI_lcdHome(fd) u8RPI_lcdHomes(fd); @@ -42,12 +46,15 @@ extern "C" { #define d0d0d0d0d0d0d0d0d0d0d0d0d0RPI_lcdIniti80(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdInits(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7); #define u80u80u80RPI_lcdPosition(fd,row,col) u8RPI_lcdPositions(fd,row,col); +#define u80d0d0RPI_lcdPosition(fd,row,col) u8RPI_lcdPositions(fd,row,col); #define d0d0d0RPI_lcdPosition(fd,row,col) u8RPI_lcdPositions(fd,row,col); #define u80u80RPI_lcdPutchar(fd,char) u8RPI_lcdPutchars(fd,char); +#define u80d0RPI_lcdPutchar(fd,char) u8RPI_lcdPutchars(fd,char); #define d0d0RPI_lcdPutchar(fd,char) u8RPI_lcdPutchars(fd,char); #define u80u80RPI_lcdSendCommand(fd,cmd) u8RPI_lcdSendCommands(fd,cmd); +#define u80d0RPI_lcdSendCommand(fd,cmd) u8RPI_lcdSendCommands(fd,cmd); #define d0d0RPI_lcdSendCommand(fd,cmd) u8RPI_lcdSendCommands(fd,cmd); #define u80g2RPI_lcdPuts(fd,msg,size) u8RPI_lcdPutss(fd,msg,size[1]);; diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h index 77cc433..8bb4b17 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h @@ -33,6 +33,7 @@ extern "C" { #define u80u80u80RPI_lcd128x64point(x,y,colour) u8RPI_lcd128x64points(x,y,colour); #define d0d0d0RPI_lcd128x64point(x,y,colour) u8RPI_lcd128x64points(x,y,colour); + #define u80u80u80RPI_lcd128x64lineTo(x,y,colour) u8RPI_lcd128x64lineTos(x,y,colour); #define d0d0d0RPI_lcd128x64lineTo(x,y,colour) u8RPI_lcd128x64lineTos(x,y,colour); diff --git a/tests/unit_tests/test_RPi/lcd.sci b/tests/unit_tests/test_RPi/lcd.sci new file mode 100644 index 0000000..984ecbb --- /dev/null +++ b/tests/unit_tests/test_RPi/lcd.sci @@ -0,0 +1,47 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function lcd() + raspi("10.42.0.144","panda","pi"); // setup connection to Pi + RPI_pinNumbering("wiringpi"); // initialize pin numbering + // LCD connections: + // 2 rows + // 16 columns + // 8 bits + // wiringPi pin 28 - rs + // wiringPi pin 29 - strobe/E + // wiringPi pins 0-7 - lcd data pins 0 to 7 + // + + fd=RPI_lcdInit(2,16,8,28,29,0,1,2,3,4,5,6,7) // initialize lcd with the above mentioned connections + RPI_lcdDisplay(fd,1) // switch on display + RPI_lcdCursor(fd,1) // show the cursor + RPI_lcdCursorBlink(fd,1) // blink the cursor + RPI_lcdPrintf(fd,"The Elder") // print to lcd + RPI_lcdPosition(fd,0,1) // Goto second row first column + RPI_lcdPrintf(fd,"Scrolls V Skyrim") // print to lcd + RPI_lcdHome(fd) // goto first row first column (0,0) + RPI_lcdClear(fd) // clear the lcd + RPI_lcdPrintf(fd,"Volume: ") // print character corresponding to number 125 + RPI_lcdCharDef(fd,0,0,0,0,0,0,0,0,255) // define a custom character at position 0 + RPI_lcdCharDef(fd,1,0,0,0,0,0,0,255,255) // define a custom character at position 1 + RPI_lcdCharDef(fd,2,0,0,0,0,0,255,255,255) + RPI_lcdCharDef(fd,3,0,0,0,0,255,255,255,255) + RPI_lcdCharDef(fd,4,0,0,0,255,255,255,255,255) + RPI_lcdCharDef(fd,5,0,0,255,255,255,255,255,255) + RPI_lcdCharDef(fd,6,0,255,255,255,255,255,255,255) + RPI_lcdCharDef(fd,7,255,255,255,255,255,255,255,255) + for i=0:7:1 + RPI_lcdPutchar(fd,1) // print the custom characters + end + disp("Demo completed successfully.") + raspi_close(); // close the opened connection +endfunction diff --git a/tests/unit_tests/test_RPi/wait_and_blink.sci b/tests/unit_tests/test_RPi/wait_and_blink.sci index 099feaa..7f77ad0 100644 --- a/tests/unit_tests/test_RPi/wait_and_blink.sci +++ b/tests/unit_tests/test_RPi/wait_and_blink.sci @@ -1,3 +1,14 @@ +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Jorawar Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + function wait_and_blink() raspi("10.42.0.144","panda","pi"); // setup connection to Pi RPI_pinNumbering("wiringpi"); // initialize pin numbering |