/* Covert the input memory size to internal register set value.  */
static status_t SEMC_CovertMemorySize(SEMC_Type *base, uint32_t size_kbytes, uint8_t *sizeConverted)
/* Covert the input memory size to internal register set value.  */
static status_t SEMC_CovertMemorySize(SEMC_Type *base, uint32_t size_kbytes, uint8_t *sizeConverted)
{
    assert(sizeConverted);
    uint32_t memsize;
    if ((size_kbytes < SEMC_BR_MEMSIZE_MIN) || (size_kbytes > SEMC_BR_MEMSIZE_MAX))
    {
        return kStatus_SEMC_InvalidMemorySize;
    }
    *sizeConverted = 0;
    memsize = size_kbytes / 8;
    while (memsize)
    {
        memsize >>= 1;
        (*sizeConverted)++;
    }
    return kStatus_Success;
}