Python wrapper: Fix argument type of ftdi_read_chipid
[libftdi] / bindings / ftdi.i
CommitLineData
05c0dae8
TH
1/* File: example.i */
2%module ftdi
3%include "typemaps.i"
4%include "cpointer.i"
f5b59bd6
FM
5%pointer_functions(unsigned int, uintp);
6
05c0dae8
TH
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
16extern "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;
f0005c33 21
05c0dae8
TH
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;
f0005c33 26
05c0dae8
TH
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;
f0005c33 32
05c0dae8
TH
33%apply char *OUTPUT { unsigned char *latency };
34 int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency);
f0005c33
TJ
35%clear unsigned char *latency;
36
37%apply char *OUTPUT { unsigned short *status };
05c0dae8 38 int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status);
f0005c33
TJ
39%clear unsigned short *status;
40
05c0dae8
TH
41%apply char *OUTPUT { unsigned char *output };
42 int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
43%clear unsigned char *output;
f0005c33 44
05c0dae8
TH
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;
f0005c33 49
05c0dae8
TH
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}