Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
hal_i2c_master_config_t Struct Reference

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

#include <baremetal/mikrosdk-lib/hal/include/hal_i2c_master.h>

Public Attributes

uint8_t addr
 Slave address. More...
 
hal_pin_name_t sda
 SDA pin. More...
 
hal_pin_name_t scl
 SCL pin. More...
 
uint32_t speed
 I2C transmission rate. More...
 
uint16_t timeout_pass_count
 I2C timeout value ( number of retries for each operation ). More...
 

Detailed Description

I2C Master HAL init configuration structure, consisted of the following fields :

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 HAL driver configuration structure.
static hal_i2c_master_config_t hal_i2c_master_cfg;
// Fill structure with default values.
hal_i2c_master_configure_default(&hal_i2c_master_cfg);
// Specify desired scl pin.
hal_i2c_master_cfg.scl = MIKROBUS_1_SCL;
// Specify desired sda pin.
hal_i2c_master_cfg.sda = MIKROBUS_1_SDA;
void hal_i2c_master_configure_default(hal_i2c_master_config_t *config)
Configure I2C Master HAL configuration structure.
Definition: hal_i2c_master.c:341
I2C Master HAL init configuration structure, consisted of the following fields :
Definition: hal_i2c_master.h:129
hal_pin_name_t sda
SDA pin.
Definition: hal_i2c_master.h:132
hal_pin_name_t scl
SCL pin.
Definition: hal_i2c_master.h:133

Member Data Documentation

◆ addr

uint8_t hal_i2c_master_config_t::addr

Slave address.

◆ scl

hal_pin_name_t hal_i2c_master_config_t::scl

SCL pin.


◆ sda

hal_pin_name_t hal_i2c_master_config_t::sda

SDA pin.

◆ speed

uint32_t hal_i2c_master_config_t::speed

I2C transmission rate.

See hal_i2c_master_speed_t for valid values.

◆ timeout_pass_count

uint16_t hal_i2c_master_config_t::timeout_pass_count

I2C timeout value ( number of retries for each operation ).

See hal_i2c_master_timeout_t for valid values.


The documentation for this struct was generated from the following file: