mikroSDK Reference Manual
drv_i2c_master.h File Reference

Go to the source code of this file.

Data Structures

struct  i2c_master_config_t
 I2C Master initialization configuration structure, consisted of the following fields : More...
 
struct  i2c_master_t
 I2C Master driver context structure, consisted of the following fields : More...
 

Enumerations

enum  i2c_master_err_t
 
enum  i2c_master_speed_t
 

Functions

void i2c_master_configure_default (i2c_master_config_t *config)
 Configure I2C Master configuration structure. More...
 
err_t i2c_master_open (i2c_master_t *obj, i2c_master_config_t *config)
 Open the I2C Master driver object. More...
 
err_t i2c_master_set_speed (i2c_master_t *obj, uint32_t speed)
 Set I2C Master module speed. More...
 
err_t i2c_master_set_timeout (i2c_master_t *obj, uint16_t timeout_pass_count)
 Set I2C Master timeout value. More...
 
err_t i2c_master_set_slave_address (i2c_master_t *obj, uint8_t address)
 Set I2C Slave address. More...
 
err_t i2c_master_write (i2c_master_t *obj, uint8_t *write_data_buf, size_t len_write_data)
 Write data to the I2C bus. More...
 
err_t i2c_master_read (i2c_master_t *obj, uint8_t *read_data_buf, size_t len_read_data)
 Read data from the I2C bus. More...
 
err_t i2c_master_write_then_read (i2c_master_t *obj, uint8_t *write_data_buf, size_t len_write_data, uint8_t *read_data_buf, size_t len_read_data)
 Write data to I2C bus followed by read. More...
 
err_t i2c_master_close (i2c_master_t *obj)
 Close I2C Master driver object. More...
 

Enumeration Type Documentation

◆ i2c_master_err_t

Return values.

Enumerator
I2C_MASTER_SUCCESS 

Success.

I2C_MASTER_ERROR 

Error.

◆ i2c_master_speed_t

Predefined enum values for module standard speed values.

Enumerator
I2C_MASTER_SPEED_STANDARD 

Speed set at 100K.

I2C_MASTER_SPEED_FULL 

Speed set at 400K.

I2C_MASTER_SPEED_FAST 

Speed set at 1M.