/* Convert the D-PHY PLL CM to the value could be set to register.  */
static uint8_t DSI_EncodeDphyPllCm(uint8_t cm)
/* Convert the D-PHY PLL CM to the value could be set to register.  */
static uint8_t DSI_EncodeDphyPllCm(uint8_t cm)
{
    assert(cm >= 16U);
    if (cm <= 31U)
    {
        return 0xE0U | cm;
    }
    else if (cm <= 63U)
    {
        return 0xC0U | (cm & 0x1FU);
    }
    else if (cm <= 127U)
    {
        return 0x80U | (cm & 0x3FU);
    }
    else
    {
        return cm & 0xCFU;
    }
}