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

  __PERIPHCLK__ | Peripheral Clock frequency used for I2C instance
  __SPEED__ | 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)

Definition at line 342 of file gr533x_ll_i2c.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

  __SPEED__ | 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

Definition at line 352 of file gr533x_ll_i2c.h.

LL_I2C_SPEED_MODE_FAST
#define LL_I2C_SPEED_MODE_FAST
Definition: gr533x_ll_i2c.h:198
LL_I2C_SPEED_MODE_HIGH
#define LL_I2C_SPEED_MODE_HIGH
Definition: gr533x_ll_i2c.h:199
LL_I2C_SPEED_MODE_STANDARD
#define LL_I2C_SPEED_MODE_STANDARD
Definition: gr533x_ll_i2c.h:197
LL_I2C_SPEED_100K
#define LL_I2C_SPEED_100K
Definition: gr533x_ll_i2c.h:205
LL_I2C_SPEED_1000K
#define LL_I2C_SPEED_1000K
Definition: gr533x_ll_i2c.h:207