MTB CAT1 Peripheral driver library

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
baseThe pointer to the EZI2C SCB instance.
configThe pointer to the configuration structure cy_stc_scb_ezi2c_config_t.
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
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
baseThe 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
baseThe 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
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.
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
baseThe pointer to the EZI2C SCB instance.
addrThe 7-bit right justified slave address.
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_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
baseThe pointer to the EZI2C SCB instance.
  • Parameters
    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
    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
baseThe pointer to the EZI2C SCB instance.
addrThe 7-bit right justified slave address.
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
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
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
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
baseThe pointer to the EZI2C SCB instance.
ezModeIf true, HW EZ mode is enabled. If false, HW EZ mode is disabled.