SLUUDD1 August 2025
initializeI2C(speed)
Initializes the FTDI in I2C Mode.
| Speed | Can be between 60k to 3400k. Note that the AFE20408 can only handle up to 400k bps |
i2cWrite(Slave Address, Register Address, Register Data)
Sends an I2C write command to the EVM.
| Slave Address | 8-bit slave address. This address is configurable using EVM jumpers. |
| Register Address | 8-bit register address |
| Register Data | 16-bit register data |
i2cRead(Slave Address, Register Address)
Sends an I2C read command to the EVM. Returns a 16-bit value.
| Slave Address | 8-bit slave address. This address is configurable using EVM jumpers. |
| Register Address | 8-bit register address |
Example:
ftdiObject = FtdiController() # initialize the FTDI
ftdiObject.getFtdiDeviceInfo() # Get FTDI info
ftdiObject.initializeI2C(400) # initialize I2C with 400kbps
# Write to slave address 0x40, register address 0x08, with data 0x0001
ftdiObject.i2cWrite(0x40, 0x08, 0x0001)
# Read back from slave address 0x40, register address 0x08, and print the data.
print(ftdiObject.i2cRead(0x40, 0x08))
ftdiObject.closeHandle() # close the FTDI when done.