Functions | |
void | Cy_SCB_I2C_SlaveConfigReadBuf (CySCB_Type const *base, uint8_t *buffer, uint32_t size, cy_stc_scb_i2c_context_t *context) |
Configures the buffer pointer and the read buffer size. More... | |
void | Cy_SCB_I2C_SlaveAbortRead (CySCB_Type *base, cy_stc_scb_i2c_context_t *context) |
Aborts the configured slave read buffer to be read by the master. More... | |
void | Cy_SCB_I2C_SlaveConfigWriteBuf (CySCB_Type const *base, uint8_t *buffer, uint32_t size, cy_stc_scb_i2c_context_t *context) |
Configures the buffer pointer and size of the write buffer. More... | |
void | Cy_SCB_I2C_SlaveAbortWrite (CySCB_Type *base, cy_stc_scb_i2c_context_t *context) |
Aborts the configured slave write buffer to be written by the master. More... | |
uint32_t | Cy_SCB_I2C_SlaveGetStatus (CySCB_Type const *base, cy_stc_scb_i2c_context_t const *context) |
Returns the current I2C slave status. More... | |
uint32_t | Cy_SCB_I2C_SlaveClearReadStatus (CySCB_Type const *base, cy_stc_scb_i2c_context_t *context) |
Clears the read status and error conditions flags and returns their values. More... | |
uint32_t | Cy_SCB_I2C_SlaveClearWriteStatus (CySCB_Type const *base, cy_stc_scb_i2c_context_t *context) |
Clears the write status flags and error condition flags and returns their values. More... | |
uint32_t | Cy_SCB_I2C_SlaveGetReadTransferCount (CySCB_Type const *base, cy_stc_scb_i2c_context_t const *context) |
Returns the number of bytes read by the master since the last time Cy_SCB_I2C_SlaveConfigReadBuf was called. More... | |
uint32_t | Cy_SCB_I2C_SlaveGetWriteTransferCount (CySCB_Type const *base, cy_stc_scb_i2c_context_t const *context) |
Returns the number of bytes written by the master since the last time Cy_SCB_I2C_SlaveConfigWriteBuf was called. More... | |
void Cy_SCB_I2C_SlaveConfigReadBuf | ( | CySCB_Type const * | base, |
uint8_t * | buffer, | ||
uint32_t | size, | ||
cy_stc_scb_i2c_context_t * | context | ||
) |
Configures the buffer pointer and the read buffer size.
This is the buffer from which the master reads data. After this function is called, data transfer from the read buffer to the master is handled by Cy_SCB_I2C_Interrupt.
When the Read transaction is completed (master generated Stop, ReStart or error occurred), the CY_SCB_I2C_SLAVE_RD_BUSY status is cleared and the CY_SCB_I2C_SLAVE_RD_CMPLT is set. Also the CY_SCB_I2C_SLAVE_RD_CMPLT_EVENT event is generated.
base | The pointer to the I2C SCB instance. |
buffer | The pointer to the buffer with data to be read by the master. |
size | Size of the buffer. |
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_SlaveAbortRead | ( | CySCB_Type * | base, |
cy_stc_scb_i2c_context_t * | context | ||
) |
Aborts the configured slave read buffer to be read by the master.
If the master reads and "abort operation" is requested, the CY_SCB_I2C_SLAVE_RD_BUF_EMPTY_EVENT event occurs. The CY_SCB_I2C_DEFAULT_TX is returned to the master if the buffer remains empty after the event notification.
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. |
void Cy_SCB_I2C_SlaveConfigWriteBuf | ( | CySCB_Type const * | base, |
uint8_t * | buffer, | ||
uint32_t | size, | ||
cy_stc_scb_i2c_context_t * | context | ||
) |
Configures the buffer pointer and size of the write buffer.
This is the buffer that the master writes data to. After this function is called data transfer from the master into the write buffer is handled by Cy_SCB_I2C_Interrupt.
When write transaction is completed (master generated Stop, ReStart or error occurred) the CY_SCB_I2C_SLAVE_WR_BUSY status is cleared and the CY_SCB_I2C_SLAVE_WR_CMPLT is set, also the CY_SCB_I2C_SLAVE_WR_CMPLT_EVENT event is generated.
base | The pointer to the I2C SCB instance. |
buffer | The pointer to buffer to store data written by the master. |
size | Size of the buffer. |
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_SlaveAbortWrite | ( | CySCB_Type * | base, |
cy_stc_scb_i2c_context_t * | context | ||
) |
Aborts the configured slave write buffer to be written by the master.
If master writes and an "abort operation" is requested, the next incoming byte will be NAKed.
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_SlaveGetStatus | ( | CySCB_Type const * | base, |
cy_stc_scb_i2c_context_t const * | context | ||
) |
Returns the current I2C slave 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_SlaveClearReadStatus | ( | CySCB_Type const * | base, |
cy_stc_scb_i2c_context_t * | context | ||
) |
Clears the read status and error conditions flags and returns their values.
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_SlaveClearWriteStatus | ( | CySCB_Type const * | base, |
cy_stc_scb_i2c_context_t * | context | ||
) |
Clears the write status flags and error condition flags and returns their values.
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_SlaveGetReadTransferCount | ( | CySCB_Type const * | base, |
cy_stc_scb_i2c_context_t const * | context | ||
) |
Returns the number of bytes read by the master since the last time Cy_SCB_I2C_SlaveConfigReadBuf was called.
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_SlaveGetWriteTransferCount | ( | CySCB_Type const * | base, |
cy_stc_scb_i2c_context_t const * | context | ||
) |
Returns the number of bytes written by the master since the last time Cy_SCB_I2C_SlaveConfigWriteBuf was called.
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. |