/* Starts accepting slave transfers. 
Call this API after calling I2C_SlaveInit() and I2C_SlaveTransferCreateHandle() to start processing transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the callback that was passed into the call to I2C_SlaveTransferCreateHandle(). The callback is always invoked from the interrupt context. */
static status_t I2C_SlaveTransferNonBlockingInternal(I2C_Type *base, i2c_slave_handle_t *handle, const void *txData, size_t txSize, void *rxData, size_t rxSize, uint32_t eventMask)
/* Starts accepting slave transfers. 
Call this API after calling I2C_SlaveInit() and I2C_SlaveTransferCreateHandle() to start processing transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the callback that was passed into the call to I2C_SlaveTransferCreateHandle(). The callback is always invoked from the interrupt context. */
static status_t I2C_SlaveTransferNonBlockingInternal(I2C_Type *base, i2c_slave_handle_t *handle, const void *txData, size_t txSize, void *rxData, size_t rxSize, uint32_t eventMask)
{
    status_t status;
    assert(handle);
    status = kStatus_Success;
    I2C_DisableInterrupts(base, kI2C_SlaveIrqFlags);
    if (handle->isBusy)
    {
        status = kStatus_I2C_Busy;
    }
    handle->transfer.txData = (const uint8_t *)(uintptr_t)txData;
    handle->transfer.txSize = txSize;
    handle->transfer.rxData = (uint8_t *)rxData;
    handle->transfer.rxSize = rxSize;
    handle->transfer.transferredCount = 0;
    handle->transfer.eventMask = eventMask | kI2C_SlaveTransmitEvent | kI2C_SlaveReceiveEvent;
    handle->isBusy = true;
    I2C_SlaveEnable(base, true);
    base->STAT |= 0u;
    I2C_EnableInterrupts(base, kI2C_SlaveIrqFlags);
    return status;
}