LIBUSB for FTDI2232 to use I2C mode - i2c

Please help me to support this question:
Due to, we have used FTDI2232H and need to use “LIBUSB" to control FTDI2232H.
I want to ask How to control FTDI2232H related programs/code through LIBUSB.
1.To change MPSS mode to interface2?
2.To open iic and init it?
3.To set clock rate & set master mode?
4.The master write I2C code to slave ?
5.The master read I2C code from slave ?
I want to know how to use LIBUSB(libusb_bulk_transfer、libusb_control_transfer) to control FTDI2232H?
Please anyone can help me to solve my problem,I can not get full information from vendor here!!!

You can try this open-source library to talk with the FTDI: https://github.com/lipro/libftdi
Download and unzip it and then just follow the procedure on the README.
Once you finish it, if you are on build you can:
cd examples
make
Now you just load your examples on the terminal like using './'
You can also modify as you want and then remake those examples.

Related

Simulating PSoC 5LP

I am working on extracting strain gauge values mounted on my ATV (front suspension) with the help of a 20 bit ADC of PSoC 5LP. Before that, I would like to simulate it. So could you please suggest an appropriate simulator? I have tried it on proteus but seems like proteus does not support cypress chips.
Thank you for reading.
I got the solution: It is to upgrade the Proteus Software (Proteus 3.10).Here, libraries are provided from the internet so no need to manually search for them.
Thank you :)

How to change GPIO.BOARD TO GPIO.BCM for sensor SHT10

I want two scripts integrate in to one script.
Scripts for sensors SHT10 and MAX31855. Both make use of software SPI.
The SHT10 use GPIO.BOARD and the MAX31855 use GPIO.BCM.
The problem is that I get an error "ValueError: A different mode is already been set." I don't know how to resolve this because both sensors used different libraries. I think that the problem is in those libraries.
Is there an easy solution for this problem.
Running the scripts separately than there is no problem
You can try using GPIO.setmode(GPIO.BCM) and then in the other program using GPIO.setmode(GPIO.BOARD).

How to add a user defined package/recipe in yocto?

I want to add a program writtem by me to the Yocto and make it part of the build through core-image-minimal. How do I do this? I really couldn't get much info from the reference manuals regarding this.
Can anyone point me to the link where I can get a step-by-step procedure to add a user defined program?
Try
IMAGE_INSTALL_append += "<your-recipe>"
In conf file for the machine you are using.

How can I make dokuwiki shown as PC mode not mobile mode?

I have installed dokuwiki to my server.
It shows in mobile mode when I access to it with Android or iPhone.
But I want to show it as PC mode.
How can I?
Which template are you using?
If it's the default "dokuwiki" template, simply remove the line with css/mobile.css from the style.ini file in ./lib/tpl/dokuwiki/.
Dokuwiki's API let determine if the client is mobile. Then it's up to the template to use this information or not.
You could try grep -rn ismobile . on your template code to see how it is used.
Ideally I would have added a comment to ask which template you use, but I'm afraid I don't have enough reputation to leave comments yet.

printk in driver

I am really new to linux module programming.
I need to some how be able to do some tweak to the ath9k driver in linux.
I finally got the compat wireless source code of ath9k to compile in ubuntu 11.04 and was trying to play around with the code.
I tried using printk to tried to get to see what happen.
First I put printk in the init.c file, the message I printed show up when I use dmesg in the terminal. However, when I tried to use the same printk in another file like rc.c it does not show up at all.
I am wondering why is that?
And is there some other way that I could some how log some information from the code similar to the fprintf. What I need is I need to extract somehow the packet header from the driver.
Thank you
Best Regards.
read about the proc fs, it's a great framework to extract data from device drivers.
once you have registered a device node as proc fs, you can read from it.
once the the read function is called, a callback function you defined is creating the output. this is an excellent way to retrieve data from device.
there are also two other methods, one is sysfs, you can google for it. and the second,
if the the device is a char device, you can implement an ioctrl function which returns the info you need.