Other Parts Discussed in Thread: TPIC2810, TCA9555
Hi there,
2 Questions at this stage:
I am currently playing around and stuying the I2C API's in order to program IO expansion headers. One goal for example is to program the MCU_UART_IO_EXP_SEL pin so that MCU_Rx data can be obtained from the MCU_UART test header. To study this, I imported the baremetal led_industrial_test files into the CCS baremetal template application, and got it running from there. Here is the project that executes successfully on the EVM: LEDtest.zip
Now I am trying to test some of the API's, of which the Board_i2cIoExpReadPort() API, located at C:\ti\pdk_am65xx_1_0_5\packages\ti\board\src\evmKeystone3\board_i2c_io_exp.c is one. This API according to me is supposed to get the levels ('1'or '0') of the IO Expander, and store it in a user defined data buffer. However, I do not seem to get this API to retunr the correct values, please refer to my steps below:
- within BoardDiag_i2c_slave_device_led_test() function, I create a buffer in which the API should store the voltage levels of the IO expander:
uint8_t readRegData[1] = {0};
- then, after the I2C has been initialized and right before I write some data to the I2C expander, I simply call the Board_i2cIoExpReadPort() API to first get the levels of the IO Expander pins:
ret = Board_i2cIoExpReadPort(BOARD_I2C_IOEXP_DEVICE1_ADDR, PORTNUM_NONE, readRegData);
ret = Board_i2cIoExpWritePort(BOARD_I2C_IOEXP_DEVICE1_ADDR, PORTNUM_NONE, writeRegData);
- however, I keep getting the same return value from the read API, which just fills the buffer with "1', however that obviously does not correspond to the states of the LED's (Only one LED is on at a certain time):
So my question is, how can I correctly use this API in order to get the levels of a IO expansion header? Maybe I am using this API completely wrong and making a very rooky mistake somewhere.
My other question, is that the IO expansion header which controls the LED's which I am currently testing, is of type TPIC2810D, which only has 8 pins, wereas the IO expansion header on which the MCU_UART_SEL pin is located, is of type TCA9555RTWR and has 16 pins:
Are there driver API's available for the TCA9555RTWR? Can the API's that are used on the TPIC2810 be used on it, and if so, how? Otherwise I guess I would manually have to go and develop driver API's for this IO expansion header in order to program the select pins.
I look forward to any assistance and advise.
I am using:
- CCS910
- pdk_am65xx_1_0_5
- processor_sdk_rtos_am65xx_6_00_00_07
Kind regards,
Johhny