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