New in 0.11
-----------
+* Vala bindings helper functions (ftdi_new, ftdi_free, ftdi_list_free2) (Even Nermerson)
* Support for different EEPROM sizes (Andrew John Rogers, andrew@rogerstech.co.uk)
* Async write support. Linux only and no error handling.
You have to enable it via --with-async-code.
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED =
+PREDEFINED = LIBFTDI_LINUX_ASYNC_MODE
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
}
/**
+ Allocate and initialize a new ftdi_context
+
+ \return a pointer to a new ftdi_context, or NULL on failure
+*/
+struct ftdi_context *ftdi_new()
+{
+ struct ftdi_context * ftdi = (struct ftdi_context *)malloc(sizeof(struct ftdi_context));
+
+ if (ftdi == NULL) {
+ return NULL;
+ }
+
+ if (ftdi_init(ftdi) != 0) {
+ free(ftdi);
+ return NULL;
+ }
+
+ return ftdi;
+}
+
+/**
Open selected channels on a chip, otherwise use first channel.
\param ftdi pointer to ftdi_context
}
/**
+ Deinitialize and free an ftdi_context.
+
+ \param ftdi pointer to ftdi_context
+*/
+void ftdi_free(struct ftdi_context *ftdi)
+{
+ ftdi_deinit(ftdi);
+ free(ftdi);
+}
+
+/**
Use an already open libusb device.
\param ftdi pointer to ftdi_context
}
/**
+ Frees a usb device list.
+
+ \param devlist USB device list created by ftdi_usb_find_all()
+*/
+void ftdi_list_free2(struct ftdi_device_list *devlist)
+{
+ ftdi_list_free(&devlist);
+}
+
+/**
Return device ID strings from the usb device.
The parameters manufacturer, description and serial may be NULL
caller of completion or error - but this is not done yet, volunteers welcome.
Works around libusb and directly accesses functions only available on Linux.
+ Only available if compiled with --with-async-mode.
\param ftdi pointer to ftdi_context
\param buf Buffer with the data
#endif
int ftdi_init(struct ftdi_context *ftdi);
+ struct ftdi_context *ftdi_new();
int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface);
void ftdi_deinit(struct ftdi_context *ftdi);
+ void ftdi_free(struct ftdi_context *ftdi);
void ftdi_set_usbdev (struct ftdi_context *ftdi, usb_dev_handle *usbdev);
int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist,
int vendor, int product);
void ftdi_list_free(struct ftdi_device_list **devlist);
+ void ftdi_list_free2(struct ftdi_device_list *devlist);
int ftdi_usb_get_strings(struct ftdi_context *ftdi, struct usb_device *dev,
char * manufacturer, int mnf_len,
char * description, int desc_len,