i2c_s_async_register_callback

Register callback function.

int32_t i2c_s_async_register_callback(
    struct i2c_s_async_descriptor *const descr,
    const enum i2c_s_async_callback_type type,
    i2c_s_async_cb_t func
)

This function registers callback functions to the I2C slave device specified by the given descriptor

Parameters

descr

Type: struct i2c_s_async_descriptor Struct *const

An I2C slave descriptor which is used to communicate through I2C

type

Type: const enum i2c_s_async_callback_type Enum

Type of a callback to set

func

Type: i2c_s_async_cb_t typedef

Callback function pointer

Returns

Type: int32_t

Callback setting status.

-1

Passed parameters were invalid

0

The callback set is completed successfully