Functions | |
cy_en_scb_i2c_status_t | Cy_SCB_I2C_MasterWrite (CySCB_Type *base, cy_stc_scb_i2c_master_xfer_config_t *xferConfig, cy_stc_scb_i2c_context_t *context) |
This function configures the master to automatically write an entire buffer of data to a slave device. More... | |
void | Cy_SCB_I2C_MasterAbortWrite (CySCB_Type *base, cy_stc_scb_i2c_context_t *context) |
This function requests the master to abort write operation by generating a Stop condition. More... | |
cy_en_scb_i2c_status_t | Cy_SCB_I2C_MasterRead (CySCB_Type *base, cy_stc_scb_i2c_master_xfer_config_t *xferConfig, cy_stc_scb_i2c_context_t *context) |
This function configures the master to automatically read an entire buffer of data from the slave device. More... | |
void | Cy_SCB_I2C_MasterAbortRead (CySCB_Type *base, cy_stc_scb_i2c_context_t *context) |
This function requests master to abort read operation by NAKing the next byte and generating a Stop condition. More... | |
uint32_t | Cy_SCB_I2C_MasterGetStatus (CySCB_Type const *base, cy_stc_scb_i2c_context_t const *context) |
Returns the current I2C master status. More... | |
uint32_t | Cy_SCB_I2C_MasterGetTransferCount (CySCB_Type const *base, cy_stc_scb_i2c_context_t const *context) |
Returns the number of bytes transferred since the last call of Cy_SCB_I2C_MasterWrite or Cy_SCB_I2C_MasterRead function. More... | |
cy_en_scb_i2c_status_t Cy_SCB_I2C_MasterWrite | ( | CySCB_Type * | base, |
cy_stc_scb_i2c_master_xfer_config_t * | xferConfig, | ||
cy_stc_scb_i2c_context_t * | context | ||
) |
This function configures the master to automatically write an entire buffer of data to a slave device.
After the transaction is initiated by this function it returns and Cy_SCB_I2C_Interrupt manages further data transfer.
When a write transaction is completed (requested number of bytes are written or error occurred) the CY_SCB_I2C_MASTER_BUSY status is cleared and the CY_SCB_I2C_MASTER_WR_CMPLT_EVENT event is generated.
base | The pointer to the I2C SCB instance. |
xferConfig | Master transfer configuration structure cy_stc_scb_i2c_master_xfer_config_t. |
context | The pointer to the context structure cy_stc_scb_i2c_context_t allocated by the user. The structure is used during the I2C operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_SCB_I2C_MasterAbortWrite | ( | CySCB_Type * | base, |
cy_stc_scb_i2c_context_t * | context | ||
) |
This function requests the master to abort write operation by generating a Stop condition.
The function does not wait until this action is completed. Therefore next write operation can be initiated only after the CY_SCB_I2C_MASTER_BUSY is cleared.
base | The pointer to the I2C SCB instance. |
context | The pointer to the context structure cy_stc_scb_i2c_context_t allocated by the user. The structure is used during the I2C operation for internal configuration and data retention. The user must not modify anything in this structure. |
cy_en_scb_i2c_status_t Cy_SCB_I2C_MasterRead | ( | CySCB_Type * | base, |
cy_stc_scb_i2c_master_xfer_config_t * | xferConfig, | ||
cy_stc_scb_i2c_context_t * | context | ||
) |
This function configures the master to automatically read an entire buffer of data from the slave device.
After the transaction is initiated by this function it returns and Cy_SCB_I2C_Interrupt manages further data transfer.
When a read transaction is completed (requested number of bytes are read or error occurred) the CY_SCB_I2C_MASTER_BUSY status is cleared and the CY_SCB_I2C_MASTER_RD_CMPLT_EVENT event is generated.
Note that the master must read at least one byte.
base | The pointer to the I2C SCB instance. |
xferConfig | Master transfer configuration structure cy_stc_scb_i2c_master_xfer_config_t. |
context | The pointer to the context structure cy_stc_scb_i2c_context_t allocated by the user. The structure is used during the I2C operation for internal configuration and data retention. The user must not modify anything in this structure. |
void Cy_SCB_I2C_MasterAbortRead | ( | CySCB_Type * | base, |
cy_stc_scb_i2c_context_t * | context | ||
) |
This function requests master to abort read operation by NAKing the next byte and generating a Stop condition.
The function does not wait until these actions are completed. Therefore the next operation can be initiated only after the CY_SCB_I2C_MASTER_BUSY is cleared.
base | The pointer to the I2C SCB instance. |
context | The pointer to the context structure cy_stc_scb_i2c_context_t allocated by the user. The structure is used during the I2C operation for internal configuration and data retention. The user must not modify anything in this structure. |
uint32_t Cy_SCB_I2C_MasterGetStatus | ( | CySCB_Type const * | base, |
cy_stc_scb_i2c_context_t const * | context | ||
) |
Returns the current I2C master status.
This status is a bit mask and the value returned may have multiple bits set.
base | The pointer to the I2C SCB instance. |
context | The pointer to the context structure cy_stc_scb_i2c_context_t allocated by the user. The structure is used during the I2C operation for internal configuration and data retention. The user must not modify anything in this structure. |
uint32_t Cy_SCB_I2C_MasterGetTransferCount | ( | CySCB_Type const * | base, |
cy_stc_scb_i2c_context_t const * | context | ||
) |
Returns the number of bytes transferred since the last call of Cy_SCB_I2C_MasterWrite or Cy_SCB_I2C_MasterRead function.
base | The pointer to the I2C SCB instance. |
context | The pointer to the context structure cy_stc_scb_i2c_context_t allocated by the user. The structure is used during the I2C operation for internal configuration and data retention. The user must not modify anything in this structure. |