c++ - Ftdilib installed but ftdi_enable_bitbang "was not declared in this scope" -
i installed ftdilib , trying compile code:
/* hello-ftdi.c: flash led connected between cts , gnd. example uses libftdi api. minimal error checking; written brevity, not durability. */ #include <stdio.h> #include <ftdi.h> #define led 0x08 /* cts (brown wire on ftdi cable) */ int main() { unsigned char c = 0; struct ftdi_context ftdic; /* initialize context subsequent function calls */ ftdi_init(&ftdic); /* open ftdi device based on ft232r vendor & product ids */ if(ftdi_usb_open(&ftdic, 0x0403, 0x6001) < 0) { puts("can't open device"); return 1; } /* enable bitbang mode single output line */ ftdi_enable_bitbang(&ftdic, led); /* endless loop: invert led state, write output, pause 1 second */ for(;;) { c ^= led; ftdi_write_data(&ftdic, &c, 1); sleep(1); } } but there error: ftdi_enable_bitbang not declared in scope error.
why keep pop out?
one quick current version of ftdi.h shows there no declaration ftdi_enable_bitbang. ftdi_enable_bitbang has been removed after being deprecated 2 years. use ftdi_set_bitmode instead.
Comments
Post a Comment