/* param base MIPI DSI host peripheral base address. param payload Pointer to the payload. param payloadSize Payload size in byte.  */
void DSI_ReadApbRxPayload(const MIPI_DSI_Type *base, uint8_t *payload, uint16_t payloadSize)
/* param base MIPI DSI host peripheral base address. param payload Pointer to the payload. param payloadSize Payload size in byte.  */
void DSI_ReadApbRxPayload(const MIPI_DSI_Type *base, uint8_t *payload, uint16_t payloadSize)
{
    uint32_t tmp;
    for (uint16_t i = 0; i < payloadSize / 4U; i++)
    {
        tmp        = base->apb->PKT_RX_PAYLOAD;
        payload[0] = (uint8_t)(tmp & 0xFFU);
        payload[1] = (uint8_t)((tmp >> 8U) & 0xFFU);
        payload[2] = (uint8_t)((tmp >> 16U) & 0xFFU);
        payload[3] = (uint8_t)((tmp >> 24U) & 0xFFU);
        payload += 4U;
    }
    if (0U != (payloadSize & 0x03U))
    {
        tmp = base->apb->PKT_RX_PAYLOAD;
        for (uint16_t i = 0; i < (payloadSize & 0x3U); i++)
        {
            payload[i] = (uint8_t)(tmp & 0xFFU);
            tmp >>= 8U;
        }
    }
}