PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
General
PDL API Reference » SCB (Serial Communication Block) » EZI2C (SCB) » Functions

## General Description

## Functions
cy_en_scb_ezi2c_status_t | Cy_SCB_EZI2C_Init (CySCB_Type *base, cy_stc_scb_ezi2c_config_t const *config, cy_stc_scb_ezi2c_context_t *context)
| Initializes the SCB for the EZI2C operation. More...
void | Cy_SCB_EZI2C_DeInit (CySCB_Type *base)
| De-initializes the SCB block, returns the register values to default. More...
__STATIC_INLINE void | Cy_SCB_EZI2C_Enable (CySCB_Type *base)
| Enables the SCB block for the EZI2C operation. More...
void | Cy_SCB_EZI2C_Disable (CySCB_Type *base, cy_stc_scb_ezi2c_context_t *context)
| Disables the SCB block and clears the context statuses. More...
void | Cy_SCB_EZI2C_SetAddress1 (CySCB_Type *base, uint8_t addr, cy_stc_scb_ezi2c_context_t *context)
| Sets the primary EZI2C slave address. More...
uint32_t | Cy_SCB_EZI2C_GetAddress1 (CySCB_Type const *base, cy_stc_scb_ezi2c_context_t const *context)
| Returns the primary the EZI2C slave address. More...
void | Cy_SCB_EZI2C_SetAddress2 (CySCB_Type *base, uint8_t addr, cy_stc_scb_ezi2c_context_t *context)
| Sets the secondary EZI2C slave address. More...
uint32_t | Cy_SCB_EZI2C_GetAddress2 (CySCB_Type const *base, cy_stc_scb_ezi2c_context_t const *context)
| Returns the secondary EZI2C slave address. More...
__STATIC_INLINE void | Cy_SCB_SetEzI2CMode (CySCB_Type *base, bool ezMode)
| Sets EZ mode for I2C protocol. More...

## Function Documentation

## ◆ Cy_SCB_EZI2C_Init()

cy_en_scb_ezi2c_status_t Cy_SCB_EZI2C_Init | ( | CySCB_Type * | base,
|  | cy_stc_scb_ezi2c_config_t const * | config,
|  | cy_stc_scb_ezi2c_context_t * | context
| ) |  |

Initializes the SCB for the EZI2C operation.

Parameters

  base | The pointer to the EZI2C SCB instance.
  config | The pointer to the configuration structure cy_stc_scb_ezi2c_config_t.
  context | The pointer to the context structure cy_stc_scb_ezi2c_context_t allocated by the user. The structure is used during the EZI2C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  cy_en_scb_ezi2c_status_t

Note
  Ensure that the SCB block is disabled before calling this function.

## ◆ Cy_SCB_EZI2C_DeInit()

void Cy_SCB_EZI2C_DeInit | ( | CySCB_Type * | base | ) |

De-initializes the SCB block, returns the register values to default.

Parameters

  base | The pointer to the EZI2C SCB instance.

Note
  Ensure that the SCB block is disabled before calling this function.

## ◆ Cy_SCB_EZI2C_Enable()

__STATIC_INLINE void Cy_SCB_EZI2C_Enable | ( | CySCB_Type * | base | ) |

Enables the SCB block for the EZI2C operation.

Parameters

  base | The pointer to the EZI2C SCB instance.

## ◆ Cy_SCB_EZI2C_Disable()

void Cy_SCB_EZI2C_Disable | ( | CySCB_Type * | base,
|  | cy_stc_scb_ezi2c_context_t * | context
| ) |  |

Disables the SCB block and clears the context statuses.

Note that after the block is disabled, the TX and RX FIFOs and hardware statuses are cleared. Also, the hardware stops driving the output and ignores the input.

Parameters

  base | The pointer to the EZI2C SCB instance.
  context | The pointer to the context structure cy_stc_scb_ezi2c_context_t allocated by the user. The structure is used during the EZI2C operation for internal configuration and data retention. The user must not modify anything in this structure.

Note
  Calling this function while EZI2C is busy (the slave has been addressed and is communicating with the master), may cause transaction corruption because the hardware stops driving the output and ignores the input. Ensure that the EZI2C slave is not busy before calling this function.

## ◆ Cy_SCB_EZI2C_SetAddress1()

void Cy_SCB_EZI2C_SetAddress1 | ( | CySCB_Type * | base,
|  | uint8_t | addr,
|  | cy_stc_scb_ezi2c_context_t * | context
| ) |  |

Sets the primary EZI2C slave address.

Parameters

  base | The pointer to the EZI2C SCB instance.
  addr | The 7-bit right justified slave address.
  context | The pointer to the context structure cy_stc_scb_ezi2c_context_t allocated by the user. The structure is used during the EZI2C operation for internal configuration and data retention. The user must not modify anything in this structure.

## ◆ Cy_SCB_EZI2C_GetAddress1()

uint32_t Cy_SCB_EZI2C_GetAddress1 | ( | CySCB_Type const * | base,
|  | cy_stc_scb_ezi2c_context_t const * | context
| ) |  |

Returns the primary the EZI2C slave address.

Parameters

  base | The pointer to the EZI2C SCB instance.

- Parameters

    context | The pointer to the context structure cy_stc_scb_ezi2c_context_t allocated by the user. The structure is used during the EZI2C operation for internal configuration and data retention. The user must not modify anything in this structure.

  Returns
    The 7-bit right justified slave address.

## ◆ Cy_SCB_EZI2C_SetAddress2()

void Cy_SCB_EZI2C_SetAddress2 | ( | CySCB_Type * | base,
|  | uint8_t | addr,
|  | cy_stc_scb_ezi2c_context_t * | context
| ) |  |

Sets the secondary EZI2C slave address.

Parameters

  base | The pointer to the EZI2C SCB instance.
  addr | The 7-bit right justified slave address.
  context | The pointer to the context structure cy_stc_scb_ezi2c_context_t allocated by the user. The structure is used during the EZI2C operation for internal configuration and data retention. The user must not modify anything in this structure.

Note
  Calling this function when the EZI2C slave is configured for one-address operation leads to unexpected behavior because it updates the address mask.
  Please observe following limitation while using both primary and secondary slave addresses. EZI2C IP has single address match mask. This mask is setup as (address1 ^ address2), This can generate false address match. For example, if address1 is 0x24 and address2 is 0x10, then slave address 0x20 will also generate a false match. Hence, choose address1 and 2 such that all other slave address on the bus satisfy ((slave address) & (address1 ^ address2)) != 0

## ◆ Cy_SCB_EZI2C_GetAddress2()

uint32_t Cy_SCB_EZI2C_GetAddress2 | ( | CySCB_Type const * | base,
|  | cy_stc_scb_ezi2c_context_t const * | context
| ) |  |

Returns the secondary EZI2C slave address.

Parameters

  base | The pointer to the EZI2C SCB instance.
  context | The pointer to the context structure cy_stc_scb_ezi2c_context_t allocated by the user. The structure is used during the EZI2C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  The 7-bit right justified slave address.

## ◆ Cy_SCB_SetEzI2CMode()

__STATIC_INLINE void Cy_SCB_SetEzI2CMode | ( | CySCB_Type * | base,
|  | bool | ezMode
| ) |  |

Sets EZ mode for I2C protocol.

EZ mode is only used for synchronous serial interface protocols. This mode is only applicable to slave functionality. In EZ mode, the slave can read from and write to an addressable memory.

Parameters

  base | The pointer to the EZI2C SCB instance.
  ezMode | If true, HW EZ mode is enabled. If false, HW EZ mode is disabled.