root@4
|
1 |
/*
|
root@4
|
2 |
* GraphLCD driver library
|
root@4
|
3 |
*
|
root@4
|
4 |
* drivers.c - global driver constants and functions
|
root@4
|
5 |
*
|
root@4
|
6 |
* This file is released under the GNU General Public License. Refer
|
root@4
|
7 |
* to the COPYING file distributed with this package.
|
root@4
|
8 |
*
|
root@4
|
9 |
* (c) 2004 Andreas Regel <andreas.regel AT powarman.de>
|
root@4
|
10 |
*/
|
root@4
|
11 |
|
root@4
|
12 |
#include <string.h>
|
root@4
|
13 |
|
root@4
|
14 |
#include "drivers.h"
|
root@5
|
15 |
#include "picctl.h"
|
root@4
|
16 |
#include "simlcd.h"
|
root@4
|
17 |
#include "gu140x32f.h"
|
root@4
|
18 |
#include "gu256x64-372.h"
|
root@4
|
19 |
#include "gu256x64-3900.h"
|
root@4
|
20 |
#include "hd61830.h"
|
root@4
|
21 |
#include "ks0108.h"
|
root@4
|
22 |
#include "sed1330.h"
|
root@4
|
23 |
#include "sed1520.h"
|
root@4
|
24 |
#include "t6963c.h"
|
root@4
|
25 |
#include "framebuffer.h"
|
root@4
|
26 |
#include "image.h"
|
root@4
|
27 |
#include "noritake800.h"
|
root@4
|
28 |
#include "avrctl.h"
|
root@4
|
29 |
#include "network.h"
|
root@4
|
30 |
#include "gu126x64D-K610A4.h"
|
root@4
|
31 |
#include "serdisp.h"
|
root@4
|
32 |
#include "g15daemon.h"
|
root@4
|
33 |
|
root@4
|
34 |
namespace GLCD
|
root@4
|
35 |
{
|
root@4
|
36 |
|
root@4
|
37 |
tDriver drivers[] =
|
root@4
|
38 |
{
|
root@4
|
39 |
{"simlcd", kDriverSimLCD},
|
root@4
|
40 |
{"gu140x32f", kDriverGU140X32F},
|
root@4
|
41 |
{"gu256x64-372", kDriverGU256X64_372},
|
root@4
|
42 |
{"gu256x64-3900", kDriverGU256X64_3900},
|
root@4
|
43 |
{"hd61830", kDriverHD61830},
|
root@4
|
44 |
{"ks0108", kDriverKS0108},
|
root@4
|
45 |
{"sed1330", kDriverSED1330},
|
root@4
|
46 |
{"sed1520", kDriverSED1520},
|
root@4
|
47 |
{"t6963c", kDriverT6963C},
|
root@4
|
48 |
{"framebuffer", kDriverFramebuffer},
|
root@4
|
49 |
{"image", kDriverImage},
|
root@4
|
50 |
{"noritake800", kDriverNoritake800},
|
root@4
|
51 |
{"avrctl", kDriverAvrCtl},
|
root@5
|
52 |
{"picctl", kDriverPICCtl},
|
root@4
|
53 |
{"network", kDriverNetwork},
|
root@4
|
54 |
{"gu126x64D-K610A4", kDriverGU126X64D_K610A4},
|
root@4
|
55 |
{"serdisp", kDriverSerDisp},
|
root@4
|
56 |
{"g15daemon", kDriverG15daemon},
|
root@4
|
57 |
{"", kDriverUnknown}
|
root@4
|
58 |
};
|
root@4
|
59 |
|
root@4
|
60 |
tDriver * GetAvailableDrivers(int & count)
|
root@4
|
61 |
{
|
root@4
|
62 |
for (count = 0; drivers[count].name.length() > 0; count++)
|
root@4
|
63 |
;
|
root@4
|
64 |
return drivers;
|
root@4
|
65 |
}
|
root@4
|
66 |
|
root@4
|
67 |
int GetDriverID(const std::string & driver)
|
root@4
|
68 |
{
|
root@4
|
69 |
for (int i = 0; drivers[i].name.length() > 0; i++)
|
root@4
|
70 |
if (drivers[i].name == driver)
|
root@4
|
71 |
return drivers[i].id;
|
root@4
|
72 |
return kDriverUnknown;
|
root@4
|
73 |
}
|
root@4
|
74 |
|
root@4
|
75 |
cDriver * CreateDriver(int driverID, cDriverConfig * config)
|
root@4
|
76 |
{
|
root@4
|
77 |
switch (driverID)
|
root@4
|
78 |
{
|
root@4
|
79 |
case kDriverSimLCD:
|
root@4
|
80 |
return new cDriverSimLCD(config);
|
root@4
|
81 |
case kDriverGU140X32F:
|
root@4
|
82 |
return new cDriverGU140X32F(config);
|
root@4
|
83 |
case kDriverGU256X64_372:
|
root@4
|
84 |
return new cDriverGU256X64_372(config);
|
root@4
|
85 |
case kDriverGU256X64_3900:
|
root@4
|
86 |
return new cDriverGU256X64_3900(config);
|
root@4
|
87 |
case kDriverHD61830:
|
root@4
|
88 |
return new cDriverHD61830(config);
|
root@4
|
89 |
case kDriverKS0108:
|
root@4
|
90 |
return new cDriverKS0108(config);
|
root@4
|
91 |
case kDriverSED1330:
|
root@4
|
92 |
return new cDriverSED1330(config);
|
root@4
|
93 |
case kDriverSED1520:
|
root@4
|
94 |
return new cDriverSED1520(config);
|
root@4
|
95 |
case kDriverT6963C:
|
root@4
|
96 |
return new cDriverT6963C(config);
|
root@4
|
97 |
case kDriverFramebuffer:
|
root@4
|
98 |
return new cDriverFramebuffer(config);
|
root@4
|
99 |
case kDriverImage:
|
root@4
|
100 |
return new cDriverImage(config);
|
root@4
|
101 |
case kDriverNoritake800:
|
root@4
|
102 |
return new cDriverNoritake800(config);
|
root@4
|
103 |
case kDriverAvrCtl:
|
root@4
|
104 |
return new cDriverAvrCtl(config);
|
root@5
|
105 |
case kDriverPICCtl:
|
root@5
|
106 |
return cDriverPICCtl::getInstance(config);
|
root@4
|
107 |
case kDriverNetwork:
|
root@4
|
108 |
return new cDriverNetwork(config);
|
root@4
|
109 |
case kDriverGU126X64D_K610A4:
|
root@4
|
110 |
return new cDriverGU126X64D_K610A4(config);
|
root@4
|
111 |
case kDriverSerDisp:
|
root@4
|
112 |
return new cDriverSerDisp(config);
|
root@4
|
113 |
case kDriverG15daemon:
|
root@4
|
114 |
return new cDriverG15daemon(config);
|
root@4
|
115 |
case kDriverUnknown:
|
root@4
|
116 |
default:
|
root@4
|
117 |
return NULL;
|
root@4
|
118 |
}
|
root@4
|
119 |
}
|
root@4
|
120 |
|
root@4
|
121 |
} // end of namespace
|