Skip to content

Commit 7a5d9bf

Browse files
committed
Enable setting FT4232 ports as GPIO
Enable setting FT4232 ports as GPIO. Aside from port B that is used for I2C communication, port C or port D might be used as GPIOs. This is true for S32N79RDB that has TP32, TP30, TP29 and TP27 connected to Port C and D. Signed-off-by: Costin Constantin <costin.constantin@nxp.com>
1 parent d74e0ae commit 7a5d9bf

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

chip.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,8 +1054,7 @@ void* ft4232h_gpio_create(char* chip_specification, void* parent)
10541054
int ft4232h_gpio_write(void* ft4232h, unsigned char bit_value)
10551055
{
10561056
struct ft4232h_gpio* ft = ft4232h;
1057-
int mask = 0xFF;
1058-
if (ft_set_bitmode(ft->ftdi_info, mask, BM_BITBANG) < 0)
1057+
if (ft_set_bitmode(ft->ftdi_info, ft->gpio_device.pin_bitmask, BM_BITBANG) < 0)
10591058
printf("failed to set bitmode\n");
10601059

10611060
unsigned char current_output;

port.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ int ft_open_channel(struct ftdi_info* fi, int channel)
178178

179179
int ft_close(struct ftdi_info* fi)
180180
{
181-
//ft_set_bitmode(fi, 0, 0); //resetting the controller. This will reset port C/D which is not desired.
182181
#ifdef _WIN32
183182
int num = fi->FT_close(fi->ftdi);
184183
//printf("%d\n",num);

0 commit comments

Comments
 (0)