MTB CAT1 Peripheral driver library

General Description

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. More...
 
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. More...
 
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. More...
 
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. More...
 
cy_en_scb_ezi2c_status_t Cy_SCB_EZI2C_EnableHwEzMode (CySCB_Type *base, cy_stc_scb_ezi2c_context_t *context)
 Switches the EZI2C slave instance into the SCB hardware EZ mode. More...
 
cy_en_scb_ezi2c_status_t Cy_SCB_EZI2C_HwEzReadData (CySCB_Type const *base, uint32_t offset, uint8_t *data, uint32_t size)
 Reads a block of data from the SCB hardware EZ mode EZ_DATA dual-port memory. More...
 
cy_en_scb_ezi2c_status_t Cy_SCB_EZI2C_HwEzWriteData (CySCB_Type *base, uint32_t offset, const uint8_t *data, uint32_t size)
 Writes a block of data to the SCB hardware EZ mode EZ_DATA dual-port memory. More...
 

Function Documentation

◆ Cy_SCB_EZI2C_SetBuffer1()

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.

Parameters
baseThe pointer to the EZI2C SCB instance.
bufferThe pointer to the data buffer.
sizeThe size of the buffer in bytes.
rwBoundaryThe 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.
contextThe 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
  • 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.

◆ Cy_SCB_EZI2C_SetBuffer2()

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.

Parameters
baseThe pointer to the EZI2C SCB instance.
bufferThe pointer to the data buffer.
sizeThe size of the buffer in bytes.
rwBoundaryThe 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.
contextThe 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
  • 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.

◆ Cy_SCB_EZI2C_GetActivity()

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.

Parameters
baseThe pointer to the EZI2C SCB instance.
contextThe 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
EZI2C Activity Status.

◆ Cy_SCB_EZI2C_Interrupt()

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
baseThe pointer to the EZI2C SCB instance.
contextThe 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_EnableHwEzMode()

cy_en_scb_ezi2c_status_t Cy_SCB_EZI2C_EnableHwEzMode ( CySCB_Type *  base,
cy_stc_scb_ezi2c_context_t *  context 
)

Switches the EZI2C slave instance into the SCB hardware EZ mode.

In this mode the SCB hardware services the external master accesses to the EZ_DATA dual-port memory without any firmware intervention or I2C clock stretching, and only the write-completion and error events are reported to the driver.

This function must be called after Cy_SCB_EZI2C_Init and before Cy_SCB_EZI2C_Enable. It is only applicable on devices whose SCB provides the EZ_DATA dual-port memory.

Parameters
baseThe pointer to the EZI2C SCB instance.
contextThe 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
If the SCB instance does not support hardware EZ mode, this function returns CY_SCB_EZI2C_BAD_PARAM and the instance stays in the firmware transfer mode.

◆ Cy_SCB_EZI2C_HwEzReadData()

cy_en_scb_ezi2c_status_t Cy_SCB_EZI2C_HwEzReadData ( CySCB_Type const *  base,
uint32_t  offset,
uint8_t *  data,
uint32_t  size 
)

Reads a block of data from the SCB hardware EZ mode EZ_DATA dual-port memory.

This function is only applicable when hardware EZ mode is enabled through Cy_SCB_EZI2C_EnableHwEzMode.

Parameters
baseThe pointer to the EZI2C SCB instance.
offsetThe byte offset within the EZ_DATA memory to start reading from.
dataThe pointer to the buffer that receives the read data.
sizeThe number of bytes to read.
Returns
cy_en_scb_ezi2c_status_t

◆ Cy_SCB_EZI2C_HwEzWriteData()

cy_en_scb_ezi2c_status_t Cy_SCB_EZI2C_HwEzWriteData ( CySCB_Type *  base,
uint32_t  offset,
const uint8_t *  data,
uint32_t  size 
)

Writes a block of data to the SCB hardware EZ mode EZ_DATA dual-port memory.

This function is only applicable when hardware EZ mode is enabled through Cy_SCB_EZI2C_EnableHwEzMode.

Parameters
baseThe pointer to the EZI2C SCB instance.
offsetThe byte offset within the EZ_DATA memory to start writing to.
dataThe pointer to the buffer that holds the data to write.
sizeThe number of bytes to write.
Returns
cy_en_scb_ezi2c_status_t