Hello.
I'm trying to implement SW I2C function via GPIOs.
Actually I can control IOs as I expected but have problem when I read IO.
1) I2C CLK output is working well
2) I2C SDA output is working well
3) when I configure SDA pin to input, need to read data from slave via SDA, I couldn't get correct data...usually it reads zero even though there is coming data
4) GPIO configuration is like as below
(1) PIN_init() : configures IOs
(2) PIN_open() : open pins which are initialized at PIN_init()
(3) output SCK and SDA
(4) configure SDA port to input via "PIN_setConfig(sw_i2cPinHandle, PIN_BM_INPUT_EN, SW_I2C2_SDA_Pin);"
(5) and read pin like as "val = PIN_getInputValue( SW_I2C2_SDA_Pin);"
(6) and configure to output again, PIN_setConfig(sw_i2cPinHandle, PIN_BM_GPIO_OUTPUT_EN, SW_I2C2_SDA_Pin);
5) I couldn't read data correctly from this procedure and after this, I couldn't control SDA output even I can control SCK
6) I'm not sure whether I can control GPIOs in/out successively
Could someone let me know how I can handle this?
Many thanks.
BR.
Louiey