ftdi_context Struct Reference

Main context structure for all libftdi functions. More...

`#include <ftdi.h>`

## Public Attributes

struct libusb_context * | usb_ctx
struct libusb_device_handle * | usb_dev
int | usb_read_timeout
int | usb_write_timeout
enum ftdi_chip_type | type
int | baudrate
unsigned char | bitbang_enabled
unsigned char * | readbuffer
unsigned int | readbuffer_offset
unsigned int | readbuffer_remaining
unsigned int | readbuffer_chunksize
unsigned int | writebuffer_chunksize
unsigned int | max_packet_size
int | interface
int | index
int | in_ep
int | out_ep
unsigned char | bitbang_mode
struct ftdi_eeprom * | eeprom
const char * | error_str
enum ftdi_module_detach_mode | module_detach_mode

## Detailed Description

Main context structure for all libftdi functions.

Do not access directly if possible.

Definition at line 271 of file ftdi.h.

## Member Data Documentation

## usb_ctx

struct libusb_context* ftdi_context::usb_ctx

libusb's context

Definition at line 275 of file ftdi.h.

Referenced by ftdi_deinit(), ftdi_init(), ftdi_readstream(), ftdi_transfer_data_cancel(), ftdi_transfer_data_done(), ftdi_usb_find_all(), ftdi_usb_open_bus_addr(), ftdi_usb_open_desc_index(), and ftdi_usb_open_string().

## usb_dev

struct libusb_device_handle* ftdi_context::usb_dev

libusb's usb_dev_handle

Definition at line 277 of file ftdi.h.

Referenced by ftdi_disable_bitbang(), ftdi_eeprom_initdefaults(), ftdi_eeprom_set_strings(), ftdi_erase_eeprom(), ftdi_get_latency_timer(), ftdi_init(), ftdi_poll_modem_status(), ftdi_read_chipid(), ftdi_read_data(), ftdi_read_data_submit(), ftdi_read_eeprom(), ftdi_read_eeprom_location(), ftdi_read_pins(), ftdi_readstream(), ftdi_set_baudrate(), ftdi_set_bitmode(), ftdi_set_error_char(), ftdi_set_event_char(), ftdi_set_interface(), ftdi_set_latency_timer(), ftdi_set_line_property2(), ftdi_set_usbdev(), ftdi_setdtr(), ftdi_setdtr_rts(), ftdi_setflowctrl(), ftdi_setflowctrl_xonxoff(), ftdi_setrts(), ftdi_tciflush(), ftdi_tcioflush(), ftdi_tcoflush(), ftdi_usb_close(), ftdi_usb_get_strings(), ftdi_usb_get_strings2(), ftdi_usb_open_desc_index(), ftdi_usb_open_dev(), ftdi_usb_purge_buffers(), ftdi_usb_purge_rx_buffer(), ftdi_usb_purge_tx_buffer(), ftdi_usb_reset(), ftdi_write_data(), ftdi_write_data_submit(), ftdi_write_eeprom(), and ftdi_write_eeprom_location().

## usb_read_timeout

int ftdi_context::usb_read_timeout

usb read timeout

Definition at line 279 of file ftdi.h.

Referenced by ftdi_get_latency_timer(), ftdi_init(), ftdi_poll_modem_status(), ftdi_read_chipid(), ftdi_read_data(), ftdi_read_data_submit(), ftdi_read_eeprom(), ftdi_read_eeprom_location(), ftdi_read_pins(), and ftdi_readstream().

## usb_write_timeout

int ftdi_context::usb_write_timeout

usb write timeout

Definition at line 281 of file ftdi.h.

Referenced by ftdi_disable_bitbang(), ftdi_erase_eeprom(), ftdi_init(), ftdi_set_baudrate(), ftdi_set_bitmode(), ftdi_set_error_char(), ftdi_set_event_char(), ftdi_set_latency_timer(), ftdi_set_line_property2(), ftdi_setdtr(), ftdi_setdtr_rts(), ftdi_setflowctrl(), ftdi_setflowctrl_xonxoff(), ftdi_setrts(), ftdi_tciflush(), ftdi_tcoflush(), ftdi_usb_purge_rx_buffer(), ftdi_usb_purge_tx_buffer(), ftdi_usb_reset(), ftdi_write_data(), ftdi_write_data_submit(), ftdi_write_eeprom(), and ftdi_write_eeprom_location().

## type

enum ftdi_chip_type ftdi_context::type

FTDI chip type

Definition at line 285 of file ftdi.h.

Referenced by ftdi_eeprom_build(), ftdi_eeprom_decode(), ftdi_eeprom_initdefaults(), ftdi_erase_eeprom(), ftdi_init(), ftdi_read_eeprom(), ftdi_readstream(), ftdi_usb_open_dev(), ftdi_write_eeprom(), and ftdi_write_eeprom_location().

## baudrate

int ftdi_context::baudrate

baudrate

Definition at line 287 of file ftdi.h.

Referenced by ftdi_init(), and ftdi_set_baudrate().

## bitbang_enabled

unsigned char ftdi_context::bitbang_enabled

bitbang mode state

Definition at line 289 of file ftdi.h.

Referenced by ftdi_disable_bitbang(), ftdi_init(), ftdi_set_baudrate(), and ftdi_set_bitmode().

## readbuffer

unsigned char* ftdi_context::readbuffer

pointer to read buffer for ftdi_read_data

Definition at line 291 of file ftdi.h.

Referenced by ftdi_deinit(), ftdi_init(), ftdi_read_data(), ftdi_read_data_set_chunksize(), and ftdi_read_data_submit().

## readbuffer_offset

unsigned int ftdi_context::readbuffer_offset

read buffer offset

Definition at line 293 of file ftdi.h.

Referenced by ftdi_init(), ftdi_read_data(), ftdi_read_data_set_chunksize(), ftdi_read_data_submit(), ftdi_tciflush(), ftdi_usb_purge_rx_buffer(), and ftdi_usb_reset().

## readbuffer_remaining

unsigned int ftdi_context::readbuffer_remaining

number of remaining data in internal read buffer

Definition at line 295 of file ftdi.h.

Referenced by ftdi_init(), ftdi_read_data(), ftdi_read_data_set_chunksize(), ftdi_read_data_submit(), ftdi_tciflush(), ftdi_usb_purge_rx_buffer(), and ftdi_usb_reset().

## readbuffer_chunksize

unsigned int ftdi_context::readbuffer_chunksize

read buffer chunk size

Definition at line 297 of file ftdi.h.

Referenced by ftdi_read_data(), ftdi_read_data_get_chunksize(), ftdi_read_data_set_chunksize(), and ftdi_read_data_submit().

## writebuffer_chunksize

unsigned int ftdi_context::writebuffer_chunksize

write buffer chunk size

Definition at line 299 of file ftdi.h.

Referenced by ftdi_init(), ftdi_write_data(), ftdi_write_data_get_chunksize(), ftdi_write_data_set_chunksize(), and ftdi_write_data_submit().

## max_packet_size

unsigned int ftdi_context::max_packet_size

maximum packet size. Needed for filtering modem status bytes every n packets.

Definition at line 301 of file ftdi.h.

Referenced by ftdi_init(), ftdi_read_data(), ftdi_readstream(), and ftdi_usb_open_dev().

## interface

int ftdi_context::interface

FT2232C interface number: 0 or 1

Definition at line 305 of file ftdi.h.

Referenced by ftdi_set_interface(), ftdi_usb_close(), and ftdi_usb_open_dev().

## index

int ftdi_context::index

FT2232C index number: 1 or 2

Definition at line 307 of file ftdi.h.

Referenced by ftdi_disable_bitbang(), ftdi_get_latency_timer(), ftdi_poll_modem_status(), ftdi_read_pins(), ftdi_set_bitmode(), ftdi_set_error_char(), ftdi_set_event_char(), ftdi_set_interface(), ftdi_set_latency_timer(), ftdi_set_line_property2(), ftdi_setdtr(), ftdi_setdtr_rts(), ftdi_setflowctrl(), ftdi_setflowctrl_xonxoff(), ftdi_setrts(), ftdi_tciflush(), ftdi_tcoflush(), ftdi_usb_purge_rx_buffer(), ftdi_usb_purge_tx_buffer(), and ftdi_usb_reset().

## in_ep

int ftdi_context::in_ep

FT2232C end points: 1 or 2

Definition at line 310 of file ftdi.h.

Referenced by ftdi_set_interface(), ftdi_write_data(), and ftdi_write_data_submit().

## out_ep

int ftdi_context::out_ep

Definition at line 311 of file ftdi.h.

Referenced by ftdi_read_data(), ftdi_read_data_submit(), ftdi_readstream(), and ftdi_set_interface().

## bitbang_mode

unsigned char ftdi_context::bitbang_mode

Bitbang mode. 1: (default) Normal bitbang mode, 2: FT2232C SPI bitbang mode

Definition at line 314 of file ftdi.h.

Referenced by ftdi_init(), and ftdi_set_bitmode().

## eeprom

struct ftdi_eeprom* ftdi_context::eeprom

Decoded eeprom structure

Definition at line 317 of file ftdi.h.

Referenced by ftdi_deinit(), ftdi_eeprom_build(), ftdi_eeprom_decode(), ftdi_eeprom_get_strings(), ftdi_eeprom_initdefaults(), ftdi_eeprom_set_strings(), ftdi_erase_eeprom(), ftdi_get_eeprom_buf(), ftdi_get_eeprom_value(), ftdi_init(), ftdi_read_eeprom(), ftdi_set_eeprom_buf(), ftdi_set_eeprom_user_data(), ftdi_set_eeprom_value(), and ftdi_write_eeprom().

## error_str

const char* ftdi_context::error_str

String representation of last error

Definition at line 320 of file ftdi.h.

Referenced by ftdi_get_error_string(), and ftdi_init().

## module_detach_mode

enum ftdi_module_detach_mode ftdi_context::module_detach_mode

Defines behavior in case a kernel module is already attached to the device

Definition at line 323 of file ftdi.h.

Referenced by ftdi_init(), and ftdi_usb_open_dev().

The documentation for this struct was generated from the following file:

- ftdi.h