Configuration
The first step in using i2c is to configure and bring up the interface. The i2c hal provides a configuration structure with the standard i2c options. This structure should be filled out according to the project's i2c configuration and then it may be used to initialize the interface in use.
Another option for configuration is to use our i2c defaults. The k_i2c_default_dev_init function will initialize the specified interface with the default configuration values.
Reading
Reading from i2c is a pretty simple operation, the slave address, a buffer and length is passed in. The buffer is filled and the number of characters read are passed back.
Writing
Writing to i2c is also a simple operation, the slave address, a buffer and length are passed in. The buffer is read from and the number of characters written are passed back.
API Docs
More detailed information on the HAL's i2c functions and parameters can be found here - I2C