Need I2C Driver

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: Need I2C Driver

Post by Panu »

your post above seems to imply that only GPIO1 pins have the engine. Am I reading this correctly?
No, la... all GPIO controllers are similar, and all three GPIO controllers have a dual bit engine.
There's a header file, i2cp2.h which defines the IO pin mappings. The code assumes that they are GPIO1 pins, because the code uses the bit router engine in the peripheral controller to make very efficient code. If you want to use GPIO2 pins instead (as I suppose you want), you'll have to change the rest of the code to access GPIO2 controller registers instead of GPIO1 controller.
What I said, or tried to say anyway, was that there are pin definitions in the .h file. But if you want to use pins in other controller than GPIO1, then just changing those #defines is not enough, you need to touch the code in the .c file also, because the code (.c file) only thinks that GPIO1 controller is used, e.g. it reads and writes only GPIO1 controller registers.

The bit engine is used to make the code very small, because the bit engine handles shifting the bits to the correct position, so the code just needs to shift-or in a loop to get the bytes. Normal GPIO control registers are used to switch between input and output modes for the SDA bit.

-Panu
avizet
Senior User
Posts: 28
Joined: Tue 2021-06-29 11:25

Re: Need I2C Driver

Post by avizet »

Hi!
Panu wrote: Mon 2016-12-05 12:09 Hi!

Right, I've written several I2C implementations for various ICs... Which pins do you want to use for SCL, SDA?
...need to be MIPS efficient...
As per spec, the I2C is very slow bus (400 kHz) but in reality most ICs can perform faster than this...

-Panu
I need the I2C driver for VS1010D.
As I'm working with the VS1010D mini demo board; so I want to use my UART pin (RX, TX) as SDA and SCL.
If the driver is available then please share.

Thank You!
Post Reply