ftdi_context Struct Reference

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

`#include <ftdi.h>`

## Public Attributes

struct usb_dev_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
int | eeprom_size
char * | error_str
char * | async_usb_buffer
unsigned int | async_usb_buffer_size
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 188 of file ftdi.h.

## Member Data Documentation

struct usb_dev_handle* ftdi_context::usb_dev

libusb's usb_dev_handle

Definition at line 192 of file ftdi.h.

Referenced by ftdi_disable_bitbang(), ftdi_enable_bitbang(), ftdi_erase_eeprom(), ftdi_get_latency_timer(), ftdi_init(), ftdi_poll_modem_status(), ftdi_read_chipid(), ftdi_read_data(), ftdi_read_eeprom(), ftdi_read_eeprom_getsize(), ftdi_read_eeprom_location(), ftdi_read_pins(), ftdi_set_baudrate(), ftdi_set_bitmode(), ftdi_set_error_char(), ftdi_set_event_char(), ftdi_set_latency_timer(), ftdi_set_line_property2(), ftdi_set_usbdev(), ftdi_setdtr(), ftdi_setdtr_rts(), ftdi_setflowctrl(), ftdi_setrts(), ftdi_usb_close(), ftdi_usb_get_strings(), 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_async(), ftdi_write_eeprom(), and ftdi_write_eeprom_location().

int ftdi_context::usb_read_timeout

usb read timeout

Definition at line 194 of file ftdi.h.

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

int ftdi_context::usb_write_timeout

usb write timeout

Definition at line 196 of file ftdi.h.

Referenced by ftdi_async_complete(), ftdi_disable_bitbang(), ftdi_enable_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_setrts(), ftdi_usb_purge_rx_buffer(), ftdi_usb_purge_tx_buffer(), ftdi_usb_reset(), ftdi_write_data(), ftdi_write_eeprom(), and ftdi_write_eeprom_location().

enum ftdi_chip_type ftdi_context::type

FTDI chip type

Definition at line 200 of file ftdi.h.

Referenced by ftdi_init(), and ftdi_usb_open_dev().

int ftdi_context::baudrate

baudrate

Definition at line 202 of file ftdi.h.

Referenced by ftdi_init(), and ftdi_set_baudrate().

unsigned char ftdi_context::bitbang_enabled

bitbang mode state

Definition at line 204 of file ftdi.h.

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

unsigned char* ftdi_context::readbuffer

pointer to read buffer for ftdi_read_data

Definition at line 206 of file ftdi.h.

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

unsigned int ftdi_context::readbuffer_offset

read buffer offset

Definition at line 208 of file ftdi.h.

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

unsigned int ftdi_context::readbuffer_remaining

number of remaining data in internal read buffer

Definition at line 210 of file ftdi.h.

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

unsigned int ftdi_context::readbuffer_chunksize

read buffer chunk size

Definition at line 212 of file ftdi.h.

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

unsigned int ftdi_context::writebuffer_chunksize

write buffer chunk size

Definition at line 214 of file ftdi.h.

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

unsigned int ftdi_context::max_packet_size

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

Definition at line 216 of file ftdi.h.

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

int ftdi_context::interface

FT2232C interface number: 0 or 1

Definition at line 220 of file ftdi.h.

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

int ftdi_context::index

FT2232C index number: 1 or 2

Definition at line 222 of file ftdi.h.

Referenced by ftdi_disable_bitbang(), ftdi_enable_bitbang(), ftdi_get_latency_timer(), ftdi_init(), 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_setrts(), ftdi_usb_open_dev(), ftdi_usb_purge_rx_buffer(), ftdi_usb_purge_tx_buffer(), and ftdi_usb_reset().

int ftdi_context::in_ep

FT2232C end points: 1 or 2

Definition at line 225 of file ftdi.h.

Referenced by ftdi_init(), ftdi_set_interface(), ftdi_write_data(), and ftdi_write_data_async().

int ftdi_context::out_ep

Definition at line 226 of file ftdi.h.

Referenced by ftdi_init(), ftdi_read_data(), and ftdi_set_interface().

unsigned char ftdi_context::bitbang_mode

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

Definition at line 229 of file ftdi.h.

Referenced by ftdi_enable_bitbang(), ftdi_init(), and ftdi_set_bitmode().

int ftdi_context::eeprom_size

EEPROM size. Default is 128 bytes for 232BM and 245BM chips

Definition at line 232 of file ftdi.h.

Referenced by ftdi_eeprom_setsize(), ftdi_init(), ftdi_read_eeprom(), and ftdi_write_eeprom().

char* ftdi_context::error_str

String representation of last error

Definition at line 235 of file ftdi.h.

Referenced by ftdi_get_error_string(), and ftdi_init().

char* ftdi_context::async_usb_buffer

Buffer needed for async communication

Definition at line 238 of file ftdi.h.

Referenced by ftdi_deinit(), and ftdi_init().

unsigned int ftdi_context::async_usb_buffer_size

Number of URB-structures we can buffer

Definition at line 240 of file ftdi.h.

Referenced by ftdi_init().

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 243 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