ce24b5855e4eba538dd8d6586400ed04fb0e2433
[libftdi] / bindings / ftdi.i
1 /* File: example.i */
2 %module ftdi
3 %include "typemaps.i"
4 %include "cpointer.i"
5 %typemap(in) unsigned char* = char*;
6 %ignore ftdi_write_data_async;
7 %ignore ftdi_async_complete;
8
9 %include ftdi.h
10 %{
11 #include <ftdi.h>
12 %}
13
14 extern "C" {
15
16 %apply char *OUTPUT { unsigned char *buf };
17     int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
18 %clear unsigned char *buf;
19 %apply int *OUTPUT { unsigned int *chunksize };
20     int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize);
21     int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize);
22 %clear unsigned int *chunksize;
23     //int ftdi_write_data_async(struct ftdi_context *ftdi, unsigned char *buf, int size);
24     //void ftdi_async_complete(struct ftdi_context *ftdi, int wait_for_more);
25 %apply char *OUTPUT { unsigned char *pins };
26     int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins);
27 %clear unsigned char *pins;
28 %apply char *OUTPUT { unsigned char *latency };
29     int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency);
30 %clear unsigned char *status;
31 %apply char *OUTPUT { unsigned char *latency };
32     int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status);
33 %clear unsigned char *status;
34 %apply char *OUTPUT { unsigned char *output };
35     int  ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
36 %clear unsigned char *output;
37 %apply char *OUTPUT { unsigned char *eeprom };
38     int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
39     int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
40 %clear unsigned char *eeprom;
41 %apply int *OUTPUT { unsigned int *chipid };
42     int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid);
43 %clear unsigned int *chipid;
44
45 }
46
47