API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
tsmart_i2c_config_t Struct Reference

I2C bus configuration. More...

#include <tsmart_i2c.h>

Data Fields

tsmart_i2c_clock_speed_t clock_speed
 
tsmart_i2c_mode_t mode
 
tsmart_i2c_duty_cycle_t duty_cycle
 
tsmart_i2c_ack_mode_t ack_mode
 
tsmart_i2c_ack_address_t ack_address
 
uint16_t own_address
 
uint8_t n_regs
 

Detailed Description

I2C bus configuration.

This structure is filled by the user and passed to the I2C bus initialization function.

Examples:
db_i2c.c, i2c.c, i2c_master.c, and i2c_slave.c.

Field Documentation

Specifies if 7-bit or 10-bit address is acknowledged. This parameter can be one of the following values:

  • TSMART_I2C_ACK_ADDRESS_7BIT
  • TSMART_I2C_ACK_ADDRESS_10BIT
Examples:
db_i2c.c, i2c.c, and i2c_master.c.

Enables or disables the acknowledgment. This parameter can be one of the following values:

  • TSMART_I2C_ACK_ENABLE
  • TSMART_I2C_ACK_DISABLE
Examples:
db_i2c.c, i2c.c, and i2c_master.c.

I2C bus clock speed [0...400.000] Hz

Examples:
db_i2c.c, i2c.c, and i2c_master.c.

Specifies the I2C fast mode duty cycle, I2C Tlow/Thigh value can be:

  • TSMART_I2C_DUTYCYCLE_16_9
  • TSMART_I2C_DUTYCYCLE_2
Examples:
db_i2c.c, i2c.c, and i2c_master.c.

I2C mode (I2C by default, SMB not yet supported).

Examples:
db_i2c.c, i2c.c, and i2c_master.c.
uint8_t n_regs

Pointer to Regs Buffer

Examples:
i2c_slave.c.
uint16_t own_address
Specifies the first device own address. This parameter can be

a 7-bit or 10-bit address.

Examples:
db_i2c.c, i2c.c, i2c_master.c, and i2c_slave.c.