@@ -0,0 +1,52 | |||||
|
1 | /*------------------------------------------------------------------------------ | |||
|
2 | -- This file is a part of the libuc, microcontroler library | |||
|
3 | -- Copyright (C) 2013, Alexis Jeandet | |||
|
4 | -- | |||
|
5 | -- This program is free software; you can redistribute it and/or modify | |||
|
6 | -- it under the terms of the GNU General Public License as published by | |||
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |||
|
8 | -- (at your option) any later version. | |||
|
9 | -- | |||
|
10 | -- This program is distributed in the hope that it will be useful, | |||
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
13 | -- GNU General Public License for more details. | |||
|
14 | -- | |||
|
15 | -- You should have received a copy of the GNU General Public License | |||
|
16 | -- along with this program; if not, write to the Free Software | |||
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
|
18 | ------------------------------------------------------------------------------- | |||
|
19 | -- Author : Alexis Jeandet | |||
|
20 | -- Mail : alexis.jeandet@member.fsf.org | |||
|
21 | -------------------------------------------------------------------------------*/ | |||
|
22 | ||||
|
23 | #include <ADS7843.h> | |||
|
24 | ||||
|
25 | int ads7843init(ADS7843_t *dev, spi_t spidev) | |||
|
26 | { | |||
|
27 | dev->spidev = spidev; | |||
|
28 | return 1; | |||
|
29 | } | |||
|
30 | ||||
|
31 | ||||
|
32 | ||||
|
33 | ||||
|
34 | ||||
|
35 | ||||
|
36 | ||||
|
37 | ||||
|
38 | ||||
|
39 | ||||
|
40 | ||||
|
41 | ||||
|
42 | ||||
|
43 | ||||
|
44 | ||||
|
45 | ||||
|
46 | ||||
|
47 | ||||
|
48 | ||||
|
49 | ||||
|
50 | ||||
|
51 | ||||
|
52 |
@@ -0,0 +1,5 | |||||
|
1 | TEMPLATE = subdirs | |||
|
2 | CONFIG += ordered | |||
|
3 | ||||
|
4 | SUBDIRS += ./ADS7843_STM32F4.pro \ | |||
|
5 | ./ADS7843_SIMULATOR.pro |
@@ -0,0 +1,23 | |||||
|
1 | TEMPLATE = lib | |||
|
2 | TARGET = ADS7843 | |||
|
3 | ||||
|
4 | SOURCES += \ | |||
|
5 | ADS7843.c | |||
|
6 | ||||
|
7 | INCLUDEPATH += ../../../../includes \ | |||
|
8 | ../../../../includes/GRAPHIC/CONTROLERS \ | |||
|
9 | ../../../../includes/GRAPHIC/TC_CONTROLERS \ | |||
|
10 | ../../../../includes/GRAPHIC/GUI/FONTS \ | |||
|
11 | ../../../../includes/GRAPHIC/GUI/Widgets | |||
|
12 | ||||
|
13 | ||||
|
14 | UCMODEL=simulator | |||
|
15 | ||||
|
16 | target.path = $$[QT_INSTALL_LIBS]/$$UCMODEL | |||
|
17 | INSTALLS += target | |||
|
18 | ||||
|
19 | HEADERS += \ | |||
|
20 | ../../../../includes/GRAPHIC/TC_CONTROLERS/ADS7843.h \ | |||
|
21 | ../../../../includes/GRAPHIC/TC_CONTROLERS/genericTC_Controler.h | |||
|
22 | ||||
|
23 |
@@ -0,0 +1,27 | |||||
|
1 | TEMPLATE = lib | |||
|
2 | TARGET = ADS7843 | |||
|
3 | ||||
|
4 | SOURCES += \ | |||
|
5 | ADS7843.c | |||
|
6 | ||||
|
7 | DEFINES -= __OPTIMIZED_MATH | |||
|
8 | ||||
|
9 | INCLUDEPATH += ../../../../includes \ | |||
|
10 | ../../../CPU/STM32F4xx_StdPeriph_Driver/inc \ | |||
|
11 | ../../../CPU/CMSIS/Include \ | |||
|
12 | ../../../../includes/GRAPHIC/CONTROLERS \ | |||
|
13 | ../../../../includes/GRAPHIC/TC_CONTROLERS \ | |||
|
14 | ../../../../includes/GRAPHIC/GUI/FONTS \ | |||
|
15 | ../../../../includes/GRAPHIC/GUI/Widgets | |||
|
16 | ||||
|
17 | ||||
|
18 | UCMODEL=stm32f4 | |||
|
19 | ||||
|
20 | target.path = $$[QT_INSTALL_LIBS]/$$UCMODEL | |||
|
21 | INSTALLS += target | |||
|
22 | ||||
|
23 | HEADERS += \ | |||
|
24 | ../../../../includes/GRAPHIC/TC_CONTROLERS/ADS7843.h \ | |||
|
25 | ../../../../includes/GRAPHIC/TC_CONTROLERS/genericTC_Controler.h | |||
|
26 | ||||
|
27 |
@@ -0,0 +1,61 | |||||
|
1 | /*------------------------------------------------------------------------------ | |||
|
2 | -- This file is a part of the libuc, microcontroler library | |||
|
3 | -- Copyright (C) 2013, Alexis Jeandet | |||
|
4 | -- | |||
|
5 | -- This program is free software; you can redistribute it and/or modify | |||
|
6 | -- it under the terms of the GNU General Public License as published by | |||
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |||
|
8 | -- (at your option) any later version. | |||
|
9 | -- | |||
|
10 | -- This program is distributed in the hope that it will be useful, | |||
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
13 | -- GNU General Public License for more details. | |||
|
14 | -- | |||
|
15 | -- You should have received a copy of the GNU General Public License | |||
|
16 | -- along with this program; if not, write to the Free Software | |||
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
|
18 | ------------------------------------------------------------------------------- | |||
|
19 | -- Author : Alexis Jeandet | |||
|
20 | -- Mail : alexis.jeandet@member.fsf.org | |||
|
21 | -------------------------------------------------------------------------------*/ | |||
|
22 | #ifndef STMPE811_H | |||
|
23 | #define STMPE811_H | |||
|
24 | #include <stdio.h> | |||
|
25 | #include <uhandle.h> | |||
|
26 | #include <genericTC_Controler.h> | |||
|
27 | #include <stdint.h> | |||
|
28 | #include <fonts.h> | |||
|
29 | #include <spi.h> | |||
|
30 | ||||
|
31 | typedef struct ADS7843_t | |||
|
32 | { | |||
|
33 | spi_t spidev; | |||
|
34 | }ADS7843_t; | |||
|
35 | ||||
|
36 | ||||
|
37 | extern int ads7843init(ADS7843_t *dev, spi_t spidev); | |||
|
38 | extern int ads7843read(ADS7843_t *dev,int* x,int* y); | |||
|
39 | ||||
|
40 | ||||
|
41 | ||||
|
42 | #endif | |||
|
43 | ||||
|
44 | ||||
|
45 | ||||
|
46 | ||||
|
47 | ||||
|
48 | ||||
|
49 | ||||
|
50 | ||||
|
51 | ||||
|
52 | ||||
|
53 | ||||
|
54 | ||||
|
55 | ||||
|
56 | ||||
|
57 | ||||
|
58 | ||||
|
59 | ||||
|
60 | ||||
|
61 |
General Comments 0
You need to be logged in to leave comments.
Login now