Slave

group group_scb_ezi2c_slave_functions

Functions

void Cy_SCB_EZI2C_SetBuffer1(CySCB_Type const *base, uint8_t *buffer, uint32_t size, uint32_t rwBoundary, cy_stc_scb_ezi2c_context_t *context)

Sets up the data buffer to be exposed to the I2C master on the primary slave address request.

note

  • This function is not interrupt-protected and to prevent a race condition, it must be protected from the EZI2C interruption in the place where it is called.

  • Calling this function in the middle of a transaction intended for the secondary slave address leads to unexpected behavior.

Parameters
  • base: The pointer to the EZI2C SCB instance.

  • buffer: The pointer to the data buffer.

  • size: The size of the buffer in bytes.

  • rwBoundary: The number of data bytes starting from the beginning of the buffer with Read and Write access. The data bytes located at rwBoundary or greater are read only.

  • 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_SetBuffer2(CySCB_Type const *base, uint8_t *buffer, uint32_t size, uint32_t rwBoundary, cy_stc_scb_ezi2c_context_t *context)

Sets up the data buffer to be exposed to the I2C master on the secondary slave address request.

note

  • This function is not interrupt-protected. To prevent a race condition, it must be protected from the EZI2C interruption in the place where it is called.

  • Calling this function in the middle of a transaction intended for the secondary slave address leads to unexpected behavior.

Parameters
  • base: The pointer to the EZI2C SCB instance.

  • buffer: The pointer to the data buffer.

  • size: The size of the buffer in bytes.

  • rwBoundary: The number of data bytes starting from the beginning of the buffer with Read and Write access. The data bytes located at rwBoundary or greater are read only.

  • 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_GetActivity(CySCB_Type const *base, cy_stc_scb_ezi2c_context_t *context)

Returns a non-zero value if an I2C Read or Write cycle has occurred since the last time this function was called.

All flags are reset to zero at the end of this function call, except the CY_SCB_EZI2C_STATUS_BUSY.

Return

EZI2C Activity Status.

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_Interrupt(CySCB_Type *base, cy_stc_scb_ezi2c_context_t *context)

This is the interrupt function for the SCB configured in the EZI2C mode.

This function must be called inside the user-defined interrupt service routine to make the EZI2C slave work.

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.