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

  __ADDRESS__ | Memory address.

Return values

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

Definition at line 433 of file gr533x_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

  __ADDRESS__ | Memory address.

Return values

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

Definition at line 426 of file gr533x_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

  __MODE__ | I2C addressing mode.

Return values

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

Definition at line 365 of file gr533x_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

  __CALL__ | I2C general call mode.

Return values

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

Definition at line 373 of file gr533x_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

  __SIZE__ | I2C memory address size.

Return values

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

Definition at line 381 of file gr533x_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

  __ADDRESS__ | I2C own address.

Return values

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

Definition at line 418 of file gr533x_hal_i2c.h.

## ◆ IS_I2C_SLV_ADDRESS

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

Check if the I2C slave address is valid.

Parameters

  __ADDRESS__ | I2C slave address.

Return values

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

Definition at line 411 of file gr533x_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

  __SPEED__ | I2C transfer speed.

Return values

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

Definition at line 355 of file gr533x_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

  __REQUEST__ | I2C transfer options request.

Return values

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

Definition at line 400 of file gr533x_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

  __REQUEST__ | I2C transfer request command.

Return values

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

Definition at line 389 of file gr533x_hal_i2c.h.

I2C_NEXT_FRAME
#define I2C_NEXT_FRAME
Definition: gr533x_hal_i2c.h:313
I2C_SPEED_100K
#define I2C_SPEED_100K
Definition: gr533x_hal_i2c.h:282
I2C_FIRST_FRAME
#define I2C_FIRST_FRAME
Definition: gr533x_hal_i2c.h:311
I2C_SPEED_400K
#define I2C_SPEED_400K
Definition: gr533x_hal_i2c.h:283
I2C_MEMADD_SIZE_8BIT
#define I2C_MEMADD_SIZE_8BIT
Definition: gr533x_hal_i2c.h:304
I2C_GENERALCALL_ENABLE
#define I2C_GENERALCALL_ENABLE
Definition: gr533x_hal_i2c.h:298
I2C_LAST_FRAME
#define I2C_LAST_FRAME
Definition: gr533x_hal_i2c.h:315
I2C_ADDRESSINGMODE_7BIT
#define I2C_ADDRESSINGMODE_7BIT
Definition: gr533x_hal_i2c.h:290
I2C_FIRST_AND_NEXT_FRAME
#define I2C_FIRST_AND_NEXT_FRAME
Definition: gr533x_hal_i2c.h:312
I2C_MEMADD_SIZE_16BIT
#define I2C_MEMADD_SIZE_16BIT
Definition: gr533x_hal_i2c.h:305
I2C_SPEED_1000K
#define I2C_SPEED_1000K
Definition: gr533x_hal_i2c.h:284
I2C_GENERALCALL_DISABLE
#define I2C_GENERALCALL_DISABLE
Definition: gr533x_hal_i2c.h:297
I2C_FIRST_AND_LAST_FRAME
#define I2C_FIRST_AND_LAST_FRAME
Definition: gr533x_hal_i2c.h:314
I2C_ADDRESSINGMODE_10BIT
#define I2C_ADDRESSINGMODE_10BIT
Definition: gr533x_hal_i2c.h:291