mikroSDK Reference Manual
i2c_master_config_t Struct Reference

I2C Master initialization configuration structure, consisted of the following fields : More...

Data Fields

uint8_t addr
 
pin_name_t sda
 
pin_name_t scl
 
uint32_t speed
 
uint16_t timeout_pass_count
 

Detailed Description

User needs to specify values herein.

Note
Take into consideration that any value can be changed explicitly by the user.
Warning
The following example includes pins mapping. Take into consideration that different hardware might not have the same pins. Make sure to accommodate pin name based on your hardware specifics.

Example

// I2C master driver config structure.
static i2c_master_config_t i2c_master_cfg;
// Fill structure with default values.
// Specify desired SCL pin.
i2c_master_cfg.scl = MIKROBUS_1_SCL;
// Specify desired SDA pin.
i2c_master_cfg.sda = MIKROBUS_1_SDA;

Field Documentation

◆ addr

uint8_t i2c_master_config_t::addr

Slave address.

◆ sda

pin_name_t i2c_master_config_t::sda

SDA pin.

◆ scl

pin_name_t i2c_master_config_t::scl

SCL pin.

◆ speed

uint32_t i2c_master_config_t::speed

I2C transmission rate.

◆ timeout_pass_count

uint16_t i2c_master_config_t::timeout_pass_count

I2C timeout value ( number of retries for each operation )

i2c_master_config_t::scl
pin_name_t scl
Definition: drv_i2c_master.h:100
i2c_master_config_t::sda
pin_name_t sda
Definition: drv_i2c_master.h:99
i2c_master_configure_default
void i2c_master_configure_default(i2c_master_config_t *config)
Configure I2C Master configuration structure.
i2c_master_config_t
I2C Master initialization configuration structure, consisted of the following fields :
Definition: drv_i2c_master.h:95