i2c_m_os_init

Initialize I2C master interface.

int32_t i2c_m_os_init(
    struct i2c_m_os_desc *const i2c,
    void *const hw
)

This function initializes the given I2C descriptor to be used as an RTOS I2C master interface descriptor. It checks if the given hardware is not initialized and if the given hardware is permitted to be initialized.

Parameters

i2c

Type: struct i2c_m_os_desc Struct *const

An I2C master descriptor, which is used to communicate

hw

Type: void *const

The pointer to hardware instance

Returns

Type: int32_t

Initialization status.

-1

The passed parameters were invalid or already initialized

0

The initialization is completed successfully