1
Discussion - Software / Re: LibMPSSE I2C Library ACK Issue
« on: January 09, 2024, 04:52:01 PM »
Sounds good thank you!
Welcome to the FTDI Community!
Please read our Welcome Note
Technical Support enquires
please contact the team @ FTDI Support
New Bridgetek Community is now open
Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.
Please follow this link and create a new user account to get started.
Bridgetek Community
status = FT_Channel_Write(I2C, handle, noOfBytes, buffer, &noOfBytesTransferred);
{/*Get ack*/
noOfBytes = 1;
noOfBytesTransferred = 0;
INFRA_SLEEP(1);
status = FT_Channel_Read(I2C, handle, noOfBytes, inBuffer,
&noOfBytesTransferred);
/*Get Ack*/
code. Exactly where does the I2C library read the ACK bit?#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "../ftd2xx.h"
static void showVersion (DWORD locationID)
{
FT_STATUS ftStatus;
FT_HANDLE ftHandle = (FT_HANDLE) NULL;
ftStatus = FT_OpenEx((PVOID)(uintptr_t)locationID, FT_OPEN_BY_LOCATION, &ftHandle);
if (!FT_SUCCESS(ftStatus))
{
printf("FT_OpenEx failed (error %d)\n",
(int)ftStatus);
return;
}
(void)FT_Close(ftHandle);
}
int main (void)
{
FT_STATUS ftStatus;
FT_DEVICE_LIST_INFO_NODE *devInfo = NULL;
DWORD numDevs = 0;
int retCode = 0;
ftStatus = FT_CreateDeviceInfoList(&numDevs);
if (!FT_SUCCESS(ftStatus))
{
printf("FT_CreateDeviceInfoList failed (error %d)\n",
(int)ftStatus);
retCode = EXIT_FAILURE;
goto exit;
}
if (numDevs == 0)
{
printf("No devices connected\n");
retCode = EXIT_FAILURE+1;
goto exit;
}
else
{
printf("Number of devices is %d\n", numDevs);
}
/* Allocate Storage */
devInfo = calloc((size_t)numDevs, sizeof(FT_DEVICE_LIST_INFO_NODE));
if (devInfo == NULL)
{
printf("Allocation failure.\n");
retCode = EXIT_FAILURE+2;
goto exit;
}
ftStatus = FT_GetDeviceInfoList(devInfo, &numDevs);
if (!FT_SUCCESS(ftStatus))
{
printf("FT_GetDeviceInfoList failed (error %d)\n",
(int)ftStatus);
retCode = EXIT_FAILURE+3;
goto exit;
}
for (int i=0; i<(int)numDevs; i++)
{
printf("Device[%d] Type is 0x%x\n", i, devInfo[i].Type);
printf("Device[%d] LocId is 0x%x\n", i, devInfo[i].LocId);
printf("Device[%d] Flags is 0x%x\n", i, devInfo[i].Flags);
showVersion(devInfo[i].LocId);
}
exit:
free(devInfo);
return retCode;
}
linux@linux-desktop:~$ sudo rmmod ftdi_sio
linux@linux-desktop:~$ sudo rmmod usbserial
linux@linux-desktop:~$ dmesg | grep ftdi
[13124.959002] usbcore: registered new interface driver ftdi_sio
[13124.959155] ftdi_sio 1-1.2:1.0: FTDI USB Serial Device converter detected
[13124.962715] ftdi_sio 1-1.2:1.1: FTDI USB Serial Device converter detected
[13124.963148] ftdi_sio 1-1.2:1.2: FTDI USB Serial Device converter detected
[13124.965881] ftdi_sio 1-1.2:1.3: FTDI USB Serial Device converter detected
[13171.085880] ftdi_sio ttyUSB3: FTDI USB Serial Device converter now disconnected from ttyUSB3
[13171.086023] ftdi_sio ttyUSB2: FTDI USB Serial Device converter now disconnected from ttyUSB2
[13171.086336] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[13171.087592] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[13171.087638] usbcore: deregistering interface driver ftdi_sio
[13171.087688] ftdi_sio 1-1.2:1.3: device disconnected
[13171.087751] ftdi_sio 1-1.2:1.2: device disconnected
[13171.087810] ftdi_sio 1-1.2:1.1: device disconnected
[13171.087868] ftdi_sio 1-1.2:1.0: device disconnected