ftdi.h - Online Linux Manual PageSection : 3
Updated : 17 Sep 2010
Source : Version 0.18
Note : libftdi

NAMEftdi.h −

SYNOPSIS
#include <usb.h>

Classesstruct ftdi_context
Main context structure for all libftdi functions.
struct ftdi_device_list
list of usb devices created by ftdi_usb_find_all()
struct ftdi_eeprom
FTDI eeprom structure.

Defines#define FTDI_DEFAULT_EEPROM_SIZE 128
#define MPSSE_WRITE_NEG 0x01
#define MPSSE_BITMODE 0x02
#define MPSSE_READ_NEG 0x04
#define MPSSE_LSB 0x08
#define MPSSE_DO_WRITE 0x10
#define MPSSE_DO_READ 0x20
#define MPSSE_WRITE_TMS 0x40
#define SET_BITS_LOW 0x80
#define SET_BITS_HIGH 0x82
#define GET_BITS_LOW 0x81
#define GET_BITS_HIGH 0x83
#define LOOPBACK_START 0x84
#define LOOPBACK_END 0x85
#define TCK_DIVISOR 0x86
#define DIV_VALUE(rate) (rate > 6000000)?0:((6000000/rate -1) > 0xffff)? 0xffff: (6000000/rate -1)
#define SEND_IMMEDIATE 0x87
#define WAIT_ON_HIGH 0x88
#define WAIT_ON_LOW 0x89
#define READ_SHORT 0x90
#define READ_EXTENDED 0x91
#define WRITE_SHORT 0x92
#define WRITE_EXTENDED 0x93
#define SIO_RESET 0
#define SIO_MODEM_CTRL 1
#define SIO_SET_FLOW_CTRL 2
#define SIO_SET_BAUD_RATE 3
#define SIO_SET_DATA 4
#define FTDI_DEVICE_OUT_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT)
#define FTDI_DEVICE_IN_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN)
#define SIO_RESET_REQUEST SIO_RESET
#define SIO_SET_BAUDRATE_REQUEST SIO_SET_BAUD_RATE
#define SIO_SET_DATA_REQUEST SIO_SET_DATA
#define SIO_SET_FLOW_CTRL_REQUEST SIO_SET_FLOW_CTRL
#define SIO_SET_MODEM_CTRL_REQUEST SIO_MODEM_CTRL
#define SIO_POLL_MODEM_STATUS_REQUEST 0x05
#define SIO_SET_EVENT_CHAR_REQUEST 0x06
#define SIO_SET_ERROR_CHAR_REQUEST 0x07
#define SIO_SET_LATENCY_TIMER_REQUEST 0x09
#define SIO_GET_LATENCY_TIMER_REQUEST 0x0A
#define SIO_SET_BITMODE_REQUEST 0x0B
#define SIO_READ_PINS_REQUEST 0x0C
#define SIO_READ_EEPROM_REQUEST 0x90
#define SIO_WRITE_EEPROM_REQUEST 0x91
#define SIO_ERASE_EEPROM_REQUEST 0x92
#define SIO_RESET_SIO 0
#define SIO_RESET_PURGE_RX 1
#define SIO_RESET_PURGE_TX 2
#define SIO_DISABLE_FLOW_CTRL 0x0
#define SIO_RTS_CTS_HS (0x1 << 8)
#define SIO_DTR_DSR_HS (0x2 << 8)
#define SIO_XON_XOFF_HS (0x4 << 8)
#define SIO_SET_DTR_MASK 0x1
#define SIO_SET_DTR_HIGH ( 1 | ( SIO_SET_DTR_MASK << 8))
#define SIO_SET_DTR_LOW ( 0 | ( SIO_SET_DTR_MASK << 8))
#define SIO_SET_RTS_MASK 0x2
#define SIO_SET_RTS_HIGH ( 2 | ( SIO_SET_RTS_MASK << 8 ))
#define SIO_SET_RTS_LOW ( 0 | ( SIO_SET_RTS_MASK << 8 ))
#define SIO_RTS_CTS_HS (0x1 << 8)
#define FTDI_URB_USERCONTEXT_COOKIE ((void *)0x1)
#define DEPRECATED(func) func

Enumerationsenum ftdi_chip_type { TYPE_AM = 0, TYPE_BM = 1, TYPE_2232C = 2, TYPE_R = 3, TYPE_2232H = 4, TYPE_4232H = 5 }
enum ftdi_parity_type { NONE = 0, ODD = 1, EVEN = 2, MARK = 3, SPACE = 4 }
enum ftdi_stopbits_type { STOP_BIT_1 = 0, STOP_BIT_15 = 1, STOP_BIT_2 = 2 }
enum ftdi_bits_type { BITS_7 = 7, BITS_8 = 8 }
enum ftdi_break_type { BREAK_OFF = 0, BREAK_ON = 1 }
enum ftdi_mpsse_mode { BITMODE_RESET = 0x00, BITMODE_BITBANG = 0x01, BITMODE_MPSSE = 0x02, BITMODE_SYNCBB = 0x04, BITMODE_MCU = 0x08, BITMODE_OPTO = 0x10, BITMODE_CBUS = 0x20, BITMODE_SYNCFF = 0x40 }
enum ftdi_interface { INTERFACE_ANY = 0, INTERFACE_A = 1, INTERFACE_B = 2, INTERFACE_C = 3, INTERFACE_D = 4 }

Functionsint ftdi_init (struct ftdi_context *ftdi)
struct ftdi_context * ftdi_new (void)
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, char *serial, int serial_len)
int ftdi_usb_open (struct ftdi_context *ftdi, int vendor, int product)
int ftdi_usb_open_desc (struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial)
int ftdi_usb_open_desc_index (struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial, unsigned int index)
int ftdi_usb_open_dev (struct ftdi_context *ftdi, struct usb_device *dev)
int ftdi_usb_open_string (struct ftdi_context *ftdi, const char *description)
int ftdi_usb_close (struct ftdi_context *ftdi)
int ftdi_usb_reset (struct ftdi_context *ftdi)
int ftdi_usb_purge_rx_buffer (struct ftdi_context *ftdi)
int ftdi_usb_purge_tx_buffer (struct ftdi_context *ftdi)
int ftdi_usb_purge_buffers (struct ftdi_context *ftdi)
int ftdi_set_baudrate (struct ftdi_context *ftdi, int baudrate)
int ftdi_set_line_property (struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)
int ftdi_set_line_property2 (struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity, enum ftdi_break_type break_type)
int ftdi_read_data (struct ftdi_context *ftdi, unsigned char *buf, int size)
int ftdi_read_data_set_chunksize (struct ftdi_context *ftdi, unsigned int chunksize)
int ftdi_read_data_get_chunksize (struct ftdi_context *ftdi, unsigned int *chunksize)
int ftdi_write_data (struct ftdi_context *ftdi, unsigned char *buf, int size)
int ftdi_write_data_set_chunksize (struct ftdi_context *ftdi, unsigned int chunksize)
int ftdi_write_data_get_chunksize (struct ftdi_context *ftdi, unsigned int *chunksize)
int ftdi_write_data_async (struct ftdi_context *ftdi, unsigned char *buf, int size)
void ftdi_async_complete (struct ftdi_context *ftdi, int wait_for_more)
int DEPRECATED (ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask))
int ftdi_disable_bitbang (struct ftdi_context *ftdi)
int ftdi_set_bitmode (struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode)
int ftdi_read_pins (struct ftdi_context *ftdi, unsigned char *pins)
int ftdi_set_latency_timer (struct ftdi_context *ftdi, unsigned char latency)
int ftdi_get_latency_timer (struct ftdi_context *ftdi, unsigned char *latency)
int ftdi_poll_modem_status (struct ftdi_context *ftdi, unsigned short *status)
int ftdi_setflowctrl (struct ftdi_context *ftdi, int flowctrl)
int ftdi_setdtr_rts (struct ftdi_context *ftdi, int dtr, int rts)
int ftdi_setdtr (struct ftdi_context *ftdi, int state)
int ftdi_setrts (struct ftdi_context *ftdi, int state)
int ftdi_set_event_char (struct ftdi_context *ftdi, unsigned char eventch, unsigned char enable)
int ftdi_set_error_char (struct ftdi_context *ftdi, unsigned char errorch, unsigned char enable)
void ftdi_eeprom_setsize (struct ftdi_context *ftdi, struct ftdi_eeprom *eeprom, int size)
void ftdi_eeprom_initdefaults (struct ftdi_eeprom *eeprom)
void ftdi_eeprom_free (struct ftdi_eeprom *eeprom)
int ftdi_eeprom_build (struct ftdi_eeprom *eeprom, unsigned char *output)
int ftdi_eeprom_decode (struct ftdi_eeprom *eeprom, unsigned char *output, int size)
int ftdi_read_eeprom (struct ftdi_context *ftdi, unsigned char *eeprom)
int ftdi_read_chipid (struct ftdi_context *ftdi, unsigned int *chipid)
int ftdi_read_eeprom_getsize (struct ftdi_context *ftdi, unsigned char *eeprom, int maxsize)
int ftdi_write_eeprom (struct ftdi_context *ftdi, unsigned char *eeprom)
int ftdi_erase_eeprom (struct ftdi_context *ftdi)
int ftdi_read_eeprom_location (struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)
int ftdi_write_eeprom_location (struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val)
char * ftdi_get_error_string (struct ftdi_context *ftdi)

Define Documentation

#define FTDI_DEFAULT_EEPROM_SIZE 128Definition at line 22 of file ftdi.h. Referenced by ftdi_eeprom_initdefaults(), and ftdi_init().

#define MPSSE_WRITE_NEG 0x01Definition at line 60 of file ftdi.h.

#define MPSSE_BITMODE 0x02Definition at line 61 of file ftdi.h.

#define MPSSE_READ_NEG 0x04Definition at line 62 of file ftdi.h.

#define MPSSE_LSB 0x08Definition at line 63 of file ftdi.h.

#define MPSSE_DO_WRITE 0x10Definition at line 64 of file ftdi.h.

#define MPSSE_DO_READ 0x20Definition at line 65 of file ftdi.h.

#define MPSSE_WRITE_TMS 0x40Definition at line 66 of file ftdi.h.

#define SET_BITS_LOW 0x80Definition at line 69 of file ftdi.h.

#define SET_BITS_HIGH 0x82Definition at line 72 of file ftdi.h.

#define GET_BITS_LOW 0x81Definition at line 75 of file ftdi.h.

#define GET_BITS_HIGH 0x83Definition at line 76 of file ftdi.h.

#define LOOPBACK_START 0x84Definition at line 77 of file ftdi.h.

#define LOOPBACK_END 0x85Definition at line 78 of file ftdi.h.

#define TCK_DIVISOR 0x86Definition at line 79 of file ftdi.h.

#define DIV_VALUE(rate) (rate > 6000000)?0:((6000000/rate -1) > 0xffff)? 0xffff: (6000000/rate -1)Definition at line 82 of file ftdi.h.

#define SEND_IMMEDIATE 0x87Definition at line 85 of file ftdi.h.

#define WAIT_ON_HIGH 0x88Definition at line 86 of file ftdi.h.

#define WAIT_ON_LOW 0x89Definition at line 87 of file ftdi.h.

#define READ_SHORT 0x90Definition at line 90 of file ftdi.h.

#define READ_EXTENDED 0x91Definition at line 92 of file ftdi.h.

#define WRITE_SHORT 0x92Definition at line 95 of file ftdi.h.

#define WRITE_EXTENDED 0x93Definition at line 97 of file ftdi.h.

#define SIO_RESET 0Definition at line 102 of file ftdi.h.

#define SIO_MODEM_CTRL 1Definition at line 103 of file ftdi.h.

#define SIO_SET_FLOW_CTRL 2Definition at line 104 of file ftdi.h.

#define SIO_SET_BAUD_RATE 3Definition at line 105 of file ftdi.h.

#define SIO_SET_DATA 4Definition at line 106 of file ftdi.h.

#define FTDI_DEVICE_OUT_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT)Definition at line 108 of file ftdi.h. Referenced by ftdi_disable_bitbang(), ftdi_enable_bitbang(), ftdi_erase_eeprom(), 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_eeprom(), and ftdi_write_eeprom_location().

#define FTDI_DEVICE_IN_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN)Definition at line 109 of file ftdi.h. Referenced by ftdi_get_latency_timer(), ftdi_poll_modem_status(), ftdi_read_chipid(), ftdi_read_eeprom(), ftdi_read_eeprom_getsize(), ftdi_read_eeprom_location(), and ftdi_read_pins().

#define SIO_RESET_REQUEST SIO_RESETDefinition at line 112 of file ftdi.h. Referenced by ftdi_usb_purge_rx_buffer(), ftdi_usb_purge_tx_buffer(), and ftdi_usb_reset().

#define SIO_SET_BAUDRATE_REQUEST SIO_SET_BAUD_RATEDefinition at line 113 of file ftdi.h. Referenced by ftdi_set_baudrate().

#define SIO_SET_DATA_REQUEST SIO_SET_DATADefinition at line 114 of file ftdi.h. Referenced by ftdi_set_line_property2().

#define SIO_SET_FLOW_CTRL_REQUEST SIO_SET_FLOW_CTRLDefinition at line 115 of file ftdi.h. Referenced by ftdi_setflowctrl().

#define SIO_SET_MODEM_CTRL_REQUEST SIO_MODEM_CTRLDefinition at line 116 of file ftdi.h. Referenced by ftdi_setdtr(), ftdi_setdtr_rts(), and ftdi_setrts().

#define SIO_POLL_MODEM_STATUS_REQUEST 0x05Definition at line 117 of file ftdi.h. Referenced by ftdi_poll_modem_status().

#define SIO_SET_EVENT_CHAR_REQUEST 0x06Definition at line 118 of file ftdi.h. Referenced by ftdi_set_event_char().

#define SIO_SET_ERROR_CHAR_REQUEST 0x07Definition at line 119 of file ftdi.h. Referenced by ftdi_set_error_char().

#define SIO_SET_LATENCY_TIMER_REQUEST 0x09Definition at line 120 of file ftdi.h. Referenced by ftdi_set_latency_timer().

#define SIO_GET_LATENCY_TIMER_REQUEST 0x0ADefinition at line 121 of file ftdi.h. Referenced by ftdi_get_latency_timer().

#define SIO_SET_BITMODE_REQUEST 0x0BDefinition at line 122 of file ftdi.h. Referenced by ftdi_disable_bitbang(), ftdi_enable_bitbang(), and ftdi_set_bitmode().

#define SIO_READ_PINS_REQUEST 0x0CDefinition at line 123 of file ftdi.h. Referenced by ftdi_read_pins().

#define SIO_READ_EEPROM_REQUEST 0x90Definition at line 124 of file ftdi.h. Referenced by ftdi_read_chipid(), ftdi_read_eeprom(), ftdi_read_eeprom_getsize(), and ftdi_read_eeprom_location().

#define SIO_WRITE_EEPROM_REQUEST 0x91Definition at line 125 of file ftdi.h. Referenced by ftdi_write_eeprom(), and ftdi_write_eeprom_location().

#define SIO_ERASE_EEPROM_REQUEST 0x92Definition at line 126 of file ftdi.h. Referenced by ftdi_erase_eeprom().

#define SIO_RESET_SIO 0Definition at line 129 of file ftdi.h. Referenced by ftdi_usb_reset().

#define SIO_RESET_PURGE_RX 1Definition at line 130 of file ftdi.h. Referenced by ftdi_usb_purge_rx_buffer().

#define SIO_RESET_PURGE_TX 2Definition at line 131 of file ftdi.h. Referenced by ftdi_usb_purge_tx_buffer().

#define SIO_DISABLE_FLOW_CTRL 0x0Definition at line 133 of file ftdi.h.

#define SIO_RTS_CTS_HS (0x1 << 8)Definition at line 145 of file ftdi.h.

#define SIO_DTR_DSR_HS (0x2 << 8)Definition at line 135 of file ftdi.h.

#define SIO_XON_XOFF_HS (0x4 << 8)Definition at line 136 of file ftdi.h.

#define SIO_SET_DTR_MASK 0x1Definition at line 138 of file ftdi.h.

#define SIO_SET_DTR_HIGH ( 1 | ( SIO_SET_DTR_MASK << 8))Definition at line 139 of file ftdi.h. Referenced by ftdi_setdtr(), and ftdi_setdtr_rts().

#define SIO_SET_DTR_LOW ( 0 | ( SIO_SET_DTR_MASK << 8))Definition at line 140 of file ftdi.h. Referenced by ftdi_setdtr(), and ftdi_setdtr_rts().

#define SIO_SET_RTS_MASK 0x2Definition at line 141 of file ftdi.h.

#define SIO_SET_RTS_HIGH ( 2 | ( SIO_SET_RTS_MASK << 8 ))Definition at line 142 of file ftdi.h. Referenced by ftdi_setdtr_rts(), and ftdi_setrts().

#define SIO_SET_RTS_LOW ( 0 | ( SIO_SET_RTS_MASK << 8 ))Definition at line 143 of file ftdi.h. Referenced by ftdi_setdtr_rts(), and ftdi_setrts().

#define SIO_RTS_CTS_HS (0x1 << 8)Definition at line 145 of file ftdi.h.

#define FTDI_URB_USERCONTEXT_COOKIE ((void *)0x1)Definition at line 149 of file ftdi.h. Referenced by ftdi_init().

#define DEPRECATED(func) funcDefinition at line 157 of file ftdi.h.

Enumeration Type Documentation

enum ftdi_chip_type FTDI chip typeEnumerator: TYPE_AM  TYPE_BM  TYPE_2232C  TYPE_R  TYPE_2232H  TYPE_4232H  Definition at line 25 of file ftdi.h.

enum ftdi_parity_type Parity mode for ftdi_set_line_property()Enumerator: NONE  ODD  EVEN  MARK  SPACE  Definition at line 27 of file ftdi.h.

enum ftdi_stopbits_type Number of stop bits for ftdi_set_line_property()Enumerator: STOP_BIT_1  STOP_BIT_15  STOP_BIT_2  Definition at line 29 of file ftdi.h.

enum ftdi_bits_type Number of bits for ftdi_set_line_property()Enumerator: BITS_7  BITS_8  Definition at line 31 of file ftdi.h.

enum ftdi_break_type Break type for ftdi_set_line_property2()Enumerator: BREAK_OFF  BREAK_ON  Definition at line 33 of file ftdi.h.

enum ftdi_mpsse_mode MPSSE bitbang modesEnumerator: BITMODE_RESET  switch off bitbang mode, back to regular serial/FIFO BITMODE_BITBANG  classical asynchronous bitbang mode, introduced with B-type chips BITMODE_MPSSE  MPSSE mode, available on 2232x chips BITMODE_SYNCBB  synchronous bitbang mode, available on 2232x and R-type chips BITMODE_MCU  MCU Host Bus Emulation mode, available on 2232x chips BITMODE_OPTO  Fast Opto-Isolated Serial Interface Mode, available on 2232x chips BITMODE_CBUS  Bitbang on CBUS pins of R-type chips, configure in EEPROM before BITMODE_SYNCFF  Single Channel Synchronous FIFO mode, available on 2232H chips Definition at line 36 of file ftdi.h.

enum ftdi_interface Port interface for chips with multiple interfacesEnumerator: INTERFACE_ANY  INTERFACE_A  INTERFACE_B  INTERFACE_C  INTERFACE_D  Definition at line 50 of file ftdi.h.

Function Documentation

int DEPRECATED (ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask))

AuthorGenerated automatically by Doxygen for libftdi from the source code.
0
Johanes Gumabo
Data Size   :   102,542 byte
man-ftdi.h.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 237,029
Visitor ID   :     :  
Visitor IP   :   13.58.203.104   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.