[go: up one dir, main page]

File: ftdi.i

package info (click to toggle)
libftdi 0.18-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,296 kB
  • ctags: 429
  • sloc: sh: 10,187; ansic: 2,211; cpp: 594; makefile: 201
file content (52 lines) | stat: -rw-r--r-- 1,827 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* File: example.i */
%module ftdi
%include "typemaps.i"
%include "cpointer.i"
%typemap(in) unsigned char* = char*;
%ignore ftdi_write_data_async;
%ignore ftdi_async_complete;

%include ftdi.h
%{
#include <ftdi.h>
%}

extern "C" {

%apply char *OUTPUT { unsigned char *buf };
    int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
%clear unsigned char *buf;

%apply int *OUTPUT { unsigned int *chunksize };
    int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize);
    int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize);
%clear unsigned int *chunksize;

    //int ftdi_write_data_async(struct ftdi_context *ftdi, unsigned char *buf, int size);
    //void ftdi_async_complete(struct ftdi_context *ftdi, int wait_for_more);
%apply char *OUTPUT { unsigned char *pins };
    int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins);
%clear unsigned char *pins;

%apply char *OUTPUT { unsigned char *latency };
    int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency);
%clear unsigned char *latency;

%apply char *OUTPUT { unsigned short *status };
    int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status);
%clear unsigned short *status;

%apply char *OUTPUT { unsigned char *output };
    int  ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
%clear unsigned char *output;

%apply char *OUTPUT { unsigned char *eeprom };
    int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
    int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
%clear unsigned char *eeprom;

%apply int *OUTPUT { unsigned int *chipid };
    int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid);
%clear unsigned int *chipid;

}