|
| | HardwareI2C_FTDI (int channel=0) |
| | Constructor for FTDI I2C interface.
|
|
| ~HardwareI2C_FTDI () |
| | Destructor - closes FTDI connection.
|
| int | available () override |
| | Get the number of bytes available for reading.
|
| void | begin () override |
| | Initialize I2C as master (same as begin()).
|
| bool | begin (int vendor_id=0x0403, int product_id=0x6010, const char *description=nullptr, const char *serial=nullptr) |
| | Initialize the I2C interface.
|
| void | begin (uint8_t address) override |
| | Initialize I2C as slave (not supported by FTDI).
|
| void | beginTransmission (uint8_t address) override |
| | Begin transmission to an I2C slave device.
|
| void | end () override |
| | Close the I2C interface and cleanup resources.
|
| uint8_t | endTransmission (bool stopBit=true) override |
| | End transmission and send data to slave device.
|
| uint8_t | endTransmission (void) override |
| | End transmission and send data to slave device (with stop condition).
|
| void | flush () override |
| | Flush the output buffer (no-op for I2C).
|
| void | onReceive (void(*function)(int)) override |
| | Register a function to be called when data is received as a slave.
|
| void | onRequest (void(*function)(void)) override |
| | Register a function to be called when master requests data from slave.
|
| | operator bool () |
| | Boolean conversion operator.
|
| int | peek () override |
| | Peek at the next byte without removing it from buffer.
|
| int | read () override |
| | Read a byte from the receive buffer.
|
| size_t | requestFrom (uint8_t address, size_t quantity) override |
| size_t | requestFrom (uint8_t address, size_t quantity, bool stopBit=true) override |
| | Request data from an I2C slave device.
|
| void | setClock (uint32_t freq) override |
| | Set the I2C clock frequency.
|
| size_t | write (const uint8_t *data, size_t len) override |
| | Write multiple bytes to the I2C bus.
|
| size_t | write (uint8_t data) override |
| | Write a single byte to the I2C bus.
|
|
bool | find (char target) |
|
bool | find (const char *target) |
|
bool | find (const char *target, size_t length) |
|
bool | find (const uint8_t *target) |
|
bool | find (const uint8_t *target, size_t length) |
|
bool | findUntil (const char *target, const char *terminator) |
|
bool | findUntil (const char *target, size_t targetLen, const char *terminate, size_t termLen) |
|
bool | findUntil (const uint8_t *target, const char *terminator) |
|
bool | findUntil (const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen) |
|
unsigned long | getTimeout (void) |
|
float | parseFloat (LookaheadMode lookahead=SKIP_ALL, char ignore=NO_IGNORE_CHAR) |
|
long | parseInt (LookaheadMode lookahead=SKIP_ALL, char ignore=NO_IGNORE_CHAR) |
|
size_t | readBytes (char *buffer, size_t length) |
|
size_t | readBytes (uint8_t *buffer, size_t length) |
|
size_t | readBytesUntil (char terminator, char *buffer, size_t length) |
|
size_t | readBytesUntil (char terminator, uint8_t *buffer, size_t length) |
|
String | readString () |
|
String | readStringUntil (char terminator) |
|
void | setTimeout (unsigned long timeout) |
| virtual int | availableForWrite () |
|
void | clearWriteError () |
|
int | getWriteError () |
|
size_t | print (char) |
|
size_t | print (const __FlashStringHelper *) |
|
size_t | print (const char[]) |
|
size_t | print (const Printable &) |
|
size_t | print (const String &) |
|
size_t | print (double, int=2) |
|
size_t | print (int, int=DEC) |
|
size_t | print (long long, int=DEC) |
|
size_t | print (long, int=DEC) |
|
size_t | print (unsigned char, int=DEC) |
|
size_t | print (unsigned int, int=DEC) |
|
size_t | print (unsigned long long, int=DEC) |
|
size_t | print (unsigned long, int=DEC) |
|
size_t | println (char) |
|
size_t | println (const __FlashStringHelper *) |
|
size_t | println (const char[]) |
|
size_t | println (const Printable &) |
|
size_t | println (const String &s) |
|
size_t | println (double, int=2) |
|
size_t | println (int, int=DEC) |
|
size_t | println (long long, int=DEC) |
|
size_t | println (long, int=DEC) |
|
size_t | println (unsigned char, int=DEC) |
|
size_t | println (unsigned int, int=DEC) |
|
size_t | println (unsigned long long, int=DEC) |
|
size_t | println (unsigned long, int=DEC) |
|
size_t | println (void) |
|
size_t | write (const char *buffer, size_t size) |
|
size_t | write (const char *str) |
|
| bool | configureMPSSE () |
| | Configure FTDI device for I2C MPSSE mode.
|
| uint8_t | receiveByteSendAck (bool send_ack) |
| | Receive a byte over I2C and send ACK/NACK.
|
| int | receiveData (uint8_t *data, size_t length) |
| | Receive raw data from FTDI device.
|
| bool | sendByteCheckAck (uint8_t data) |
| | Send a byte over I2C and check for ACK.
|
| int | sendData (const uint8_t *data, size_t length) |
| | Send raw data to FTDI device.
|
| bool | sendRepeatedStart () |
| | Send I2C repeated start condition.
|
| bool | sendStart () |
| | Send I2C start condition.
|
| bool | sendStop () |
| | Send I2C stop condition.
|
| bool | setClockFrequency (uint32_t frequency) |
| | Set the I2C clock frequency.
|
| bool | setLineStates (bool sda_state, bool scl_state) |
| | Set the state of SDA and SCL lines.
|
|
int | findMulti (struct MultiTarget *targets, int tCount) |
|
float | parseFloat (char ignore) |
|
long | parseInt (char ignore) |
|
int | peekNextDigit (LookaheadMode lookahead, bool detectDecimal) |
|
int | timedPeek () |
|
int | timedRead () |
|
void | setWriteError (int err=1) |
Implementation of I2C communication for FTDI FT2232HL using MPSSE mode.
This class provides an interface to the I2C bus on FTDI FT2232HL devices using the Multi-Protocol Synchronous Serial Engine (MPSSE) mode. The FT2232HL can operate in MPSSE mode to provide I2C master functionality.
Pin mapping for I2C on FT2232HL (Channel A):
- ADBUS0: SCL (Clock) - requires 4.7kΩ pull-up resistor
- ADBUS1: SDA_OUT (Data Out)
- ADBUS2: SDA_IN (Data In) - requires 4.7kΩ pull-up resistor
- ADBUS3-7: Available for other functions
The class inherits from HardwareI2C and implements all required methods for I2C communication, including device addressing, data transfer, and bus management.
- Note
- This class is only available when USE_FTDI is defined.
-
Requires libftdi1 development library to be installed.
-
External pull-up resistors (typically 4.7kΩ) are required on SCL and SDA lines.