Software I2C Master Component for PSoC 3/4/5
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Attached file contains the implementation of a software I2C Master component, which does not require any UDB or Fixed-Function block. It implements non-blocking functions to write and read i2c packets without using any interrupt. The user needs to call a "process" function to move on with the i2c packet. Here is an example on how to use this component in the main loop:
SW_I2C_WriteBuf(I2C_SLAVE_ADDR, i2cBuffer, PACKET_SIZE, SW_I2C_MODE_COMPLETE_XFER);
for(;;)
{
status = SW_I2C_Process();
if ((status & SW_I2C_MSTAT_WR_CMPLT) != 0)
{
/* Do something */
}
if ((status & SW_I2C_MSTAT_RD_CMPLT) != 0)
{
/* Do something */
}
CyDelayUs(5);
}
To use the attached file, follow the steps from this video.
This is NOT an official release from Cypress. Use it on your own risk.
- Tags:
- i2c
- i2c master
- Subscribe to RSS Feed
- Mark Article as New
- Mark Article as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Thanks for the component rlos, i have no use for it (yet) but it's always nice to see how others implement custom components
Regards,
Carlos
- Subscribe to RSS Feed
- Mark Article as New
- Mark Article as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
I'm trying to use the component but it seems like the blocking I2C functions (WriteByte and ReadByte) don't exist. Do you have an updated version of the component that includes these functions? Or could you give me some direction on how to write these functions?
Thanks
Amilcar