i2c_m_async_register_callback

Register callback function.

int32_t i2c_m_async_register_callback(
    struct i2c_m_async_desc *const i2c,
    enum i2c_m_async_callback_type type,
    FUNC_PTR func
)

This function registers one callback function to the I2C master device specified by the given descriptor

Parameters

i2c

Type: struct i2c_m_async_desc Struct *const

An I2C master descriptor, which is used to communicate through I2C

type

Type: enum i2c_m_async_callback_type Enum

Type of a callback to set

func

Type: FUNC_PTR typedef

Callback function pointer

Returns

Type: int32_t

Callback setting status

-1

The passed parameters were invalid

0

The callback set is completed successfully