]>
git.zerfleddert.de Git - usb-driver/blob - config.c
02c056d299ff92416a408f67f8401129e008d045
4 #include "usb-driver.h"
11 static struct parport_config pp_config
[4];
13 static void read_config() {
15 static int config_read
= 0;
22 for (i
=0; i
<sizeof(pp_config
)/sizeof(struct parport_config
); i
++) {
24 pp_config
[i
].ppbase
= i
*0x10;
25 pp_config
[i
].real
= 1;
26 pp_config
[i
].open
= parport_open
;
27 pp_config
[i
].close
= parport_close
;
28 pp_config
[i
].transfer
= parport_transfer
;
32 pp_config
[3].real
= 0;
33 pp_config
[3].usb_vid
= 0x0403;
34 pp_config
[3].usb_pid
= 0xcff8;
35 pp_config
[3].open
= jtagkey_open
;
36 pp_config
[3].close
= jtagkey_close
;
37 pp_config
[3].transfer
= jtagkey_transfer
;
41 struct parport_config
*config_get(int num
) {
42 struct parport_config
*ret
= NULL
;
47 for (i
=0; i
<sizeof(pp_config
)/sizeof(struct parport_config
); i
++) {
48 if (pp_config
[i
].num
== num
) {
49 ret
= &(pp_config
[i
]);
57 unsigned char config_is_real_pport(int num
) {
63 for (i
=0; i
<sizeof(pp_config
)/sizeof(struct parport_config
); i
++) {
64 if (pp_config
[i
].num
== num
) {
65 ret
= pp_config
[i
].real
;
73 unsigned short config_usb_vid(int num
) {
74 unsigned short ret
= 0x00;
79 for (i
=0; i
<sizeof(pp_config
)/sizeof(struct parport_config
); i
++) {
80 if (pp_config
[i
].num
== num
) {
81 ret
= pp_config
[i
].usb_vid
;
89 unsigned short config_usb_pid(int num
) {
90 unsigned short ret
= 0x00;
95 for (i
=0; i
<sizeof(pp_config
)/sizeof(struct parport_config
); i
++) {
96 if (pp_config
[i
].num
== num
) {
97 ret
= pp_config
[i
].usb_pid
;