Hello:
Am I correct that the I2C Driver gets initialized from the I2C_devParameters when BIOS is loaded, and not by user code?
If so, how can I change the Driver operation mode later? GIO_Control doesn't seem to have a PSP_I2C_IOCTL for setting the "driver operation mode".
Should I add it myself, and If I do, will it work? Or should this only be set at device initialization.
/* Default Initial Parameters */
PSP_I2cConfig I2C_devParams = {
//PSP_OPMODE_POLLED, /** Driver operation mode */
PSP_OPMODE_INTERRUPT,/** Driver operation mode */
I2C_OWN_ADDR, /**< Own address (7 or 10 bit) */
I2C_NUM_BITS, /**< Number of bits/byte to be sent/received */
I2C_BUS_FREQ, /**< I2C Bus Frequency */
I2C_INPUT_BUS_FREQ, /**< Module input clock freq */
FALSE, /**< 7bit/10bit Addressing mode */
FALSE /**< Digital Loob Back (DLB) mode enabled */
};
---------------------
From psp_i2c.h
------------------------
typedef enum
{
PSP_I2C_IOCTL_SET_BIT_RATE, /**< Set the I2C clock */
PSP_I2C_IOCTL_GET_BIT_RATE, /**< Get the I2C clock */
PSP_I2C_IOCTL_CANCEL_PENDING_IO, /**< To cancel pending IO */
PSP_I2C_IOCTL_BIT_COUNT, /**< To set bit Count value */
PSP_I2C_IOCTL_NACK, /**< To enable or disable NACK
dynamically */
PSP_I2C_IOCTL_SET_OWN_ADDR, /**< To change own address
dynamically */
PSP_I2C_IOCTL_GET_OWN_ADDR /**< To Get own address
dynamically */
} PSP_I2cIoctlCmd;