@@ -1,98 +1,99 | |||
|
1 | 1 | /*------------------------------------------------------------------------------ |
|
2 | 2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
3 | 3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
4 | 4 | -- |
|
5 | 5 | -- This program is free software; you can redistribute it and/or modify |
|
6 | 6 | -- it under the terms of the GNU General Public License as published by |
|
7 | 7 | -- the Free Software Foundation; either version 3 of the License, or |
|
8 | 8 | -- (at your option) any later version. |
|
9 | 9 | -- |
|
10 | 10 | -- This program is distributed in the hope that it will be useful, |
|
11 | 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 | 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 | 13 | -- GNU General Public License for more details. |
|
14 | 14 | -- |
|
15 | 15 | -- You should have received a copy of the GNU General Public License |
|
16 | 16 | -- along with this program; if not, write to the Free Software |
|
17 | 17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 | 18 | -------------------------------------------------------------------------------*/ |
|
19 | 19 | /*-- Author : Alexis Jeandet |
|
20 | 20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #ifndef APB_LCD_DRIVER_H |
|
23 | 23 | #define APB_LCD_DRIVER_H |
|
24 | 24 | |
|
25 | 25 | #define readyFlag 1024 |
|
26 | 26 | #define lcdCharCnt 80 |
|
27 | 27 | |
|
28 | 28 | |
|
29 | 29 | /** @todo implemente some shift functions */ |
|
30 | 30 | |
|
31 | 31 | |
|
32 | 32 | /*=================================================== |
|
33 | 33 | T Y P E S D E F |
|
34 | 34 | ====================================================*/ |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | |
|
38 | 38 | /** error type used for most of lcd functions */ |
|
39 | 39 | typedef int lcd_err; |
|
40 | 40 | |
|
41 | 41 | /** lcd error ennum for higher abstraction level when error decoding */ |
|
42 | 42 | enum lcd_error |
|
43 | 43 | { |
|
44 | 44 | lcd_error_no_error, /**< no error append while function execution */ |
|
45 | 45 | lcd_error_not_ready, /**< the lcd isn't available*/ |
|
46 | 46 | lcd_error_not_openned, /**< the device guiven to the function isn't opened*/ |
|
47 | 47 | lcd_error_too_long /**< the string guiven to the lcd is bigger than the lcd frame buffer memory */ |
|
48 | 48 | }; |
|
49 | 49 | |
|
50 | 50 | |
|
51 | 51 | /** for each command sended to the lcd driver a time should be guiven according to the lcd datasheet */ |
|
52 | 52 | enum lcd_CMD_time |
|
53 | 53 | { |
|
54 | 54 | lcd_4us = 0x0FF, |
|
55 | 55 | lcd_100us = 0x1FF, |
|
56 | 56 | lcd_4ms = 0x2FF, |
|
57 | 57 | lcd_20ms = 0x3FF |
|
58 | 58 | }; |
|
59 | 59 | |
|
60 | 60 | /** list of availiable lcd commands use whith an AND mask whith cmd time */ |
|
61 | 61 | enum lcd_CMD |
|
62 | 62 | { |
|
63 | 63 | CursorON = 0xF0E, |
|
64 | 64 | CursorOFF = 0xF0C |
|
65 | 65 | }; |
|
66 | 66 | |
|
67 | 67 | /** structure representing the lcd registers */ |
|
68 | 68 | struct lcd_driver |
|
69 | 69 | { |
|
70 |
int cfg_reg; /**< Configuration register composed of Ready flag [10], CMD time Value [9:8], |
|
|
70 | int cfg_reg; /**< Configuration register composed of Ready flag [10], CMD time Value [9:8], | |
|
71 | CMD to send [7:0]*/ | |
|
71 | 72 | int Frame_buff[lcdCharCnt]; /**< Frame Buffer space each address corresponds to a char on the lcd screen */ |
|
72 | 73 | }; |
|
73 | 74 | |
|
74 | 75 | typedef struct lcd_driver lcd_device; |
|
75 | 76 | |
|
76 | 77 | /*=================================================== |
|
77 | 78 | F U N C T I O N S |
|
78 | 79 | ====================================================*/ |
|
79 | 80 | |
|
80 | 81 | /** says if the lcd is busy */ |
|
81 | 82 | int lcdbusy(lcd_device * lcd); |
|
82 | 83 | |
|
83 | 84 | /** Opens and returns the counth lcd found on APB bus else NULL */ |
|
84 | 85 | lcd_device* lcdopen(int count); |
|
85 | 86 | |
|
86 | 87 | /** Sends a command to the given device, don't forget to guive the time of the cmd */ |
|
87 | 88 | lcd_err lcdsendcmd(lcd_device* lcd,int cmd); |
|
88 | 89 | |
|
89 | 90 | /** Sets a char on the given device at given position */ |
|
90 | 91 | lcd_err lcdsetchar(lcd_device* lcd,int position,const char value); |
|
91 | 92 | |
|
92 | 93 | /** Prints a message on the given device at given position, "\n" is understood but for others use sprintf before */ |
|
93 | 94 | lcd_err lcdprint(lcd_device* lcd,int position,const char* value); |
|
94 | 95 | |
|
95 | 96 | /** Writes space character on each adress of the lcd screen */ |
|
96 | 97 | lcd_err lcdclear(lcd_device* lcd); |
|
97 | 98 | |
|
98 | 99 | #endif |
@@ -1,98 +1,99 | |||
|
1 | 1 | /*------------------------------------------------------------------------------ |
|
2 | 2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
3 | 3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
4 | 4 | -- |
|
5 | 5 | -- This program is free software; you can redistribute it and/or modify |
|
6 | 6 | -- it under the terms of the GNU General Public License as published by |
|
7 | 7 | -- the Free Software Foundation; either version 3 of the License, or |
|
8 | 8 | -- (at your option) any later version. |
|
9 | 9 | -- |
|
10 | 10 | -- This program is distributed in the hope that it will be useful, |
|
11 | 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 | 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 | 13 | -- GNU General Public License for more details. |
|
14 | 14 | -- |
|
15 | 15 | -- You should have received a copy of the GNU General Public License |
|
16 | 16 | -- along with this program; if not, write to the Free Software |
|
17 | 17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 | 18 | -------------------------------------------------------------------------------*/ |
|
19 | 19 | /*-- Author : Alexis Jeandet |
|
20 | 20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #ifndef APB_LCD_DRIVER_H |
|
23 | 23 | #define APB_LCD_DRIVER_H |
|
24 | 24 | |
|
25 | 25 | #define readyFlag 1024 |
|
26 | 26 | #define lcdCharCnt 80 |
|
27 | 27 | |
|
28 | 28 | |
|
29 | 29 | /** @todo implemente some shift functions */ |
|
30 | 30 | |
|
31 | 31 | |
|
32 | 32 | /*=================================================== |
|
33 | 33 | T Y P E S D E F |
|
34 | 34 | ====================================================*/ |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | |
|
38 | 38 | /** error type used for most of lcd functions */ |
|
39 | 39 | typedef int lcd_err; |
|
40 | 40 | |
|
41 | 41 | /** lcd error ennum for higher abstraction level when error decoding */ |
|
42 | 42 | enum lcd_error |
|
43 | 43 | { |
|
44 | 44 | lcd_error_no_error, /**< no error append while function execution */ |
|
45 | 45 | lcd_error_not_ready, /**< the lcd isn't available*/ |
|
46 | 46 | lcd_error_not_openned, /**< the device guiven to the function isn't opened*/ |
|
47 | 47 | lcd_error_too_long /**< the string guiven to the lcd is bigger than the lcd frame buffer memory */ |
|
48 | 48 | }; |
|
49 | 49 | |
|
50 | 50 | |
|
51 | 51 | /** for each command sended to the lcd driver a time should be guiven according to the lcd datasheet */ |
|
52 | 52 | enum lcd_CMD_time |
|
53 | 53 | { |
|
54 | 54 | lcd_4us = 0x0FF, |
|
55 | 55 | lcd_100us = 0x1FF, |
|
56 | 56 | lcd_4ms = 0x2FF, |
|
57 | 57 | lcd_20ms = 0x3FF |
|
58 | 58 | }; |
|
59 | 59 | |
|
60 | 60 | /** list of availiable lcd commands use whith an AND mask whith cmd time */ |
|
61 | 61 | enum lcd_CMD |
|
62 | 62 | { |
|
63 | 63 | CursorON = 0xF0E, |
|
64 | 64 | CursorOFF = 0xF0C |
|
65 | 65 | }; |
|
66 | 66 | |
|
67 | 67 | /** structure representing the lcd registers */ |
|
68 | 68 | struct lcd_driver |
|
69 | 69 | { |
|
70 |
int cfg_reg; /**< Configuration register composed of Ready flag [10], CMD time Value [9:8], |
|
|
70 | int cfg_reg; /**< Configuration register composed of Ready flag [10], CMD time Value [9:8], | |
|
71 | CMD to send [7:0]*/ | |
|
71 | 72 | int Frame_buff[lcdCharCnt]; /**< Frame Buffer space each address corresponds to a char on the lcd screen */ |
|
72 | 73 | }; |
|
73 | 74 | |
|
74 | 75 | typedef struct lcd_driver lcd_device; |
|
75 | 76 | |
|
76 | 77 | /*=================================================== |
|
77 | 78 | F U N C T I O N S |
|
78 | 79 | ====================================================*/ |
|
79 | 80 | |
|
80 | 81 | /** says if the lcd is busy */ |
|
81 | 82 | int lcdbusy(lcd_device * lcd); |
|
82 | 83 | |
|
83 | 84 | /** Opens and returns the counth lcd found on APB bus else NULL */ |
|
84 | 85 | lcd_device* lcdopen(int count); |
|
85 | 86 | |
|
86 | 87 | /** Sends a command to the given device, don't forget to guive the time of the cmd */ |
|
87 | 88 | lcd_err lcdsendcmd(lcd_device* lcd,int cmd); |
|
88 | 89 | |
|
89 | 90 | /** Sets a char on the given device at given position */ |
|
90 | 91 | lcd_err lcdsetchar(lcd_device* lcd,int position,const char value); |
|
91 | 92 | |
|
92 | 93 | /** Prints a message on the given device at given position, "\n" is understood but for others use sprintf before */ |
|
93 | 94 | lcd_err lcdprint(lcd_device* lcd,int position,const char* value); |
|
94 | 95 | |
|
95 | 96 | /** Writes space character on each adress of the lcd screen */ |
|
96 | 97 | lcd_err lcdclear(lcd_device* lcd); |
|
97 | 98 | |
|
98 | 99 | #endif |
@@ -1,82 +1,82 | |||
|
1 | 1 | echo "=======================================================================================" |
|
2 | 2 | echo "---------------------------------------------------------------------------------------" |
|
3 | echo " LPP GPL PATCHER " | |
|
3 | echo " LPP GPL PATCHER " | |
|
4 | 4 | echo " Copyright (C) 2010 Laboratory of Plasmas Physic. " |
|
5 | 5 | echo "=======================================================================================" |
|
6 | 6 | echo '---------------------------------------------------------------------------------------- |
|
7 | 7 | This file is a part of the LPP VHDL IP LIBRARY |
|
8 | 8 | Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS |
|
9 | 9 | |
|
10 | 10 | This program is free software; you can redistribute it and/or modify |
|
11 | 11 | it under the terms of the GNU General Public License as published by |
|
12 | 12 | the Free Software Foundation; either version 3 of the License, or |
|
13 | 13 | (at your option) any later version. |
|
14 | 14 | |
|
15 | 15 | This program is distributed in the hope that it will be useful, |
|
16 | 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 | 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
18 | 18 | GNU General Public License for more details. |
|
19 | 19 | |
|
20 | 20 | You should have received a copy of the GNU General Public License |
|
21 | 21 | along with this program; if not, write to the Free Software |
|
22 | 22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
23 | 23 | ----------------------------------------------------------------------------------------' |
|
24 | 24 | echo |
|
25 | 25 | echo |
|
26 | 26 | echo |
|
27 | 27 | |
|
28 | 28 | # Absolute path to this script. /home/user/bin/foo.sh |
|
29 | 29 | #SCRIPT=$(readlink -f $0) |
|
30 | 30 | # Absolute path this script is in. /home/user/bin |
|
31 | 31 | |
|
32 | 32 | #LPP_PATCHPATH=`dirname $SCRIPT` |
|
33 | 33 | LPP_PATCHPATH=`pwd -L` |
|
34 | 34 | |
|
35 | 35 | |
|
36 | 36 | cd $LPP_PATCHPATH/$3 |
|
37 | 37 | |
|
38 | 38 | echo $LPP_PATCHPATH/$3 |
|
39 | 39 | echo $LPP_PATCHPATH |
|
40 | 40 | |
|
41 | 41 | case $1 in |
|
42 | 42 | -R | --recursive ) |
|
43 | 43 | for file in $(find . -name *.$2) |
|
44 | 44 | do |
|
45 | 45 | if(grep -q "This program is free software" $file); then |
|
46 | 46 | echo "$file already contains GPL HEADER" |
|
47 | 47 | else |
|
48 | 48 | echo "Modifying file : $file" |
|
49 | 49 | more $LPP_PATCHPATH/licenses/GPL_V3/${2}HEADER >> $file.tmp |
|
50 | 50 | cat $file >> $file.tmp |
|
51 | 51 | mv $file.tmp $file |
|
52 | 52 | fi |
|
53 | 53 | done |
|
54 | 54 | ;; |
|
55 | 55 | -h | --help | --h | -help) |
|
56 | 56 | echo 'Help: |
|
57 | 57 | This script add a GPL HEADER in all vhdl files. |
|
58 | 58 | usage: sh GPL_Patcher.sh [-R] [extension] [path] |
|
59 | 59 | -R or --recurcive: |
|
60 | 60 | Analyse recurcively folders starting from $LPP_PATCHPATH |
|
61 | 61 | extension |
|
62 | 62 | for example vhd,h,c |
|
63 | 63 | path |
|
64 | 64 | starting path' |
|
65 | 65 | ;; |
|
66 | 66 | * ) |
|
67 | 67 | for file in $(ls *.$2) |
|
68 | 68 | do |
|
69 | 69 | if(grep -q "This program is free software" $file); then |
|
70 | 70 | echo "$file already contains GPL HEADER" |
|
71 | 71 | else |
|
72 | 72 | echo "Modifying file : $file" |
|
73 | 73 | more $LPP_PATCHPATH/licenses/GPL_V3/${2}HEADER >> $file.tmp |
|
74 | 74 | cat $file >> $file.tmp |
|
75 | 75 | mv $file.tmp $file |
|
76 | 76 | fi |
|
77 | 77 | done |
|
78 | 78 | ;; |
|
79 | 79 | |
|
80 | 80 | esac |
|
81 | 81 | |
|
82 | 82 | cd $LPP_PATCHPATH |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now