/* param base Pointer to FLEXIO_I2C_Type structure. param count Number of bytes need to be transferred from a start signal to a re-start/stop signal retval kStatus_Success Successfully configured the count. retval kStatus_InvalidArgument Input argument is invalid.  */
status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint8_t count)
/* param base Pointer to FLEXIO_I2C_Type structure. param count Number of bytes need to be transferred from a start signal to a re-start/stop signal retval kStatus_Success Successfully configured the count. retval kStatus_InvalidArgument Input argument is invalid.  */
status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint8_t count)
{
    if (count > 14U)
    {
        return kStatus_InvalidArgument;
    }
    uint16_t timerCmp = 0;
    uint32_t timerConfig = 0;
    FLEXIO_Type *flexioBase = base->flexioBase;
    timerCmp = flexioBase->TIMCMP[base->timerIndex[0]];
    timerCmp &= 0x00FFU;
    timerCmp |= (count * 18 + 1U) << 8U;
    flexioBase->TIMCMP[base->timerIndex[0]] = timerCmp;
    timerConfig = flexioBase->TIMCFG[base->timerIndex[0]];
    timerConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK;
    timerConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare);
    flexioBase->TIMCFG[base->timerIndex[0]] = timerConfig;
    return kStatus_Success;
}