Ftdi::Context(3)

πŸ“¦
version 1.5.42+git.de9f01e Β· 2 versions
, in opensuse-leap 16.0

okay so this is the Ftdi::Context(3) page from the libftdi1 manual, bestie β€” part 1, and we're doing the whole thing πŸ’…βœ¨

πŸ’– NAME πŸ’–

Ftdi::Context β€” the FTDI device context. Represents a single FTDI device context. One FTDI device, one context; that's the whole point 🫢

🌸 SYNOPSIS 🌸

#include <ftdi.hpp>

πŸŽ€ Classes πŸŽ€

  • class Private

🌈 Public Types 🌈

  • enum Direction { Input = 0x2, Output = 0x1 } β€” Direction flags for flush(), slay ✨
  • enum ModemCtl { Dtr = 0x2, Rts = 0x1 } β€” Modem control flags, periodt πŸ’…

πŸ‘‘ Public Member Functions πŸ‘‘

  • Context () β€” Constructor 🐣
  • ~Context () β€” Destructor 😭
  • Eeprom * eeprom ()
  • const std::string & vendor () β€” Device strings property πŸŽ€
  • const std::string & description () β€” Device strings property πŸŽ€
  • const std::string & serial () β€” Device strings property πŸŽ€
  • bool is_open ()
  • int open (struct libusb_device *dev=0)
  • int open (int vendor, int product)
  • int open (int vendor, int product, const std::string &description, const std::string &serial=std::string(), unsigned int index=0)
  • int open (const std::string &description)
  • int close ()
  • int reset ()
  • int DEPRECATED flush (int mask=Input|Output) β€” this one is literally marked DEPRECATED, so treat it like a warning label, bestie 🚩
  • int tcflush (int mask=Input|Output)
  • int set_interface (enum ftdi_interface interface)
  • void set_usb_device (struct libusb_device_handle *dev)
  • int set_baud_rate (int baudrate)
  • int set_line_property (enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)
  • int set_line_property (enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity, enum ftdi_break_type break_type)
  • int get_usb_read_timeout () const
  • void set_usb_read_timeout (int usb_read_timeout)
  • int get_usb_write_timeout () const
  • void set_usb_write_timeout (int usb_write_timeout)
  • int read (unsigned char *buf, int size)
  • int write (const unsigned char *buf, int size)
  • int set_read_chunk_size (unsigned int chunksize)
  • int set_write_chunk_size (unsigned int chunksize)
  • int read_chunk_size ()
  • int write_chunk_size ()
  • int set_event_char (unsigned char eventch, unsigned char enable)
  • int set_error_char (unsigned char errorch, unsigned char enable)
  • int set_flow_control (int flowctrl)
  • int set_modem_control (int mask=Dtr|Rts)
  • int set_latency (unsigned char latency)
  • int set_dtr (bool state)
  • int set_rts (bool state)
  • unsigned short poll_modem_status ()
  • unsigned latency ()
  • int set_bitmode (unsigned char bitmask, unsigned char mode)
  • int set_bitmode (unsigned char bitmask, enum ftdi_mpsse_mode mode)
  • int bitbang_disable ()
  • int read_pins (unsigned char *pins)
  • const char * error_string ()

πŸ›‘οΈ Protected Member Functions πŸ›‘οΈ

  • int get_strings (bool vendor=true, bool description=true, bool serial=true)
  • int get_strings_and_reopen (bool vendor=true, bool description=true, bool serial=true)
  • struct ftdi_context * context ()
  • void set_context (struct ftdi_context *context)
  • void set_usb_device (struct libusb_device *dev)

🫢 Friends 🫢

  • class Eeprom
  • class List

πŸ’« Detailed Description πŸ’«

Ftdi::Context is the FTDI device context β€” it represents a single FTDI device context. That's literally the whole description, bestie. One device, one context, main character energy πŸ‘‘

Definition at line 47 of file ftdi.hpp.

🧚 Member Enumeration Documentation 🧚

enum Ftdi::Context::Direction

Direction flags for flush(), hello? πŸ’…

Enumerator:

  • Input
  • Output

Definition at line 56 of file ftdi.hpp.

enum Ftdi::Context::ModemCtl

Modem control flags β€” cute little flags for modem control πŸŽ€

Enumerator:

  • Dtr
  • Rts

Definition at line 64 of file ftdi.hpp.

πŸ› οΈ Constructor & Destructor Documentation πŸ› οΈ

Ftdi::Context::Context ()

Constructor. The context gets born here ✨

Definition at line 67 of file ftdi.cpp.

Ftdi::Context::~Context ()

Destructor. The context says bye 😭

Definition at line 74 of file ftdi.cpp.

✨ Member Function Documentation ✨

okay bestie, buckle up β€” this is the whole member-function roster of Ftdi::Context, in the exact order the docs hand them to us. no skipping, no "you get the vibe" shortcuts, we're doing every single one πŸ’…


Eeprom * Ftdi::Context::eeprom ()

The docs don't drop a Definition at line for this one (rude, honestly), but here's the reference list, and it is long: it references context(), description(), Dtr, Eeprom, flush(), Input, latency(), Output, Rts, serial(), and vendor().

const std::string & Ftdi::Context::vendor ()

Device strings properties, that's the official word, and honestly the minimalism is giving main character energy.

Definition at line 409 of file ftdi.cpp.

References get_strings_and_reopen().

Referenced by eeprom(), get_strings(), get_strings_and_reopen(), open(), and open().

const std::string & Ftdi::Context::description ()

Device strings properties again β€” yes this trio really said "same note, three times" and honestly we respect the consistency πŸŽ€

Definition at line 418 of file ftdi.cpp.

References get_strings_and_reopen().

Referenced by eeprom(), get_strings(), get_strings_and_reopen(), open(), and open().

const std::string & Ftdi::Context::serial ()

Device strings properties. third member of the trio, still iconic.

Definition at line 427 of file ftdi.cpp.

References get_strings_and_reopen().

Referenced by eeprom(), get_strings(), get_strings_and_reopen(), and open().

bool Ftdi::Context::is_open ()

Definition at line 78 of file ftdi.cpp. no drama, no references, just vibes ✨

int Ftdi::Context::open (struct libusb_device * dev = 0)

Definition at line 123 of file ftdi.cpp.

References get_strings_and_reopen().

int Ftdi::Context::open (int vendor, int product)

Definition at line 83 of file ftdi.cpp.

References ftdi_usb_open(), get_strings_and_reopen(), and vendor().

int Ftdi::Context::open β€” the long one, bestie

int Ftdi::Context::open (int vendor, int product, const std::string &
    description, const std::string & serial = std::string(), unsigned int
    index = 0)

Definition at line 94 of file ftdi.cpp.

References description(), ftdi_usb_open_desc_index(), get_strings_and_reopen(), serial(), and vendor().

int Ftdi::Context::open (const std::string & description)

Definition at line 113 of file ftdi.cpp.

References description(), ftdi_usb_open_string(), and get_strings_and_reopen().

int Ftdi::Context::close ()

Definition at line 134 of file ftdi.cpp.

References ftdi_usb_close().

int Ftdi::Context::reset ()

Definition at line 141 of file ftdi.cpp.

References ftdi_usb_reset().

int Ftdi::Context::flush (int mask = Input|Output)

Definition at line 146 of file ftdi.cpp.

References ftdi_usb_purge_buffers(), ftdi_usb_purge_rx_buffer(), ftdi_usb_purge_tx_buffer(), Input, and Output.

Referenced by eeprom().

int Ftdi::Context::tcflush (int mask = Input|Output)

Definition at line 172 of file ftdi.cpp.

References ftdi_tciflush(), ftdi_tcioflush(), ftdi_tcoflush(), Input, and Output.

int Ftdi::Context::set_interface (enum ftdi_interface interface)

Definition at line 198 of file ftdi.cpp.

References ftdi_set_interface().

void Ftdi::Context::set_usb_device (struct libusb_device_handle * dev)

Definition at line 203 of file ftdi.cpp.

References ftdi_set_usbdev().

Referenced by Ftdi::List::List().

int Ftdi::Context::set_baud_rate (int baudrate)

Definition at line 209 of file ftdi.cpp.

References ftdi_set_baudrate().

int Ftdi::Context::set_line_property (the three-arg one)

int Ftdi::Context::set_line_property (enum ftdi_bits_type bits, enum
    ftdi_stopbits_type sbit, enum ftdi_parity_type parity)

Definition at line 214 of file ftdi.cpp.

References ftdi_set_line_property().

int Ftdi::Context::set_line_property (the four-arg glow-up)

int Ftdi::Context::set_line_property (enum ftdi_bits_type bits, enum
    ftdi_stopbits_type sbit, enum ftdi_parity_type parity, enum
    ftdi_break_type break_type)

Definition at line 219 of file ftdi.cpp.

References ftdi_set_line_property2().

int Ftdi::Context::get_usb_read_timeout () const

Definition at line 224 of file ftdi.cpp.

void Ftdi::Context::set_usb_read_timeout (int usb_read_timeout)

Definition at line 229 of file ftdi.cpp.

int Ftdi::Context::get_usb_write_timeout () const

Definition at line 234 of file ftdi.cpp.

void Ftdi::Context::set_usb_write_timeout (int usb_write_timeout)

Definition at line 239 of file ftdi.cpp.

int Ftdi::Context::read (unsigned char * buf, int size)

Definition at line 244 of file ftdi.cpp.

References ftdi_read_data().

int Ftdi::Context::write (const unsigned char * buf, int size)

Definition at line 263 of file ftdi.cpp.

References ftdi_write_data().

int Ftdi::Context::set_read_chunk_size (unsigned int chunksize)

Definition at line 249 of file ftdi.cpp.

References ftdi_read_data_set_chunksize().

int Ftdi::Context::set_write_chunk_size (unsigned int chunksize)

Definition at line 268 of file ftdi.cpp.

References ftdi_write_data_set_chunksize().

int Ftdi::Context::read_chunk_size ()

Definition at line 254 of file ftdi.cpp.

References ftdi_read_data_get_chunksize().

int Ftdi::Context::write_chunk_size ()

Definition at line 273 of file ftdi.cpp.

References ftdi_write_data_get_chunksize().

int Ftdi::Context::set_event_char (unsigned char eventch, unsigned char enable)

Definition at line 328 of file ftdi.cpp.

References ftdi_set_event_char().

int Ftdi::Context::set_error_char (unsigned char errorch, unsigned char enable)

Definition at line 333 of file ftdi.cpp.

References ftdi_set_error_char().

int Ftdi::Context::set_flow_control (int flowctrl)

Definition at line 282 of file ftdi.cpp.

References ftdi_setflowctrl().

int Ftdi::Context::set_modem_control (int mask = Dtr|Rts)

Definition at line 287 of file ftdi.cpp.

References Dtr, ftdi_setdtr_rts(), and Rts.

int Ftdi::Context::set_latency (unsigned char latency)

Definition at line 309 of file ftdi.cpp.

References ftdi_set_latency_timer(), and latency().

int Ftdi::Context::set_dtr (bool state)

Definition at line 299 of file ftdi.cpp.

References ftdi_setdtr().

int Ftdi::Context::set_rts (bool state)

Definition at line 304 of file ftdi.cpp.

References ftdi_setrts().

unsigned short Ftdi::Context::poll_modem_status ()

Definition at line 321 of file ftdi.cpp.

References ftdi_poll_modem_status().

unsigned Ftdi::Context::latency ()

Definition at line 314 of file ftdi.cpp.

References ftdi_get_latency_timer(), and latency().

Referenced by eeprom(), latency(), and set_latency().

int Ftdi::Context::set_bitmode (unsigned char bitmask, unsigned char mode)

Definition at line 338 of file ftdi.cpp.

References ftdi_set_bitmode().

int Ftdi::Context::set_bitmode (unsigned char bitmask, enum ftdi_mpsse_mode mode)

Definition at line 343 of file ftdi.cpp.

References ftdi_set_bitmode().

int Ftdi::Context::bitbang_disable ()

Definition at line 348 of file ftdi.cpp.

References ftdi_disable_bitbang().

int Ftdi::Context::read_pins (unsigned char * pins)

Definition at line 353 of file ftdi.cpp.

References ftdi_read_pins().

const char * Ftdi::Context::error_string ()

Definition at line 358 of file ftdi.cpp.

References ftdi_get_error_string().

int Ftdi::Context::get_strings β€” [protected]

int Ftdi::Context::get_strings (bool vendor = true, bool description = true,
    bool serial = true) [protected]

Definition at line 363 of file ftdi.cpp.

References description(), ftdi_usb_get_strings(), serial(), and vendor().

Referenced by get_strings_and_reopen(), and Ftdi::List::List().

int Ftdi::Context::get_strings_and_reopen β€” [protected]

int Ftdi::Context::get_strings_and_reopen (bool vendor = true, bool
    description = true, bool serial = true) [protected]

Definition at line 380 of file ftdi.cpp.

References description(), ftdi_usb_open_dev(), get_strings(), serial(), and vendor().

Referenced by description(), open(), open(), open(), open(), serial(), and vendor().

struct ftdi_context * Ftdi::Context::context () [protected]

Definition at line 445 of file ftdi.cpp.

Referenced by Ftdi::Eeprom::Eeprom(), eeprom(), Ftdi::List::find_all(), and set_context().

void Ftdi::Context::set_context (struct ftdi_context * context) [protected]

Definition at line 434 of file ftdi.cpp.

References context(), and ftdi_free().

void Ftdi::Context::set_usb_device (struct libusb_device * dev) [protected]

Definition at line 440 of file ftdi.cpp. that's it, that's the whole entry, and honestly? respect for the brevity 🫢


the chosen ones, the inner circle, the besties with special access:

friend class Eeprom [friend]

Definition at line 50 of file ftdi.hpp.

References Eeprom.

Referenced by Eeprom, and eeprom().

friend class List [friend]

Definition at line 51 of file ftdi.hpp.

References List.

Referenced by List.


✍️ Author ✍️

Generated automatically by Doxygen for libftdi1 from the source code. not a human, not a vibe curator, just Doxygen doing its thing πŸ€–βœ¨

and that's a wrap, bestie πŸŽ€ this page is Version 1.5, stamped Wed Nov 6 2024 09:58:53, and you'll find it filed under Ftdi::Context(3) β€” go forth and open() responsibly πŸ’–
πŸ“¦ where this page comes from