Functions
Data_Management
Peripheral Driver » LL Driver » I2C » Functions
Collaboration diagram for Data_Management:

## Functions
__STATIC_INLINE void | ll_i2c_set_slave_address (i2c_regs_t *I2Cx, uint32_t slave_addr)
| Configure the slave address for transfer (master mode). More...
__STATIC_INLINE uint32_t | ll_i2c_get_slave_address (i2c_regs_t *I2Cx)
| Get the slave address programmed for transfer (master mode). More...
__STATIC_INLINE void | ll_i2c_handle_transfer (i2c_regs_t *I2Cx, uint32_t slave_addr, uint32_t slave_addr_size)
| Handles I2Cx communication when starting transfer or during transfer (TC or TCR flag are set). More...
__STATIC_INLINE uint32_t | ll_i2c_get_transfer_direction (i2c_regs_t *I2Cx)
| Indicate the value of transfer direction (slave mode). More...
__STATIC_INLINE uint8_t | ll_i2c_receive_data8 (i2c_regs_t *I2Cx)
| Read Receive Data register. More...
__STATIC_INLINE void | ll_i2c_transmit_data8 (i2c_regs_t *I2Cx, uint8_t data, uint32_t cmd)
| Write in Transmit Data Register . More...

## Detailed Description

## Function Documentation

## ◆ ll_i2c_get_slave_address()

__STATIC_INLINE uint32_t ll_i2c_get_slave_address | ( | i2c_regs_t * | I2Cx | ) |

Get the slave address programmed for transfer (master mode).

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | IC_TAR | TAR_ADDR | +-------------------—+--------------------------------—+ \endrst

Parameters

  I2Cx | I2C instance.

Return values

  Value | between 0x0 and0x3F

Definition at line 3807 of file gr55xx_ll_i2c.h.

## ◆ ll_i2c_get_transfer_direction()

__STATIC_INLINE uint32_t ll_i2c_get_transfer_direction | ( | i2c_regs_t * | I2Cx | ) |

Indicate the value of transfer direction (slave mode).

Note
  RESET: Write transfer, Slave enters in receiver mode. SET: Read transfer, Slave enters in transmitter mode.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | IC_RAW_INTR_STAT | INTR_RD_REQ | +-------------------—+--------------------------------—+ \endrst IC_RAW_INTR_STAT | INTR_RX_FULL

Parameters

  I2Cx | I2C instance.

Return values

  Returned | value can be one of the following values: LL_I2C_DIRECTION_WRITE LL_I2C_DIRECTION_READ

Definition at line 3858 of file gr55xx_ll_i2c.h.

## ◆ ll_i2c_handle_transfer()

__STATIC_INLINE void ll_i2c_handle_transfer | ( | i2c_regs_t * | I2Cx,
|  | uint32_t | slave_addr,
|  | uint32_t | slave_addr_size
| ) |  |

Handles I2Cx communication when starting transfer or during transfer (TC or TCR flag are set).

Note
  The register IC_CON and IC_TAR can only be programmed when the I2C is disabled (ENABLE = 0).

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | IC_CON | CON_10BITADDR_MST | +-------------------—+--------------------------------—+ \endrst IC_TAR | TAR_ADDR

Parameters

  I2Cx | I2C instance.
  slave_addr | Specifies the slave address to be programmed.
  slave_addr_size | This parameter can be one of the following values: LL_I2C_ADDRESSING_MODE_7BIT LL_I2C_ADDRESSING_MODE_10BIT

Note
  SlaveAddrSize in IC_CON register can only be programmed when the I2C is disabled (IC_ENABLE = 0).

Return values

  None. |

Definition at line 3833 of file gr55xx_ll_i2c.h.

References ll_i2c_set_master_addressing_mode().

## ◆ ll_i2c_receive_data8()

__STATIC_INLINE uint8_t ll_i2c_receive_data8 | ( | i2c_regs_t * | I2Cx | ) |

Read Receive Data register.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | IC_DATA_CMD | DAT | +-------------------—+--------------------------------—+ \endrst

Parameters

  I2Cx | I2C instance.

Return values

  Value | between Min_Data=0x00 and Max_Data=0xFF

Definition at line 3877 of file gr55xx_ll_i2c.h.

## ◆ ll_i2c_set_slave_address()

__STATIC_INLINE void ll_i2c_set_slave_address | ( | i2c_regs_t * | I2Cx,
|  | uint32_t | slave_addr
| ) |  |

Configure the slave address for transfer (master mode).

Note
  The register IC_TAR can only be programmed when the I2C is disabled (ENABLE = 0).

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | IC_TAR | TAR_ADDR | +-------------------—+--------------------------------—+ \endrst

Parameters

  I2Cx | I2C instance.
  slave_addr | This parameter must be a value between 0x00 and 0x3F.

Return values

  None. |

Definition at line 3788 of file gr55xx_ll_i2c.h.

## ◆ ll_i2c_transmit_data8()

__STATIC_INLINE void ll_i2c_transmit_data8 | ( | i2c_regs_t * | I2Cx,
|  | uint8_t | data,
|  | uint32_t | cmd
| ) |  |

Write in Transmit Data Register .

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | IC_DATA_CMD | STOP | +-------------------—+--------------------------------—+ \endrst IC_DATA_CMD | CMD IC_DATA_CMD | DAT

Parameters

  I2Cx | I2C instance.
  data | Value range between 0x00 and 0xFF.
  cmd | This parameter can be one of the following values: LL_I2C_CMD_SLV_NONE LL_I2C_CMD_MST_WRITE LL_I2C_CMD_MST_READ LL_I2C_CMD_MST_GEN_STOP LL_I2C_CMD_MST_GEN_RESTART

Return values

  None. |

Definition at line 3905 of file gr55xx_ll_i2c.h.