This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DS90UB960-Q1: Missing UB960_ReadReg()/UB953_ReadReg() APIs in imaging component

Part Number: DS90UB960-Q1
Other Parts Discussed in Thread: ALP

Hi,

I'm using PSDKR v7.2, and want to read registers from UB960/UB953, but cann't find such APIs in source of imaging component.

I know I can implement them by myself and I've done these actually. But they should be implemented officially.

If there are APIs for writting, then APIs for reading should be implemented too.

And sometime uses may want to log registers in their code for debugging.

And I know I can use ALP GUI to read registers, but according to above reasons, please don't guide me to ALP GUI.

BTW, ALP GUI v1.57.0010 influence test result : our back channel frequence back to 50M when I just open it without any other operation.

  • Hello Keelung,

    If you want to use the ALP then the command will look like:
    board.WriteI2C(device_address,register,value)
    board.ReadI2C(device_address,register,Number of Bytes)

    But if you want to write a code for your processor or MCU, then you would use the SW code for the processor for generating standard I2C write and read commands. You can reference the example script for which registers are being written and translate that into the format of the processor development tools.

  • Hi Hamzeh,

    I mean, Ti should add I2C reading APIs, like UB960_ReadReg()/UB953_ReadReg(),  to sensor_drv/src/iss_sensors.c in RTOS source code.

    Since there are I2C writing APIs, such as UB960_WriteReg()/UB953_WriteReg(), in sensor_drv/src/iss_sensors.c

    If you provide Writting APIs, then Reading APIs should be provided too.

    On the other hand, UB960_ReadReg()/UB953_ReadReg() are missing in $PSDKR_PATH/sensor_drv/src/iss_sensors.c

    Now I think I've make the purpose of this thread clear.

    And I strongly suggest Ti open bug management to clients, because forum is not a good place to fire a code issue.

  • UB960 and UB953 register read is a simple call to I2C driver. You may refer to the code copied here.


    static int32_t UB9xx_ReadReg(uint8_t   i2cInstId,
                                     uint8_t   slaveI2cAddr,
                                     uint16_t  regAddr,
                                     uint8_t   *regVal)
    {
        int32_t status = -1;
        status = Board_i2c8BitRegRd(gISS_Sensor_I2cHandle, slaveI2cAddr, regAddr, regVal, 1U, SENSOR_I2C_TIMEOUT);
        if(0 != status)
        {
            printf("Error reading from UB9xx register 0x%x \n", regAddr);
        }
        return status;
    }

  • Hi Manank,

    This read API, should, or shouldn't added to official code ?

    Or every user who want to read registers can come here to copy ?

  • Hello Keelung,

    It will be added in the next SDK release.

    Regards,

    Mayank