Comments (3)
Instead of ftdi_sio kernel module , libftdi user space libary can be used to
program
FTDI chips.
Original comment by [email protected]
on 21 Apr 2010 at 11:48
from omapterisk.
Ftdi_sio module is not required.
Here is sample prog to use
/* Sample program for Matrix Orital LK202 25USB using Libftdi user space library
Needs libftdi-devel package,compile as "gcc -lftdi lcd.c"
*/
#include <stdio.h>
#include <ftdi.h>
unsigned char ClearScreen[] = {254,88};
unsigned char lf[]={254,0x0a};
unsigned char cr[]={254,0x0d};
int main(void)
{
int ret;
struct ftdi_context ftdic;
char buf[]="Hello World";
if (ftdi_init(&ftdic) < 0)
{
fprintf(stderr, "ftdi_init failed\n");
return EXIT_FAILURE;
}
if ((ret = ftdi_usb_open(&ftdic, 0x1b3d, 0x0155)) < 0)
{
fprintf(stderr, "unable to open ftdi device: %d (%s)\n", ret,
ftdi_get_error_string(&ftdic));
return EXIT_FAILURE;
}
ftdi_set_baudrate(&ftdic,19200);
ftdi_set_line_property( &ftdic,8,1,NONE);
ftdi_write_data(&ftdic,ClearScreen,sizeof(ClearScreen));
ftdi_write_data(&ftdic,cr,sizeof(cr));
ftdi_write_data(&ftdic,lf,sizeof(lf));
ftdi_write_data(&ftdic,buf,sizeof(buf)-1);
if ((ret = ftdi_usb_close(&ftdic)) < 0)
{
fprintf(stderr, "unable to close ftdi device: %d (%s)\n", ret,
ftdi_get_error_string(&ftdic));
return EXIT_FAILURE;
}
ftdi_deinit(&ftdic);
return EXIT_SUCCESS;
}
Original comment by [email protected]
on 22 Apr 2010 at 6:49
- Added labels: Milestone-Release1.0
from omapterisk.
Original comment by [email protected]
on 2 Aug 2010 at 1:36
- Changed state: Fixed
from omapterisk.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from omapterisk.