Macros
Exported_Macros_Helper
Peripheral Driver » LL Driver » I2C » Defines » I2C Exported Macros

## Macros
#define | __LL_I2C_CONVERT_CLK_SSL_CNT(__PERIPHCLK__, __SPEED__) ((__PERIPHCLK__) / 2 / (__SPEED__))
| Compute CLK_SSL_CNT value according to Peripheral Clock and expected Speed. More...
#define | __LL_I2C_CONVERT_SPEED_MODE(__SPEED__)
| Get Speed Mode according to expected Speed. More...

## Detailed Description

## Macro Definition Documentation

## ◆ __LL_I2C_CONVERT_CLK_SSL_CNT

#define __LL_I2C_CONVERT_CLK_SSL_CNT | ( |  | __PERIPHCLK__,
|  |  | __SPEED__
| ) |  | ((__PERIPHCLK__) / 2 / (__SPEED__))

Compute CLK_SSL_CNT value according to Peripheral Clock and expected Speed.

Parameters

  <strong>PERIPHCLK</strong> | Peripheral Clock frequency used for I2C instance
  <strong>SPEED</strong> | Speed value to achieve

Return values

  CLK_SSL_CNT | value to be used for XS_SCL_HCNT, XS_SCL_LCNT registers where X can be (S, F, H)

## ◆ __LL_I2C_CONVERT_SPEED_MODE

#define __LL_I2C_CONVERT_SPEED_MODE | ( |  | __SPEED__ | ) |

Value:
((__SPEED__ <= LL_I2C_SPEED_100K) ? LL_I2C_SPEED_MODE_STANDARD : \
((__SPEED__ <= LL_I2C_SPEED_1000K) ? LL_I2C_SPEED_MODE_FAST : LL_I2C_SPEED_MODE_HIGH))

Get Speed Mode according to expected Speed.

Parameters

  <strong>SPEED</strong> | Speed value to achieve

Return values

  Returned | value can be one of the following values: LL_I2C_SPEED_MODE_STANDARD LL_I2C_SPEED_MODE_FAST LL_I2C_SPEED_MODE_HIGH

LL_I2C_SPEED_MODE_FAST
#define LL_I2C_SPEED_MODE_FAST
Definition: gr55xx_ll_i2c.h:195
LL_I2C_SPEED_MODE_HIGH
#define LL_I2C_SPEED_MODE_HIGH
Definition: gr55xx_ll_i2c.h:196
LL_I2C_SPEED_MODE_STANDARD
#define LL_I2C_SPEED_MODE_STANDARD
Definition: gr55xx_ll_i2c.h:194
LL_I2C_SPEED_100K
#define LL_I2C_SPEED_100K
Definition: gr55xx_ll_i2c.h:202
LL_I2C_SPEED_1000K
#define LL_I2C_SPEED_1000K
Definition: gr55xx_ll_i2c.h:204