General

group group_scb_ezi2c_general_functions

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.

note

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

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

void Cy_SCB_EZI2C_DeInit(CySCB_Type *base)

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

note

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

Parameters

base – The pointer to the EZI2C SCB instance.

__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.

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.

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.

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.

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.

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
  • 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.

  • base – The pointer to the EZI2C SCB instance.

Returns

The 7-bit right justified slave address.

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

Sets the secondary EZI2C slave address.

note

Calling this function when the EZI2C slave is configured for one-address operation leads to unexpected behavior because it updates the address mask.

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.

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.