Macros
I2C Private Macros
Peripheral Driver » HAL Driver » I2C » Defines

## Macros
#define | IS_I2C_SPEED(__SPEED__)
| Check if the I2C speed is valid. More...
#define | IS_I2C_ADDRESSING_MODE(__MODE__)
| Check if the I2C addressing mode is valid. More...
#define | IS_I2C_GENERAL_CALL(__CALL__)
| Check if the I2C general call mode is valid. More...
#define | IS_I2C_MEMADD_SIZE(__SIZE__)
| Check if the I2C memory address size is valid. More...
#define | IS_TRANSFER_REQUEST(__REQUEST__)
| Check if the I2C transfer request command is valid. More...
#define | IS_I2C_TRANSFER_OPTIONS_REQUEST(__REQUEST__)
| Check if the I2C transfer options request is valid. More...
#define | IS_I2C_SLV_ADDRESS(__ADDRESS__) ((__ADDRESS__) < 0x03FFU)
| Check if the I2C slave address is valid. More...
#define | IS_I2C_OWN_ADDRESS(__ADDRESS__)
| Check if the I2C own address is valid. More...
#define | I2C_MEM_ADD_MSB(__ADDRESS__) ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0xFF00U))) >> 8U)))
| Get the Most Significant 8 Bits of memory address. More...
#define | I2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FFU))))
| Get the Least Significant 8 Bits of memory address. More...

## Detailed Description

## Macro Definition Documentation

## ◆ I2C_MEM_ADD_LSB

#define I2C_MEM_ADD_LSB | ( |  | __ADDRESS__ | ) | ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FFU))))

Get the Least Significant 8 Bits of memory address.

Parameters

  <strong>ADDRESS</strong> | Memory address.

Return values

  SET | (ADDRESS is valid) or RESET (ADDRESS is invalid)

Definition at line 434 of file gr55xx_hal_i2c.h.

## ◆ I2C_MEM_ADD_MSB

#define I2C_MEM_ADD_MSB | ( |  | __ADDRESS__ | ) | ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0xFF00U))) >> 8U)))

Get the Most Significant 8 Bits of memory address.

Parameters

  <strong>ADDRESS</strong> | Memory address.

Return values

  SET | (ADDRESS is valid) or RESET (ADDRESS is invalid)

Definition at line 427 of file gr55xx_hal_i2c.h.

## ◆ IS_I2C_ADDRESSING_MODE

#define IS_I2C_ADDRESSING_MODE | ( |  | __MODE__ | ) |

Value:
(((__MODE__) == I2C_ADDRESSINGMODE_7BIT) || \
((__MODE__) == I2C_ADDRESSINGMODE_10BIT))

Check if the I2C addressing mode is valid.

Parameters

  <strong>MODE</strong> | I2C addressing mode.

Return values

  SET | (MODE is valid) or RESET (MODE is invalid)

Definition at line 366 of file gr55xx_hal_i2c.h.

## ◆ IS_I2C_GENERAL_CALL

#define IS_I2C_GENERAL_CALL | ( |  | __CALL__ | ) |

Value:
(((__CALL__) == I2C_GENERALCALL_DISABLE) || \
((__CALL__) == I2C_GENERALCALL_ENABLE))

Check if the I2C general call mode is valid.

Parameters

  <strong>CALL</strong> | I2C general call mode.

Return values

  SET | (CALL is valid) or RESET (CALL is invalid)

Definition at line 374 of file gr55xx_hal_i2c.h.

## ◆ IS_I2C_MEMADD_SIZE

#define IS_I2C_MEMADD_SIZE | ( |  | __SIZE__ | ) |

Value:
(((__SIZE__) == I2C_MEMADD_SIZE_8BIT) || \
((__SIZE__) == I2C_MEMADD_SIZE_16BIT))

Check if the I2C memory address size is valid.

Parameters

  <strong>SIZE</strong> | I2C memory address size.

Return values

  SET | (SIZE is valid) or RESET (SIZE is invalid)

Definition at line 382 of file gr55xx_hal_i2c.h.

## ◆ IS_I2C_OWN_ADDRESS

#define IS_I2C_OWN_ADDRESS | ( |  | __ADDRESS__ | ) |

Value:
((((__ADDRESS__) > 0x0007U) && ((__ADDRESS__) < 0x0078U)) || \
(((__ADDRESS__) > 0x007FU) && ((__ADDRESS__) < 0x03FFU)))

Check if the I2C own address is valid.

Parameters

  <strong>ADDRESS</strong> | I2C own address.

Return values

  SET | (ADDRESS is valid) or RESET (ADDRESS is invalid)

Definition at line 419 of file gr55xx_hal_i2c.h.

## ◆ IS_I2C_SLV_ADDRESS

#define IS_I2C_SLV_ADDRESS | ( |  | __ADDRESS__ | ) | ((__ADDRESS__) < 0x03FFU)

Check if the I2C slave address is valid.

Parameters

  <strong>ADDRESS</strong> | I2C slave address.

Return values

  SET | (ADDRESS is valid) or RESET (ADDRESS is invalid)

Definition at line 412 of file gr55xx_hal_i2c.h.

## ◆ IS_I2C_SPEED

#define IS_I2C_SPEED | ( |  | __SPEED__ | ) |

Value:
(((__SPEED__) == I2C_SPEED_100K) || \
((__SPEED__) == I2C_SPEED_400K) || \
((__SPEED__) == I2C_SPEED_1000K) || \
((__SPEED__) == I2C_SPEED_2000K))

Check if the I2C speed is valid.

Parameters

  <strong>SPEED</strong> | I2C transfer speed.

Return values

  SET | (SPEED is valid) or RESET (SPEED is invalid)

Definition at line 356 of file gr55xx_hal_i2c.h.

## ◆ IS_I2C_TRANSFER_OPTIONS_REQUEST

#define IS_I2C_TRANSFER_OPTIONS_REQUEST | ( |  | __REQUEST__ | ) |

Value:
(((__REQUEST__) == I2C_FIRST_FRAME) || \
((__REQUEST__) == I2C_FIRST_AND_NEXT_FRAME) || \
((__REQUEST__) == I2C_NEXT_FRAME) || \
((__REQUEST__) == I2C_FIRST_AND_LAST_FRAME) || \
((__REQUEST__) == I2C_LAST_FRAME))

Check if the I2C transfer options request is valid.

Parameters

  <strong>REQUEST</strong> | I2C transfer options request.

Return values

  SET | (REQUEST is valid) or RESET (REQUEST is invalid)

Definition at line 401 of file gr55xx_hal_i2c.h.

## ◆ IS_TRANSFER_REQUEST

#define IS_TRANSFER_REQUEST | ( |  | __REQUEST__ | ) |

Value:
(((__REQUEST__) == I2C_CMD_SLV_NONE) || \
((__REQUEST__) == I2C_CMD_MST_WRITE) || \
((__REQUEST__) == I2C_CMD_MST_READ) || \
((__REQUEST__) == I2C_CMD_MST_GEN_STOP) || \
((__REQUEST__) == I2C_CMD_MST_GEN_RESTART))

Check if the I2C transfer request command is valid.

Parameters

  <strong>REQUEST</strong> | I2C transfer request command.

Return values

  SET | (REQUEST is valid) or RESET (REQUEST is invalid)

Definition at line 390 of file gr55xx_hal_i2c.h.

I2C_NEXT_FRAME
#define I2C_NEXT_FRAME
Next transfer frame.
Definition: gr55xx_hal_i2c.h:316
I2C_SPEED_100K
#define I2C_SPEED_100K
Standard speed.
Definition: gr55xx_hal_i2c.h:284
I2C_FIRST_FRAME
#define I2C_FIRST_FRAME
First transfer frame.
Definition: gr55xx_hal_i2c.h:314
I2C_SPEED_400K
#define I2C_SPEED_400K
Fast speed.
Definition: gr55xx_hal_i2c.h:285
I2C_SPEED_2000K
#define I2C_SPEED_2000K
High speed.
Definition: gr55xx_hal_i2c.h:287
I2C_MEMADD_SIZE_8BIT
#define I2C_MEMADD_SIZE_8BIT
8-bit memory address.
Definition: gr55xx_hal_i2c.h:307
I2C_GENERALCALL_ENABLE
#define I2C_GENERALCALL_ENABLE
General call mode enable.
Definition: gr55xx_hal_i2c.h:301
I2C_LAST_FRAME
#define I2C_LAST_FRAME
Last transfer frame.
Definition: gr55xx_hal_i2c.h:318
I2C_ADDRESSINGMODE_7BIT
#define I2C_ADDRESSINGMODE_7BIT
7-bit addressing mode.
Definition: gr55xx_hal_i2c.h:293
I2C_FIRST_AND_NEXT_FRAME
#define I2C_FIRST_AND_NEXT_FRAME
First and next transfer frames.
Definition: gr55xx_hal_i2c.h:315
I2C_MEMADD_SIZE_16BIT
#define I2C_MEMADD_SIZE_16BIT
16-bit memory address.
Definition: gr55xx_hal_i2c.h:308
I2C_SPEED_1000K
#define I2C_SPEED_1000K
Fast Plus speed.
Definition: gr55xx_hal_i2c.h:286
I2C_GENERALCALL_DISABLE
#define I2C_GENERALCALL_DISABLE
General call mode disable.
Definition: gr55xx_hal_i2c.h:300
I2C_FIRST_AND_LAST_FRAME
#define I2C_FIRST_AND_LAST_FRAME
First and last transfer frames.
Definition: gr55xx_hal_i2c.h:317
I2C_ADDRESSINGMODE_10BIT
#define I2C_ADDRESSINGMODE_10BIT
10-bit addressing mode.
Definition: gr55xx_hal_i2c.h:294