![]() |
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) |
Interface definition for I2C access as master
| ssp_err_t(* i2c_api_master_t::close) (i2c_ctrl_t *const p_ctrl) |
Closes the driver and releases the I2C device.
| [in] | p_ctrl | Pointer to control block set in i2c_api_master_t::open call. |
| 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.
| [in] | p_ctrl | Pointer to control block. Must be declared by user. Elements are set here. |
| [in] | p_cfg | Pointer to configuration structure. |
| 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.
| [in] | p_ctrl | Pointer to control block set in i2c_api_master_t::open call. |
| [in] | p_dest | Pointer to the location to store read data. |
| [in] | bytes | Number of bytes to read. |
| [in] | restart | Specify if the restart condition should be issued after reading. |
| ssp_err_t(* i2c_api_master_t::reset) (i2c_ctrl_t *const p_ctrl) |
Performs a reset of the peripheral.
| [in] | p_ctrl | Pointer to control block set in i2c_api_master_t::open call. |
| 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.
| [in] | p_ctrl | Pointer to control block set in i2c_api_master_t::open call. |
| [in] | slave_address | Address of the slave device. |
| [in] | address_mode | Addressing mode. |
| 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.
| [out] | p_version | Code and API version used. |
| 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.
| [in] | p_ctrl | Pointer to control block set in i2c_api_master_t::open call. |
| [in] | p_src | Pointer to the location to get write data from. |
| [in] | bytes | Number of bytes to write. |
| [in] | restart | Specify if the restart condition should be issued after writing. |