Hardware I2C data types. More...

Data Structures

struct  gos_i2c_message_t
 Input/output message context used by gos_i2c_transfer() More...
 
struct  gos_i2c_device_t
 I2C peripheral context used by direct APIs. More...
 

Enumerations

enum  gos_i2c_address_width_t {
  GOS_I2C_7BIT,
  GOS_I2C_10BIT,
  GOS_I2C_16BIT
}
 I2C address width. More...
 
enum  gos_i2c_flag_t {
  GOS_I2C_MSG_WRITE = (1 << 0 ),
  GOS_I2C_MSG_READ = (0 << 0 ),
  GOS_I2C_MSG_NO_STOP_SEQ = (1 << 1 ),
  GOS_I2C_MSG_STOP_SEQ = (0 << 1 ),
  GOS_I2C_MSG_READ_AFTER_WRITE = (1 << 2 ),
  GOS_I2C_MSG_NO_READ_AFTER_WRITE = (0 << 2 ),
  GOS_I2C_MSG_NO_START_SEQ = (1 << 3 ),
  GOS_I2C_MSG_START_SEQ = (0 << 3 )
}
 I2C message flags. More...
 
enum  gos_i2c_speed_t {
  GOS_I2C_CLOCK_LOW_SPEED = (10*1000),
  GOS_I2C_CLOCK_STANDARD_SPEED = (100*1000),
  GOS_I2C_CLOCK_HIGH_SPEED = (400*1000)
}
 I2C standard clock rates. More...
 
enum  gos_i2c_stream_flag_t { GOS_I2C_FLAG_STREAM_HEXIFY = (1 << 0) }
 Stream configure flags. More...
 
enum  gos_i2c_stream_write_flag_t { GOS_I2C_FLAG_STREAM_CONTINUED_WRITE = (1 << 0) }
 
enum  gos_i2c_t {
  GOS_I2C_0,
  GOS_GPIO_MAX
}
 

Detailed Description

Hardware I2C data types.

Enumeration Type Documentation

◆ gos_i2c_address_width_t

I2C address width.

Enumerator
GOS_I2C_7BIT 

7-bit address length, this is the most common

GOS_I2C_10BIT 

10-bit address

GOS_I2C_16BIT 

16-bit address

◆ gos_i2c_flag_t

I2C message flags.

Enumerator
GOS_I2C_MSG_WRITE 

Write message, i.e. transfer from device to chip.

GOS_I2C_MSG_READ 

Read messag, i.e. transfer from chip to device.

GOS_I2C_MSG_NO_STOP_SEQ 

Do not issue 'stop' sequence after message, this is useful if multiple messages need to be transferred.

GOS_I2C_MSG_STOP_SEQ 

Default, issue 'stop' sequence after message.

GOS_I2C_MSG_READ_AFTER_WRITE 

Used if the next message after the current should read data.

GOS_I2C_MSG_NO_READ_AFTER_WRITE 

Default, the next message after the current is not a read.

GOS_I2C_MSG_NO_START_SEQ 

Do not issue a 'start' sequence at the beginning of this message.

GOS_I2C_MSG_START_SEQ 

Default, issue a 'start' sequence at the beginning of this message.

◆ gos_i2c_speed_t

I2C standard clock rates.

Enumerator
GOS_I2C_CLOCK_LOW_SPEED 

Low speed clock, 10kHz.

GOS_I2C_CLOCK_STANDARD_SPEED 

Standard speed clock, 100kHz.

GOS_I2C_CLOCK_HIGH_SPEED 

High speed clock, 400kHz.

◆ gos_i2c_stream_flag_t

Stream configure flags.

Enumerator
GOS_I2C_FLAG_STREAM_HEXIFY 

Convert input hex string to binary, output binary to hex string.

◆ gos_i2c_stream_write_flag_t

Write specific flags

Enumerator
GOS_I2C_FLAG_STREAM_CONTINUED_WRITE 

continued write: if this flag is set then no stop condition will be sent after the write. This allows for issuing the write command multiple times

◆ gos_i2c_t

enum gos_i2c_t

Gecko OS I2C ID

Enumerator
GOS_I2C_0 

This is just a placeholder, this is platform dependent.

GOS_GPIO_MAX 

Maximum number of GPIOs the platform supports in Gecko OS.

Maximum number of I2Cs the platform supports in Gecko OS.