Synergy Software Package User's Manual

#include <r_i2c_api.h>

Data Fields

ssp_err_t(* open )(i2c_ctrl_t *const p_ctrl, i2c_cfg_t const *const p_cfg)
 
ssp_err_t(* close )(i2c_ctrl_t *const p_ctrl)
 
ssp_err_t(* read )(i2c_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const bytes, bool const restart)
 
ssp_err_t(* write )(i2c_ctrl_t *const p_ctrl, uint8_t *const p_src, uint32_t const bytes, bool const restart)
 
ssp_err_t(* reset )(i2c_ctrl_t *const p_ctrl)
 
ssp_err_t(* slaveAddressSet )(i2c_ctrl_t *const p_ctrl, uint16_t const slave, i2c_addr_mode_t const addr_mode)
 
ssp_err_t(* versionGet )(ssp_version_t *const p_version)
 

Detailed Description

Interface definition for I2C access as master

Field Documentation

◆ close

ssp_err_t(* i2c_api_master_t::close) (i2c_ctrl_t *const p_ctrl)

Closes the driver and releases the I2C device.

Implemented as
Parameters
[in]p_ctrlPointer to control block set in i2c_api_master_t::open call.

◆ open

ssp_err_t(* i2c_api_master_t::open) (i2c_ctrl_t *const p_ctrl, i2c_cfg_t const *const p_cfg)

Opens the I2C driver and initializes the hardware.

Implemented as
Parameters
[in]p_ctrlPointer to control block. Must be declared by user. Elements are set here.
[in]p_cfgPointer to configuration structure.

◆ read

ssp_err_t(* i2c_api_master_t::read) (i2c_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const bytes, bool const restart)

Performs a read operation on an I2C device.

Implemented as
Parameters
[in]p_ctrlPointer to control block set in i2c_api_master_t::open call.
[in]p_destPointer to the location to store read data.
[in]bytesNumber of bytes to read.
[in]restartSpecify if the restart condition should be issued after reading.

◆ reset

ssp_err_t(* i2c_api_master_t::reset) (i2c_ctrl_t *const p_ctrl)

Performs a reset of the peripheral.

Implemented as
Parameters
[in]p_ctrlPointer to control block set in i2c_api_master_t::open call.

◆ slaveAddressSet

ssp_err_t(* i2c_api_master_t::slaveAddressSet) (i2c_ctrl_t *const p_ctrl, uint16_t const slave, i2c_addr_mode_t const addr_mode)

Sets address of the slave device without reconfiguring the bus.

Implemented as
Parameters
[in]p_ctrlPointer to control block set in i2c_api_master_t::open call.
[in]slave_addressAddress of the slave device.
[in]address_modeAddressing mode.

◆ versionGet

ssp_err_t(* i2c_api_master_t::versionGet) (ssp_version_t *const p_version)

Gets version information and stores it in the provided version struct.

Implemented as
Parameters
[out]p_versionCode and API version used.

◆ write

ssp_err_t(* i2c_api_master_t::write) (i2c_ctrl_t *const p_ctrl, uint8_t *const p_src, uint32_t const bytes, bool const restart)

Performs a write operation on an I2C device.

Implemented as
Parameters
[in]p_ctrlPointer to control block set in i2c_api_master_t::open call.
[in]p_srcPointer to the location to get write data from.
[in]bytesNumber of bytes to write.
[in]restartSpecify if the restart condition should be issued after writing.

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